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

mounting internal LUKS partition fails: unhandled device #220

Open
HendrikR opened this issue Mar 27, 2021 · 5 comments
Open

mounting internal LUKS partition fails: unhandled device #220

HendrikR opened this issue Mar 27, 2021 · 5 comments

Comments

@HendrikR
Copy link

HendrikR commented Mar 27, 2021

Hi,
I have an internal disk with an encrypted partition, /dev/mmcblk1p3. In the past, I could unlock/mount this disk with udiskie:

udiskie-mount -v /dev/mmcblk1p3
DEBUG udiskie.config: /dev/mmcblk1 matched {!is_external, is_toplevel} -> {ignore}
WARNING udiskie.mount: not unlocking /org/freedesktop/UDisks2/block_devices/mmcblk1p3: unhandled device

Debugging into the issue, I found that the match_config() function in config.py first checks the is_toplevel rule for /dev/mmcblk1p3, then checks its parent device, /dev/mmcblk1, which of course is a toplevel device, making the rule fail.
I believe this is a bug, since by iterating up to the toplevel (via device = device.partition_slave) in the while loop in match_config, every device is eventually marked as a toplevel device.

@coldfix
Copy link
Owner

coldfix commented Jun 14, 2021

Hi,

thanks for the info. I'm very sorry to respond so late, I seem to have missed this issue. Unfortunately, I probably won't have time to look further into this in the next month or so either.

match_config() is supposed to check parent devices only after none of the rules matched on the current device, so it's most likely that /dev/mmcblk1p3 for some reason doesn't match any of the builtin rules. Can you also provide the udisksctl dump of all involved devices?

Anyway, I want to change the CLI so that user command line is considered more important than rules... udiskie-mount shouldn't refuse from trying to mount/unmount a particular device if it was passed explicitly on the command line.

@dngray
Copy link

dngray commented Feb 3, 2022

I think I had this issue with my NVMe. I can provide the related output.

  1. udisksctl unlock -b /dev/nvme0n1p3 log:
daemon.info dbus-daemon[2481]: [system] Successfully activated service 'org.freedesktop.UDisks2'
authpriv.notice polkitd[3324]: Operator of unix-session:c1 successfully authenticated as unix-user:user to gain TEMPORARY authorization for action org.freedesktop.udisks2.encrypted-unlock-system for system-bus-name::1.14 [udisksctl unlock -b /dev/nvme0n1p3] (owned by unix-user:user)
  1. udisksctl info -b /dev/nvme0n1p3
/org/freedesktop/UDisks2/block_devices/nvme0n1p3:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/nvme0n1p3
    DeviceNumber:               66307
    Drive:                      '/org/freedesktop/UDisks2/drives/00000000512G_NVMe_TOSHIBA_512GB_000000000000'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         by-id-nvme-00000000512G_NVMe_TOSHIBA_512GB_000000000000-part3
    IdLabel:                    
    IdType:                     crypto_LUKS
    IdUUID:                     98022050-64c4-4e98-8d73-0d431db5a558
    IdUsage:                    crypto
    IdVersion:                  2
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/nvme0n1p3
    ReadOnly:                   false
    Size:                       510405902336
    Symlinks:                   /dev/disk/by-id/nvme-00000000512G_NVMe_TOSHIBA_512GB_000000000000-part3
                                /dev/disk/by-id/nvme-eui.00000000000000000000000000000000-part3
                                /dev/disk/by-partuuid/393ea908-28bd-4cef-afad-cc77e9f4a64c
                                /dev/disk/by-uuid/98022050-64c4-4e98-8d73-0d431db5a558
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.Encrypted:
    ChildConfiguration:         []
    CleartextDevice:            '/org/freedesktop/UDisks2/block_devices/dm_2d0'
    HintEncryptionType:         LUKS
    MetadataSize:               16777216
  org.freedesktop.UDisks2.Partition:
    Flags:              0
    IsContained:        false
    IsContainer:        false
    Name:               
    Number:             3
    Offset:             1703936000
    Size:               510405902336
    Table:              '/org/freedesktop/UDisks2/block_devices/nvme0n1'
    Type:               0fc63daf-8483-4772-8e79-3d69d8477de4
    UUID:               393ea908-28bd-4cef-afad-cc77e9f4a64c

  1. udisksctl dump -b /dev/nvme0n1p3
