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

Udiskie mounts each part of btrfs RAID1 array as a separate mount #201

Open
wiktor-k opened this issue Apr 1, 2020 · 4 comments
Open

Udiskie mounts each part of btrfs RAID1 array as a separate mount #201

wiktor-k opened this issue Apr 1, 2020 · 4 comments

Comments

@wiktor-k
Copy link

wiktor-k commented Apr 1, 2020

Hi,

I have a RAID1 btrfs setup that has two disk parts. It looks like this:

$ lsblk -f
NAME                                          FSTYPE      FSVER    LABEL      UUID
sdb
└─sdb1                                        crypto_LUKS 2                   a3674553-8613-4b93-acfe-3506f21bf280
  └─luks-a3674553-8613-4b93-acfe-3506f21bf280 btrfs                backup     bf958e29-f40e-4665-a7c2-3d65f9db0ac3
sdd
└─sdd1                                        crypto_LUKS 2                   490c5af3-26a8-4d4f-ae48-5def0e79c406
  └─luks-490c5af3-26a8-4d4f-ae48-5def0e79c406 btrfs                backup     bf958e29-f40e-4665-a7c2-3d65f9db0ac3

And udiskie mounts each part separately:

$ ls media
backup   backup1

It doesn't hurt but it would be enough to mount just one of them.

Notice that after unlocking both parts have the same UUID (bf958e29-f40e-4665-a7c2-3d65f9db0ac3).

By the way: big thank you for this extremely useful piece of software ❤️

@coldfix
Copy link
Owner

coldfix commented Apr 1, 2020

Hi,

thanks for your comment! Being honest, I don't have much experience with neither RAID nor btrfs. I'm aware that RAID and LVM are currently not supported very well, and it would be awesome to change that. However, I cannot promise to have time to do that anytime soon. Contributions are welcome in these matters.

Best, Thomas

@wiktor-k
Copy link
Author

wiktor-k commented Apr 1, 2020

Thanks for the quick reply!

Actually I think this is well supported (I'm not quite sure about LVM RAID though). Just creates too many mount paths than necessary.

I was thinking about having an in-memory map of UUIDs to mount points and if a partition UUID is already mounted then skip mounting. In my case two partitions have the same UUID (after luks unwrapping): bf958e29-f40e-4665-a7c2-3d65f9db0ac3 so it's not necessary to mount both, just one.

@coldfix
Copy link
Owner

coldfix commented Apr 1, 2020

That's probably the simplest solution. Not sure it works in all cases. Another one might be see if udisks provides any info on the RAID structure. Can you check if there are any relevant sections in the output of udisksctl dump, and if so, post everything belonging to it here.

@wiktor-k
Copy link
Author

wiktor-k commented Apr 1, 2020

It seems udisksctl dump has two sections for both physical partitions:

/org/freedesktop/UDisks2/block_devices/dm_2d2:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/org/freedesktop/UDisks2/block_devices/sdb1'
    Device:                     /dev/dm-2
    DeviceNumber:               65026
    Drive:                      '/'
    HintAuto:                   false
    HintIconName:
    HintIgnore:                 false
    HintName:
    HintPartitionable:          false
    HintSymbolicIconName:
    HintSystem:                 true
    Id:                         by-id-dm-name-luks-a3674553-8613-4b93-acfe-3506f21bf280
    IdLabel:                    backup
    IdType:                     btrfs
    IdUUID:                     bf958e29-f40e-4665-a7c2-3d65f9db0ac3
    IdUsage:                    filesystem
    IdVersion:
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/mapper/luks-a3674553-8613-4b93-acfe-3506f21bf280
    ReadOnly:                   false
    Size:                       3000541101568
    Symlinks:                   /dev/disk/by-id/dm-name-luks-a3674553-8613-4b93-acfe-3506f21bf280
                                /dev/disk/by-id/dm-uuid-CRYPT-LUKS2-a367455386134b93acfe3506f21bf280-luks-a3674553-8613-4b93-acfe-3506f21bf280
                                /dev/disk/by-label/backup
                                /dev/disk/by-uuid/bf958e29-f40e-4665-a7c2-3d65f9db0ac3
                                /dev/mapper/luks-a3674553-8613-4b93-acfe-3506f21bf280
    UserspaceMountOptions:
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:
    Size:               0

/org/freedesktop/UDisks2/block_devices/dm_2d3:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/org/freedesktop/UDisks2/block_devices/sdd1'
    Device:                     /dev/dm-3
    DeviceNumber:               65027
    Drive:                      '/'
    HintAuto:                   false
    HintIconName:
    HintIgnore:                 false
    HintName:
    HintPartitionable:          false
    HintSymbolicIconName:
    HintSystem:                 true
    Id:                         by-id-dm-name-luks-490c5af3-26a8-4d4f-ae48-5def0e79c406
    IdLabel:                    backup
    IdType:                     btrfs
    IdUUID:                     bf958e29-f40e-4665-a7c2-3d65f9db0ac3
    IdUsage:                    filesystem
    IdVersion:
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/mapper/luks-490c5af3-26a8-4d4f-ae48-5def0e79c406
    ReadOnly:                   false
    Size:                       3000541101568
    Symlinks:                   /dev/disk/by-id/dm-name-luks-490c5af3-26a8-4d4f-ae48-5def0e79c406
                                /dev/disk/by-id/dm-uuid-CRYPT-LUKS2-490c5af326a84d4fae485def0e79c406-luks-490c5af3-26a8-4d4f-ae48-5def0e79c406
                                /dev/disk/by-label/backup
                                /dev/disk/by-uuid/bf958e29-f40e-4665-a7c2-3d65f9db0ac3
                                /dev/mapper/luks-490c5af3-26a8-4d4f-ae48-5def0e79c406
    UserspaceMountOptions:      uhelper=udisks2
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        /run/media/wiktor/backup
                        /run/media/wiktor/backup1
    Size:               0

But a funny coincidence that it sees the second partition as having two MountPoints and the first as not having any.

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

2 participants