udisks icon indicating copy to clipboard operation
udisks copied to clipboard

"Error finding object for block device" when unmounting Btrfs drives

Open itaranto opened this issue 1 year ago • 5 comments

Every time I unmount any of my Btrfs-formated external drives I get something like this:

$ umount /run/media/ignacio/External
Error finding object for block device 0:61

Even using umount on the device file directly doesn't work:

$ umount /dev/sdf1
Error finding object for block device 0:61

The only way I can make this work is by using udisksctl -b like this:

$ udisksctl unmount -b /dev/sdf1
Unmounted /dev/sdf1.

itaranto avatar Oct 17 '24 01:10 itaranto

umount is unrelated to UDisks, please open an issue on https://github.com/util-linux/util-linux/

tbzatek avatar Oct 22 '24 18:10 tbzatek

umount is unrelated to UDisks, please open an issue on https://github.com/util-linux/util-linux/

I forgot to answer here. This was my first thought as well, but no, this is actually error from our unmount helper called by umount. Unfortunately umount.udisks2 is very basic tool that doesn't work with btrfs (it's completely confused by the major 0 of the device) and will need some work.

vojtechtrefny avatar Oct 22 '24 18:10 vojtechtrefny

Ah, I see that now, totally forgot about the mount helper.

tbzatek avatar Oct 22 '24 18:10 tbzatek

TODO: add umount tests in test_80_filesystem.py, so far we're only testing unmount through the D-Bus API.

tbzatek avatar Oct 23 '24 09:10 tbzatek

The problem with btrfs and device major:minor numbers is this one: https://github.com/storaged-project/udisks/blob/master/src/udisksmountmonitor.c#L504-L553

tbzatek avatar Oct 23 '24 09:10 tbzatek