Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bcachefs is not device mapper multi-path aware #260

Open
tasleson opened this issue Apr 30, 2024 · 0 comments
Open

bcachefs is not device mapper multi-path aware #260

tasleson opened this issue Apr 30, 2024 · 0 comments

Comments

@tasleson
Copy link

If you try to mount bcachefs using a UUID or a single block device today which causes a mount by FS UUID, the mount will fail with

Fatal error: Device or resource busy

This is caused by multiple paths which correspond to the same block device which all have the same FS UUID when every block device is examined and the super block is read up.

An example output of failure (abbreviated):

# BCACHEFS_BLOCK_SCAN=1 bcachefs mount -v UUID=a7a20e78-f7b9-419d-845f-a0d4c21bf6cd /mnt
DEBUG - bcachefs::commands::cmd_mount: Checking all block devices for bcachefs super block!
DEBUG - bcachefs::commands::cmd_mount: enumerating devices with UUID a7a20e78-f7b9-419d-845f-a0d4c21bf6cd
bcachefs (/dev/sdah): error reading default superblock: Not a bcachefs superblock (got magic 00000000-0000-0000-0000-000000000000)
bcachefs (/dev/sdah): error reading superblock: Not a bcachefs superblock layout
bcachefs (/dev/sdai): error reading default superblock: Not a bcachefs superblock (got magic 00000000-0000-0000-0000-000000000000)
...
bcachefs (/dev/dm-9): error reading default superblock: Not a bcachefs superblock (got magic 00000000-0000-0000-0000-000000000000)
bcachefs (/dev/dm-9): error reading superblock: Not a bcachefs superblock layout
INFO - bcachefs::commands::cmd_mount: mounting with params: device: /dev/sdo:/dev/sdi:/dev/sdae:/dev/sdy:/dev/dm-14:/dev/dm-18, target: /mnt, options: 
DEBUG - bcachefs::commands::cmd_mount: parsing mount options: 
INFO - bcachefs::commands::cmd_mount: mounting bcachefs filesystem, /mnt
INFO - bcachefs::commands::cmd_mount: mounting filesystem
ERROR - bcachefs::commands::cmd_mount: Fatal error: Device or resource busy

When using the change in #254 we work as the udev db only has the FS UUID for the correct /dev/dm-N devices to use.

eg.

#  bcachefs mount -v UUID=a7a20e78-f7b9-419d-845f-a0d4c21bf6cd /mnt
DEBUG - bcachefs::commands::cmd_mount: Walking udev db!
DEBUG - bcachefs::commands::cmd_mount: enumerating devices with UUID a7a20e78-f7b9-419d-845f-a0d4c21bf6cd
INFO - bcachefs::commands::cmd_mount: mounting with params: device: /dev/dm-14:/dev/dm-18, target: /mnt, options: 
DEBUG - bcachefs::commands::cmd_mount: parsing mount options: 
INFO - bcachefs::commands::cmd_mount: mounting bcachefs filesystem, /mnt
INFO - bcachefs::commands::cmd_mount: mounting filesystem
INFO - bcachefs::commands::cmd_mount: Successfully mounted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant