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

[Request] How do I mount multiple partitions in external disk #1301

Open
clustor opened this issue Jul 21, 2024 · 2 comments
Open

[Request] How do I mount multiple partitions in external disk #1301

clustor opened this issue Jul 21, 2024 · 2 comments

Comments

@clustor
Copy link

clustor commented Jul 21, 2024

When I insert a USB drive that has VFAT and EXT4 partitions in Ubuntu, I always see only the first partition mounted. I added a 'udev' rule to mount second partition with SUBSYSTEM=="block" ACTION=="add", KERNEL=="sda5", ENV{ID_FS_LABEL}=="Backup-Linux", RUN+="/usr/bin/udisksctl mount -b /dev/%k" but it fails with exit code 1.

I would like to mount both VFAT and EXT4 partitions. It's not clear to me how selects that first partition be mounted. Any help will be appreciated?

@vojtechtrefny
Copy link
Member

udisks itself doesn't automount devices, it just tells your DE there is a new devices detected and it then tells udisks to mount them so whether a device will be mounted depends on your DE configuration (for example in KDE this is configurable in Disks & Cameras → Device Auto-Mount).

It is possible that we don't correctly inform about all devices, check udisksctl info -b /dev/sda5, especially whether HintSystem and HintIgnore are set to false.

I added a 'udev' rule to mount second partition

udev runs in a separate namespace and manually running mount (or udisksctl) doesn't work from udev rules.

@tbzatek
Copy link
Member

tbzatek commented Jul 29, 2024

The correct way is to set udev attributes UDISKS_AUTO, UDISKS_IGNORE and UDISKS_SYSTEM (depending on what you're trying to achieve) - see man udisks(8).

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