/org/freedesktop/UDisks2/Manager:
  org.freedesktop.UDisks2.Manager:
    DefaultEncryptionType:      luks1
    SupportedEncryptionTypes:   luks1
                                luks2
    SupportedFilesystems:       ext2
                                ext3
                                ext4
                                vfat
                                ntfs
                                exfat
                                xfs
                                reiserfs
                                nilfs2
                                btrfs
                                minix
                                udf
                                f2fs
                                swap
    Version:                    2.9.4

/org/freedesktop/UDisks2/block_devices/nvme0n1:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/nvme0n1
    DeviceNumber:               66304
    Drive:                      '/org/freedesktop/UDisks2/drives/00000000512G_NVMe_TOSHIBA_512GB_000000000000'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         by-id-nvme-00000000512G_NVMe_TOSHIBA_512GB_000000000000
    IdLabel:                    
    IdType:                     
    IdUUID:                     
    IdUsage:                    
    IdVersion:                  
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/nvme0n1
    ReadOnly:                   false
    Size:                       512110190592
    Symlinks:                   /dev/disk/by-id/nvme-00000000512G_NVMe_TOSHIBA_512GB_000000000000
                                /dev/disk/by-id/nvme-eui.00000000000000000000000000000000
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.PartitionTable:
    Partitions:         /org/freedesktop/UDisks2/block_devices/nvme0n1p1
                        /org/freedesktop/UDisks2/block_devices/nvme0n1p3
                        /org/freedesktop/UDisks2/block_devices/nvme0n1p2
    Type:               gpt

/org/freedesktop/UDisks2/block_devices/nvme0n1p1:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/nvme0n1p1
    DeviceNumber:               66305
    Drive:                      '/org/freedesktop/UDisks2/drives/00000000512G_NVMe_TOSHIBA_512GB_000000000000'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 true
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         by-id-nvme-00000000512G_NVMe_TOSHIBA_512GB_000000000000-part1
    IdLabel:                    
    IdType:                     vfat
    IdUUID:                     485E-2F66
    IdUsage:                    filesystem
    IdVersion:                  FAT32
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/nvme0n1p1
    ReadOnly:                   false
    Size:                       629145600
    Symlinks:                   /dev/disk/by-id/nvme-00000000512G_NVMe_TOSHIBA_512GB_000000000000-part1
                                /dev/disk/by-id/nvme-eui.00000000000000000000000000000000-part1
                                /dev/disk/by-partlabel/EFI\x20System\x20Partition
                                /dev/disk/by-partuuid/6b74ab82-eaef-4ca9-afb9-677f3c8e3c22
                                /dev/disk/by-uuid/485E-2F66
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        
    Size:               0
  org.freedesktop.UDisks2.Partition:
    Flags:              0
    IsContained:        false
    IsContainer:        false
    Name:               EFI System Partition
    Number:             1
    Offset:             1048576
    Size:               629145600
    Table:              '/org/freedesktop/UDisks2/block_devices/nvme0n1'
    Type:               c12a7328-f81f-11d2-ba4b-00a0c93ec93b
    UUID:               6b74ab82-eaef-4ca9-afb9-677f3c8e3c22

