coldfix / udiskie

Automounter for removable media
MIT License
866 stars 53 forks source link

mounting disc image with multiple partitions #198

Closed jdietrch closed 4 years ago

jdietrch commented 4 years ago

I'm using udiskie 2.0.4, and I downloaded this iso: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.2.0-amd64-netinst.iso

When I right-click on the tray icon and choose "Mount disc image" and choose that iso, it is attached to a loop device but nothing is mounted. Here is a snippet from lsblk output:

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0         7:0    0   335M  1 loop
├─loop0p1   259:5    0   335M  1 part
└─loop0p2   259:6    0   2.8M  1 part

I think it should work, because I can mount both partitions just fine with udisksctl:

udisksctl mount -b /dev/loop0p1
udisksctl mount -b /dev/loop0p2
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0         7:0    0   335M  1 loop
├─loop0p1   259:5    0   335M  1 part /media/jdietrch/Debian 10.2.0 amd64 n
└─loop0p2   259:6    0   2.8M  1 part /media/jdietrch/Debian 10.2.0 amd64 n1

Is there anything I should be doing differently to get it to work?

coldfix commented 4 years ago

Thanks for providing this report. I can confirm the issue locally. It appears the devices for the partitions are ignored using the IgnoreDevice(match={'is_external': False}, ignore=True) rule. This may be due to device parentship not being considered properly. I hope I can get to working on it over the weekend.

Best, Thomas

coldfix commented 4 years ago

Hi, I found the reason for this is that the builtin rule that selects loop devices to be shown was not triggered because it was not propagated to child partitions of the loop device. This is fixed in the uploaded patch and will be in the next release.

However, the second partition will still be ignored, because it has the HintIgnore property set and there is another builtin rule that ignores such devices.

I will have to do something about making this easier to modify in the future (either provide a config entry to disable builtin rules, or allow them to be overriden/disabled individually, let's see), but for me this is not as urgent for now.

coldfix commented 4 years ago

However, the second partition will still be ignored, because it has the HintIgnore property set and there is another builtin rule that ignores such devices.

I will have to do something about making this easier to modify in the future (either provide a config entry to disable builtin rules, or allow them to be overriden/disabled individually, let's see), but for me this is not as urgent for now.

Note that you will now be able to skip evaluation of builtin rules by adding a skip: true rule to your config, see 4aba7941dbbd49b7217360f3647dbe5ddb2fe195.