Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Unable to write on any disk of the array or cache (read only) after power outage

Featured Replies

Hi,

I need help since after a power outage I have access to my data in read only mode. (tried in safe mode and I have the same issue)

 

I use unraid to backup a synlogy NAS so in case I can start again from scratch but I would like to understand what happened if possible.

thanks in advance for your help!

 

Starting and stopping the array I can see these lines in syslog: (same for the 3 disks in the array)

Nov 28 21:44:05 snasbck emhttpd: shcmd (5996): mount -t btrfs -o noatime,space_cache=v2 /dev/md1p1 /mnt/disk1
Nov 28 21:44:05 snasbck kernel: BTRFS: device fsid 3ed1a0fc-fef5-4bb5-83e7-bcbb61446162 devid 1 transid 7525 /dev/md1p1 scanned by mount (31992)
Nov 28 21:44:05 snasbck kernel: BTRFS info (device md1p1): using crc32c (crc32c-intel) checksum algorithm
Nov 28 21:44:05 snasbck kernel: BTRFS info (device md1p1): using free space tree
Nov 28 21:44:11 snasbck emhttpd: /mnt/disk1: autotrim setxattr error: Read-only file system
Nov 28 21:44:11 snasbck emhttpd: /mnt/disk1: compression setxattr error: Read-only file system
Nov 28 21:44:11 snasbck emhttpd: shcmd (5997): btrfs filesystem resize 1:max /mnt/disk1

 

root@snasbck:~# touch /mnt/disk1/a
touch: cannot touch '/mnt/disk1/a': Read-only file system
root@snasbck:~#

 

On  disks I ran:

root@snasbck:~# btrfs dev stats /mnt/disk1
[/dev/md1p1].write_io_errs    0
[/dev/md1p1].read_io_errs     0
[/dev/md1p1].flush_io_errs    0
[/dev/md1p1].corruption_errs  0
[/dev/md1p1].generation_errs  0

root@snasbck:~# btrfs dev stats /mnt/disk2
[/dev/md2p1].write_io_errs    0
[/dev/md2p1].read_io_errs     0
[/dev/md2p1].flush_io_errs    0
[/dev/md2p1].corruption_errs  0
[/dev/md2p1].generation_errs  0
root@snasbck:~# btrfs dev stats /mnt/disk3
[/dev/md3p1].write_io_errs    0
[/dev/md3p1].read_io_errs     0
[/dev/md3p1].flush_io_errs    0
[/dev/md3p1].corruption_errs  0
[/dev/md3p1].generation_errs  0
root@snasbck:~# btrfs dev stats /mnt/cache
[/dev/sdb1].write_io_errs    0
[/dev/sdb1].read_io_errs     0
[/dev/sdb1].flush_io_errs    0
[/dev/sdb1].corruption_errs  0
[/dev/sdb1].generation_errs  0
root@snasbck:~#

 

root@snasbck:~# btrfs check /dev/md1p1
Opening filesystem to check...
Checking filesystem on /dev/md1p1
UUID: 3ed1a0fc-fef5-4bb5-83e7-bcbb61446162
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space tree
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
found 5704721584128 bytes used, no error found
total csum bytes: 5563904932
total tree bytes: 7282933760
total fs tree bytes: 834879488
total extent tree bytes: 87752704
btree space waste bytes: 891111590
file data blocks allocated: 5697438650368
 referenced 5697438650368

 

root@snasbck:~# btrfs check /dev/md2p1
Opening filesystem to check...
Checking filesystem on /dev/md2p1
UUID: db866929-8755-4d41-a352-5589812c00af
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space tree
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
found 3996478119936 bytes used, no error found
total csum bytes: 3897380664
total tree bytes: 5560320000
total fs tree bytes: 985268224
total extent tree bytes: 80429056
btree space waste bytes: 744443920
file data blocks allocated: 3990917799936
 referenced 3990917799936

 

root@snasbck:~# btrfs check /dev/md3p1
Opening filesystem to check...
Checking filesystem on /dev/md3p1
UUID: 6872e394-796c-46ef-9560-2e9237e98867
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space tree
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
found 3999059701760 bytes used, no error found
total csum bytes: 3900592876
total tree bytes: 4852596736
total fs tree bytes: 394608640
total extent tree bytes: 47316992
btree space waste bytes: 544501468
file data blocks allocated: 3994207105024
 referenced 3994207105024

 

I'm running scrub on all the disks

on cache has already finish:

root@snasbck:~# btrfs scrub status /mnt/cache/
UUID:             c8ec704c-6831-4ad9-9885-2a03c5873442
Scrub started:    Tue Nov 28 22:13:20 2023
Status:           finished
Duration:         0:02:19
Total to scrub:   63.80GiB
Rate:             470.03MiB/s
Error summary:    no errors found
root@snasbck:~#

 

On other disk as well:

root@snasbck:~# btrfs scrub status /mnt/disk1
UUID:             3ed1a0fc-fef5-4bb5-83e7-bcbb61446162
        no stats available
Total to scrub:   5.19TiB
Rate:             0.00B/s
Error summary:    no errors found


root@snasbck:~# btrfs scrub status /mnt/disk2
UUID:             db866929-8755-4d41-a352-5589812c00af
        no stats available
Total to scrub:   3.64TiB
Rate:             0.00B/s
Error summary:    no errors found


root@snasbck:~# btrfs scrub status /mnt/disk3
UUID:             6872e394-796c-46ef-9560-2e9237e98867
        no stats available