/org/freedesktop/UDisks2/block_devices/nvme0n1p2:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/nvme0n1p2
    DeviceNumber:               66306
    Drive:                      '/org/freedesktop/UDisks2/drives/00000000512G_NVMe_TOSHIBA_512GB_000000000000'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         by-id-nvme-00000000512G_NVMe_TOSHIBA_512GB_000000000000-part2
    IdLabel:                    
    IdType:                     ext4
    IdUUID:                     500fcecf-4022-4b85-b0f8-1ee3d0e7e784
    IdUsage:                    filesystem
    IdVersion:                  1.0
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/nvme0n1p2
    ReadOnly:                   false
    Size:                       1073741824
    Symlinks:                   /dev/disk/by-id/nvme-00000000512G_NVMe_TOSHIBA_512GB_000000000000-part2
                                /dev/disk/by-id/nvme-eui.00000000000000000000000000000000-part2
                                /dev/disk/by-partuuid/b344cc12-356c-492a-8772-6d53f9141d05
                                /dev/disk/by-uuid/500fcecf-4022-4b85-b0f8-1ee3d0e7e784
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:        
    Size:               0
  org.freedesktop.UDisks2.Partition:
    Flags:              0
    IsContained:        false
    IsContainer:        false
    Name:               
    Number:             2
    Offset:             630194176
    Size:               1073741824
    Table:              '/org/freedesktop/UDisks2/block_devices/nvme0n1'
    Type:               0fc63daf-8483-4772-8e79-3d69d8477de4
    UUID:               b344cc12-356c-492a-8772-6d53f9141d05

/org/freedesktop/UDisks2/block_devices/nvme0n1p3:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/nvme0n1p3
    DeviceNumber:               66307
    Drive:                      '/org/freedesktop/UDisks2/drives/00000000512G_NVMe_TOSHIBA_512GB_000000000000'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         by-id-nvme-00000000512G_NVMe_TOSHIBA_512GB_000000000000-part3
    IdLabel:                    
    IdType:                     crypto_LUKS
    IdUUID:                     98022050-64c4-4e98-8d73-0d431db5a558
    IdUsage:                    crypto
    IdVersion:                  2
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/nvme0n1p3
    ReadOnly:                   false
    Size:                       510405902336
    Symlinks:                   /dev/disk/by-id/nvme-00000000512G_NVMe_TOSHIBA_512GB_000000000000-part3
                                /dev/disk/by-id/nvme-eui.00000000000000000000000000000000-part3
                                /dev/disk/by-partuuid/393ea908-28bd-4cef-afad-cc77e9f4a64c
                                /dev/disk/by-uuid/98022050-64c4-4e98-8d73-0d431db5a558
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.Encrypted:
    ChildConfiguration:         []
    CleartextDevice:            '/'
    HintEncryptionType:         
    MetadataSize:               16777216
  org.freedesktop.UDisks2.Partition:
    Flags:              0
    IsContained:        false
    IsContainer:        false
    Name:               
    Number:             3
    Offset:             1703936000
    Size:               510405902336
    Table:              '/org/freedesktop/UDisks2/block_devices/nvme0n1'
    Type:               0fc63daf-8483-4772-8e79-3d69d8477de4
    UUID:               393ea908-28bd-4cef-afad-cc77e9f4a64c

/org/freedesktop/UDisks2/drives/00000000512G_NVMe_TOSHIBA_512GB_000000000000:
  org.freedesktop.UDisks2.Drive:
    CanPowerOff:                false
    Configuration:              {}
    ConnectionBus:              
    Ejectable:                  false
    Id:                         00000000512G-NVMe-TOSHIBA-512GB-000000000000
    Media:                      
    MediaAvailable:             true
    MediaChangeDetected:        true
    MediaCompatibility:         
    MediaRemovable:             false
    Model:                      00000000512G NVMe TOSHIBA 512GB
    Optical:                    false
    OpticalBlank:               false
    OpticalNumAudioTracks:      0
    OpticalNumDataTracks:       0
    OpticalNumSessions:         0
    OpticalNumTracks:           0
    Removable:                  false
    Revision:                   
    RotationRate:               0
    Seat:                       seat0
    Serial:                     000000000000
    SiblingId:                  
    Size:                       512110190592
    SortKey:                    00coldplug/00fixed/nvme0n1
    TimeDetected:               1643861151164271
    TimeMediaDetected:          1643861151164271
    Vendor:                     
    WWN:                        eui.00000000000000000000000000000000
                      

