I’m having issues with the rootfs being mounted as readonly by default. This has been an issue since I installed openSUSE 15.2. It was ok for the first few weeks, but since then it’s always been readonly by default (which prevents automatic updates from working etc).
/dev/sda2 on / type btrfs (**ro**,relatime,ssd,space_cache,subvolid=256,subvol=/@)
I don’t see any error messages (in dmesg). And I can remount the partition as rw just fine manually (mount -o remount,rw / ). The file system is btrfs - and I’m still running 15.2.
I did try the obvious fix by running a file system check (btrfs check --repair) using a rescue system. But no issues are reported, nor does the checker attempt to fix anything.
Any pointers what could cause this or where to look into would be greatly appreciated.
Due the way rootfs is mounted I’d say snapshots aren’t enabled on this system. Not sure but I think they can de disabled during install.
As pointed out by arvidjaar you jumped at the gun here. Since you can simply remount it read/write afterwards I’d say there’s no structural damage to be repaired. Something is mounting the system R-O, you’ll need to provide full logs to further troubleshoot.
Ok, ok, I’ll leave the “–repair” option alone. Indeed it does say so in the man page to be careful… Hopefully it hasn’t done anything. It’s log output suggested it hadn’t found any errors.
Before I diving into further details - I made some tests with “yast partitioner”: I toggled the root device to be mounted readonly (and planned to toggle the property again later). Yast allows to me to make selections for the root device in the GUI - but it doesn’t change anything in /etc/fstab. Indeed yast actually says “nothing changed” when applying the property changes to the root partition - which is clearly not right (since I did change a root device’s mount property). Changing properties does work as expected for all other partitions.
I then noticed that yast does not write any entry for the root device to /etc/fstab.
Maybe that’s a stupid question - but shouldn’t there be an entry for the “/” in fstab?
I went ahead and manually added an entry for “/” to fstab:
/dev/sda2 / btrfs subvol=/@ 0 1
That did help. Now the root directory is mounted as readwrite when booting - as expected.
But now “yast partitioner” is unhappy: it complains the root device was shadowed by another partition - and I can no longer manager any of the partitions through the GUI.
Am I completely heading into the wrong direction here - or is the missing entry in fstab triggering the readonly issue?
Ok, thanks everyone. I think I’ve got it sorted now…
I changed the missing fstab entry to:
/dev/sda2 / btrfs noatime,ssd,space_cache 0 1
and now everything seems to work as expected: the root directory is rw mounted when booting. And yast also accepts it - and is able to apply changes again.
Yast didn’t work when mentioning the “subvol=/@” in the root directory’s fstab entry (even though this still shows up when checking the status of actually mounted partitions later):
user@machine:~> mount|grep sda2
/dev/sda2 on / type btrfs (rw,noatime,ssd,space_cache,subvolid=256,**subvol=/@**)
Adding the “subvol=/@” to fstab would work fine when booting. But this would cause yast to fail with some “partition is shadowed” error message.
So, I guess it all boils down to some weirdness with “yast partitioner”. Initially my issue obviously started when somehow the root entry got lost. And while this entry is missing in fstab, then yast happily and silently just ignores any property changes made to this partition in the GUI.