Trying to change the volume label of a mounted Btrfs or swap partition in the YaST partitioner fails with an error message
Setting label of btrfs on /dev/sda2 (57.50 GiB) to root Unexpected situation found in the system.
The "Details" button shows
Caught signal #127: "/sbin/btrfs filesystem label '/dev/sda2' 'root'
which is scary and confusing and does not give the user any hint what's actually wrong.
In the case of a root Btrfs, it even hangs later because subvolumes cannot be mounted.
Cause
Even though some filesystem types do support changing the volume label while mounted, in our context this has implications with the subvolumes. Handling the subvolumes properly very likely requires a very intrusive code change which involves quite some risk.
Fix
So we chose the less intrusive approach to disable it on the UI level: When we detect that the filesystem or swap space is actively mounted, we are now disabling the "Volume Label" field in the "Fstab Options" dialog.
Screenshots
Partitioner with a mounted Btrfs on /dev/sdb1
Editing /dev/sdb1
"Volume Label" field disabled because the filesystem is mounted, so changing it would fail.
After unmounting, saving the changes and entering the partitioner again, the volume label can now be changed.
Test
Extensive manual tests in a VM with a second virtual disk where partitions can be easily added and changed.
coverage: 97.748% (-0.003%) from 97.751% when pulling 0eaf97c04d1b3aa71a6c0e320e7a4179b1e4a418 on huha-vol-label-sp5 into 7746bc11f8d7b03b5ae227429f7b306690c4ffb2 on SLE-15-SP5.
Target Branch
This is the merge of #1340 to SLE-15-SP5.
Bugzilla
L3: https://bugzilla.suse.com/show_bug.cgi?id=1211337
Trello
https://trello.com/c/JvuZVVU3
Problem
Trying to change the volume label of a mounted Btrfs or swap partition in the YaST partitioner fails with an error message
Setting label of btrfs on /dev/sda2 (57.50 GiB) to root Unexpected situation found in the system.
The "Details" button shows
Caught signal #127: "/sbin/btrfs filesystem label '/dev/sda2' 'root'
which is scary and confusing and does not give the user any hint what's actually wrong.
In the case of a root Btrfs, it even hangs later because subvolumes cannot be mounted.
Cause
Even though some filesystem types do support changing the volume label while mounted, in our context this has implications with the subvolumes. Handling the subvolumes properly very likely requires a very intrusive code change which involves quite some risk.
Fix
So we chose the less intrusive approach to disable it on the UI level: When we detect that the filesystem or swap space is actively mounted, we are now disabling the "Volume Label" field in the "Fstab Options" dialog.
Screenshots
Test
Extensive manual tests in a VM with a second virtual disk where partitions can be easily added and changed.
Related PRs