@dngray
Copy link

dngray commented Feb 3, 2022

I also have a sdcard in my machine and was able to unlock /dev/mmcblk0p1 successfully. So maybe something has been fixed since the above report?

I did come another problem though, which I don't think is udiskie's fault, but maybe you can give me some pointers as to what to try next. I was able to reproduce this with a LUKS encrypted USB stick too, with a single partition. I'm wondering if it's related to #200

Alpine Linux machine I was having issues getting udiskie to mount an encrypted volume.

  1. The polkit service is running as is lxqt-policykit-agent.

    2700 polkitd   0:00 /usr/lib/polkit-1/polkitd --no-debug
    3258 user      0:00 /usr/bin/lxqt-policykit-agent
    
  2. Dbus is also started and sway was executed with dbus-run-session sway. I copied the permissions to /etc/polkit-1/rules.d/50-udiskie.rules and when I ran polkit in debug mode I saw that it successfully loaded the rules. I also added myself to the storage group.:

    23:39:47.507: Loading rules from directory /etc/polkit-1/rules.d
    23:39:47.507: Loading rules from directory /usr/share/polkit-1/rules.d
    23:39:47.507: Finished loading, compiling and executing 6 rules
    Entering main event loop
    Connected to the system bus
    23:39:47.508: Acquired the name org.freedesktop.PolicyKit1 on the system bus
    23:39:47.542: Registered Authentication Agent for unix-session:c1 (system bus name :1.19 [/usr/bin/lxqt-policykit-agent], object path /org/lxqt/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
    
  3. When I use udiskie-mount /dev/sdb1, I only see options to unlock, lock, eject, unpower and that seems to work. Plugging the device in I see (i've censored the serial numbers):

    23:44:04.518: Added /org/freedesktop/UDisks2/drives/TOSHIBA_TransMemory_000000000000000000000000
      org.freedesktop.UDisks2.Drive:
        CanPowerOff:                true
        Configuration:              {}
        ConnectionBus:              usb
        Ejectable:                  true
        Id:                         TOSHIBA-TransMemory-000000000000000000000000
        Media:
        MediaAvailable:             true
        MediaChangeDetected:        true
        MediaCompatibility:
        MediaRemovable:             true
        Model:                      TransMemory
        Optical:                    false
        OpticalBlank:               false
        OpticalNumAudioTracks:      0
        OpticalNumDataTracks:       0
        OpticalNumSessions:         0
        OpticalNumTracks:           0
        Removable:                  true
        Revision:                   1.00
        RotationRate:               -1
        Seat:                       seat0
        Serial:                     000000000000000000000000
        SiblingId:                  /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/0000:04:02.0/0000:39:00.0/usb3/3-1/3-1.3/3-1.3:1.0
        Size:                       7759462400
        SortKey:                    01hotplug/1643894044515916
        TimeDetected:               1643894044515916
        TimeMediaDetected:          1643894044515916
        Vendor:                     TOSHIBA
        WWN:
    23:44:04.520: Added /org/freedesktop/UDisks2/block_devices/sdb
      org.freedesktop.UDisks2.Block:
        Configuration:              []
        CryptoBackingDevice:        '/'
        Device:                     /dev/sdb
        DeviceNumber:               2064
        Drive:                      '/org/freedesktop/UDisks2/drives/TOSHIBA_TransMemory_000000000000000000000000'
        HintAuto:                   true
        HintIconName:
        HintIgnore:                 false
        HintName:
        HintPartitionable:          true
        HintSymbolicIconName:
        HintSystem:                 false
        Id:
        IdLabel:
        IdType:
        IdUUID:
        IdUsage:
        IdVersion:
        MDRaid:                     '/'
        MDRaidMember:               '/'
        PreferredDevice:            /dev/sdb
        ReadOnly:                   false
        Size:                       7759462400
        Symlinks:                   /dev/disk/by-id/usb-TOSHIBA_TransMemory_000000000000000000000000-0:0
                                    /dev/disk/by-path/pci-0000:39:00.0-usb-0:1.3:1.0-scsi-0:0:0:0
        UserspaceMountOptions:
      org.freedesktop.UDisks2.PartitionTable:
        Partitions:
        Type:               gpt
    23:44:04.535: Added /org/freedesktop/UDisks2/block_devices/sdb1
      org.freedesktop.UDisks2.Block:
        Configuration:              []
        CryptoBackingDevice:        '/'
        Device:                     /dev/sdb1
        DeviceNumber:               2065
        Drive:                      '/org/freedesktop/UDisks2/drives/TOSHIBA_TransMemory_000000000000000000000000'
        HintAuto:                   true
        HintIconName:
        HintIgnore:                 false
        HintName:
        HintPartitionable:          true
        HintSymbolicIconName:
        HintSystem:                 false
        Id:                         by-uuid-ce782db4-f9ee-4154-80e1-72c0d71b08da
        IdLabel:
        IdType:                     crypto_LUKS
        IdUUID:                     ce782db4-f9ee-4154-80e1-72c0d71b08da
        IdUsage:                    crypto
        IdVersion:                  2
        MDRaid:                     '/'
        MDRaidMember:               '/'
        PreferredDevice:            /dev/sdb1
        ReadOnly:                   false
        Size:                       7757365248
        Symlinks:                   /dev/disk/by-id/usb-TOSHIBA_TransMemory_000000000000000000000000-0:0-part1
                                    /dev/disk/by-partuuid/41c05551-f39c-42db-b64e-1b36a924f573
                                    /dev/disk/by-path/pci-0000:39:00.0-usb-0:1.3:1.0-scsi-0:0:0:0-part1
                                    /dev/disk/by-uuid/ce782db4-f9ee-4154-80e1-72c0d71b08da
        UserspaceMountOptions:
      org.freedesktop.UDisks2.Encrypted:
        ChildConfiguration:         []
        CleartextDevice:            '/'
        HintEncryptionType:
        MetadataSize:               16777216
      org.freedesktop.UDisks2.Partition:
        Flags:              0
        IsContained:        false
        IsContainer:        false
        Name:
        Number:             1
        Offset:             1048576
        Size:               7757365248
        Table:              '/org/freedesktop/UDisks2/block_devices/sdb'
        Type:               ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
        UUID:               41c05551-f39c-42db-b64e-1b36a924f573
    23:44:04.536: /org/freedesktop/UDisks2/block_devices/sdb: org.freedesktop.UDisks2.PartitionTable: Properties Changed
      Partitions:           /org/freedesktop/UDisks2/block_devices/sdb1
    
  4. Then unlocking

    udisksctl unlock -b /dev/sdb1
    Passphrase:
    Unlocked /dev/sdb1 as /dev/dm-0.
    
    23:45:00.698: /org/freedesktop/UDisks2/block_devices/sdb1: org.freedesktop.UDisks2.Encrypted: Properties Changed
      HintEncryptionType:           LUKS
    23:45:00.699: Added /org/freedesktop/UDisks2/jobs/8
      org.freedesktop.UDisks2.Job:
        Bytes:              0
        Cancelable:         true
        ExpectedEndTime:    0
        Objects:            /org/freedesktop/UDisks2/block_devices/sdb1
        Operation:          encrypted-unlock
        Progress:           0.0
        ProgressValid:      false
        Rate:               0
        StartTime:          1643894100696853
        StartedByUID:       1000
    23:45:02.776: /org/freedesktop/UDisks2/jobs/8: org.freedesktop.UDisks2.Job::Completed (true, '')
    23:45:02.776: Removed /org/freedesktop/UDisks2/jobs/8
    23:45:02.778: Added /org/freedesktop/UDisks2/block_devices/dm_2d0
      org.freedesktop.UDisks2.Block:
        Configuration:              []
        CryptoBackingDevice:        '/org/freedesktop/UDisks2/block_devices/sdb1'
        Device:                     /dev/dm-0
        DeviceNumber:               64768
        Drive:                      '/'
        HintAuto:                   false
        HintIconName:
        HintIgnore:                 false
        HintName:
        HintPartitionable:          false
        HintSymbolicIconName:
        HintSystem:                 true
        Id:
        IdLabel:
        IdType:
        IdUUID:
        IdUsage:
        IdVersion:
        MDRaid:                     '/'
        MDRaidMember:               '/'
        PreferredDevice:            /dev/dm-0
        ReadOnly:                   false
        Size:                       7740588032
        Symlinks:
        UserspaceMountOptions:
    23:45:02.778: /org/freedesktop/UDisks2/block_devices/sdb1: org.freedesktop.UDisks2.Encrypted: Properties Changed
      CleartextDevice:      '/org/freedesktop/UDisks2/block_devices/dm_2d0'
    
  5. Then trying to mount

    ~> udisksctl mount -b /dev/dm-0
    Object /org/freedesktop/UDisks2/block_devices/dm_2d0 is not a mountable filesystem.
    

What is interesting is "PreferredDevice" doesn't say: /dev/mapper/luks-ce782db4-f9ee-4154-80e1-72c0d71b08da instead it says dm-0. However the device is created /dev/mapper/luks-ce782db4-f9ee-4154-80e1-72c0d71b08da

  1. Trying to mount the /dev/mapper/luks-ce782db4-f9ee-4154-80e1-72c0d71b08da gives:
    ~> udisksctl mount -b /dev/mapper/luks-ce782db4-f9ee-4154-80e1-72c0d71b08da
    Error looking up object for device /dev/mapper/luks-ce782db4-f9ee-4154-80e1-72c0d71b08da
    

Obviously I know it can mount this filesystem, it's ext4 and sudo mount method works.

  1. The same USB stick works on Fedora however, I installed udiskie on Fedora which includes 50-udiskie.rules with the package.

  2. Polkit, lxqt-policykit-agent are running.

    polkitd     1174  0.0  0.1 2977640 24168 ?       Ssl  22:23   0:00 /usr/lib/polkit-1/polkitd --no-debug
    user       2184  0.0  0.1 668768 27536 ?        Sl   22:23   0:00 /usr/libexec/lxqt-policykit-agent
    
  3. Dbus has been started by gdm.

  4. Unlocking

> udisksctl unlock -b /dev/sde1
Passphrase:
Unlocked /dev/sde1 as /dev/dm-1.
  1. In monitor I see:

    22:50:53.494: Added /org/freedesktop/UDisks2/jobs/12
      org.freedesktop.UDisks2.Job:
        Bytes:              0
        Cancelable:         true
        ExpectedEndTime:    0
        Objects:            /org/freedesktop/UDisks2/block_devices/sde1
        Operation:          encrypted-unlock
        Progress:           0.0
        ProgressValid:      false
        Rate:               0
        StartTime:          1643890853492936
        StartedByUID:       1000
    22:50:54.808: /org/freedesktop/UDisks2/jobs/12: org.freedesktop.UDisks2.Job::Completed (true, '')
    22:50:54.808: Removed /org/freedesktop/UDisks2/jobs/12
    22:50:54.822: Added /org/freedesktop/UDisks2/block_devices/dm_2d1
      org.freedesktop.UDisks2.Block:
        Configuration:              []
        CryptoBackingDevice:        '/org/freedesktop/UDisks2/block_devices/sde1'
        Device:                     /dev/dm-1
        DeviceNumber:               64769
        Drive:                      '/'
        HintAuto:                   false
        HintIconName:
        HintIgnore:                 false
        HintName:
        HintPartitionable:          false
        HintSymbolicIconName:
        HintSystem:                 true
        Id:                         by-id-dm-name-luks-ce782db4-f9ee-4154-80e1-72c0d71b08da
        IdLabel:
        IdType:                     ext4
        IdUUID:                     d8f0c988-446b-46db-a9f9-15db9431085b
        IdUsage:                    filesystem
        IdVersion:                  1.0
        MDRaid:                     '/'
        MDRaidMember:               '/'
        PreferredDevice:            /dev/mapper/luks-ce782db4-f9ee-4154-80e1-72c0d71b08da
        ReadOnly:                   false
        Size:                       7740588032
        Symlinks:                   /dev/disk/by-id/dm-name-luks-ce782db4-f9ee-4154-80e1-72c0d71b08da
                                    /dev/disk/by-id/dm-uuid-CRYPT-LUKS2-7b7bdab9c4fc43afabe61240e616b5dc-luks-ce782db4-f9ee-4154-80e1-72c0d71b08da
                                    /dev/disk/by-uuid/d8f0c988-446b-46db-a9f9-15db9431085b
                                    /dev/mapper/luks-ce782db4-f9ee-4154-80e1-72c0d71b08da
        UserspaceMountOptions:
      org.freedesktop.UDisks2.Filesystem:
        MountPoints:
        Size:               7740588032
    22:50:54.823: /org/freedesktop/UDisks2/block_devices/sde1: org.freedesktop.UDisks2.Encrypted: Properties Changed
      CleartextDevice:      '/org/freedesktop/UDisks2/block_devices/dm_2d1'
    
  2. Mounting gives me:

    ~> udisksctl mount -b /dev/mapper/luks-ce782db4-f9ee-4154-80e1-72c0d71b08da
    Mounted /dev/dm-1 at /run/media/user/d8f0c988-446b-46db-a9f9-15db9431085b
    

@coldfix
Copy link
Owner

coldfix commented Feb 3, 2022

Hey @dngray,

I did come another problem though, which I don't think is udiskie's fault, but maybe you can give me some pointers as to what to try next. I was able to reproduce this with a LUKS encrypted USB stick too, with a single partition. I'm wondering if it's related to #200

thanks for your input, but please don't hijack existing issues for new problems. I'm not going to read through this, because the OPs problem is already identified:

udiskie always applies the ignore-filters, even for devices given on the command line. It should be changed not to ignore devices if they were explicitly passed on the command lines.

This should be relatively easy to fix (PRs welcome), but I currently don't have time to do it.

For now, a workaround is to add a ignore: false rule matching the device in question to your config.

@dngray
Copy link

dngray commented Feb 4, 2022

thanks for your input, but please don't hijack existing issues for new problems. I'm not going to read through this, because the OPs problem is already identified:

That wasn't the intention. I was trying to reproduce original issue with an internal /dev/mmcblk* device. Seeing as they posted back in Mar 27, 2021 and didn't post the udisksctl dump I thought I'd try to reproduce it and then post. The bug also seemed very much related to /dev/nvme*p* devices too as they have a similar naming scheme and same error.

Anyway, I want to change the CLI so that user command line is considered more important than rules... udiskie-mount shouldn't refuse from trying to mount/unmount a particular device if it was passed explicitly on the command line.

I do think that's a good idea.

It happened that the machine I had an sdcard reader on, ran Alpine Linux and had eudev. I suspect the mounting issue there might have been missing polkit rules from the standard distribution which I have reported upstream, and this was not a udiskie specific problem as it effected udisksctl too.

Anyway I tested with Fedora 35 (v2.4.0) and Debian (v1.7.7) with my sdcard reader (/dev/mmcblk0p1). I didn't need any ignore rules for this. Is it possible this bug only occurs if it's a second card reader? ie mmcblk1 and above?

For now, a workaround is to add a ignore: false rule matching the device in question to your config.

Can confirm this did fix the problem for nvme* devices

device_config:
  - device_file: /dev/nvme*
    ignore: false
    options: [rw]

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

3 participants