Total to scrub:   3.64TiB
Rate:             0.00B/s
Error summary:    no errors found
root@snasbck:~#

 

Basic info about my build:

Version 6.12.4 2023-08-31

MB: DQ67EP

i7-2600

DELL PERC H310 IT mode LSI SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)

4x SAS SEAGATE ST8000NM0075

1x SATA Micron_M500DC_MT 0134

 

 

 

 

 

 

snasbck-diagnostics-20231128-2228.zip

Edited by elomon

Solved by JorgeB

  • Community Expert

Don't see why they are mounting read-only, post the output of

mount

 

  • Author

Thanks for your reply, here is the output of the mount command:

 

root@snasbck:~# mount
rootfs on / type rootfs (rw,size=4018760k,nr_inodes=1004690,inode64)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=32768k,mode=755,inode64)
/dev/sda1 on /boot type vfat (rw,noatime,nodiratime,fmask=0177,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,flush,errors=remount-ro)
/boot/bzmodules on /lib type squashfs (ro,relatime,errors=continue)
overlay on /lib type overlay (rw,relatime,lowerdir=/lib,upperdir=/var/local/overlay/lib,workdir=/var/local/overlay-work/lib)
/boot/bzfirmware on /usr type squashfs (ro,relatime,errors=continue)
overlay on /usr type overlay (rw,relatime,lowerdir=/usr,upperdir=/var/local/overlay/usr,workdir=/var/local/overlay-work/usr)
devtmpfs on /dev type devtmpfs (rw,relatime,size=8192k,nr_inodes=1004690,mode=755,inode64)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime,inode64)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
hugetlbfs on /hugetlbfs type hugetlbfs (rw,relatime,pagesize=2M)
cgroup_root on /sys/fs/cgroup type tmpfs (rw,relatime,size=8192k,mode=755,inode64)
none on /sys/fs/cgroup type cgroup2 (rw,relatime)
tmpfs on /var/log type tmpfs (rw,relatime,size=131072k,mode=755,inode64)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
rootfs on /mnt type rootfs (rw,size=4018760k,nr_inodes=1004690,inode64)
tmpfs on /mnt/disks type tmpfs (rw,relatime,size=1024k,inode64)
tmpfs on /mnt/remotes type tmpfs (rw,relatime,size=1024k,inode64)
tmpfs on /mnt/addons type tmpfs (rw,relatime,size=1024k,inode64)
tmpfs on /mnt/rootshare type tmpfs (rw,relatime,size=1024k,inode64)
nfsd on /proc/fs/nfs type nfsd (rw,relatime)
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
/dev/md1p1 on /mnt/disk1 type btrfs (rw,noatime,space_cache=v2,subvolid=5,subvol=/)
/dev/md2p1 on /mnt/disk2 type btrfs (rw,noatime,space_cache=v2,subvolid=5,subvol=/)
/dev/md3p1 on /mnt/disk3 type btrfs (rw,noatime,space_cache=v2,subvolid=5,subvol=/)
/dev/sdb1 on /mnt/cache type btrfs (rw,noatime,ssd,discard=async,space_cache=v2,subvolid=5,subvol=/)
shfs on /mnt/user0 type fuse.shfs (rw,nosuid,nodev,noatime,user_id=0,group_id=0,default_permissions,allow_other)
shfs on /mnt/user type fuse.shfs (rw,nosuid,nodev,noatime,user_id=0,group_id=0,default_permissions,allow_other)
/mnt/cache/system/libvirt/libvirt.img on /etc/libvirt type btrfs (ro,noatime,ssd,space_cache=v2,subvolid=5,subvol=/)
root@snasbck:~#

  • Community Expert
  • Solution
2 hours ago, elomon said:

/dev/md1p1 on /mnt/disk1 type btrfs (rw,noatime,space_cache=v2,subvolid=5,subvol=/)
/dev/md2p1 on /mnt/disk2 type btrfs (rw,noatime,space_cache=v2,subvolid=5,subvol=/)
/dev/md3p1 on /mnt/disk3 type btrfs (rw,noatime,space_cache=v2,subvolid=5,subvol=/)

According to this all disks are mounted read/write.

 

Post the output of:

btrfs prop get /mnt/disk1

 

  • Author

Linux 6.1.49-Unraid.
root@snasbck:~# btrfs prop get /mnt/disk1
ro=true
label=
root@snasbck:~#

  • Author

thanks for posting this command I googled it and I managed to change this flag

 

root@snasbck:~# btrfs property set -ts /mnt/disk1 ro false
root@snasbck:~# btrfs prop get /mnt/disk1
ro=false
label=
root@snasbck:~# touch /mnt/disk1/test.txt
root@snasbck:~#

 

After a reboot the btrfs fs is still in RW do toy think this flag has been added automatically due to the power outage?

 

Do you recommend to run a parity check and scrub again?

 

I'll wait for your reply, if no reply i will mark this as resolved this evening

Edited by elomon

  • Community Expert
36 minutes ago, elomon said:

After a reboot the btrfs fs is still in RW do toy think this flag has been added automatically due to the power outage?

It's very strange, don't remember seeing this before, but changing the flag to false should solve it, parity check would be a good idea if not still run after the unclean shutdown.

  • Author

I will run it now, I cancelled the parity check when I realized that the FS was in RO.

If I had to start from scratch there was no point to wait 8 hours for the parity check.

 

Thanks a lot I marked your reply as the resolution since it pointed me in the correct direction.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.