When connecting disk with multiple partitions...

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
vansloneker

When connecting disk with multiple partitions...

Post by vansloneker »

Not sure where to put it so I guess best in here.

When connecting a disk or an usb-stick the partition is mounted and a file manager window is opened showing the connected partition. This is great.
But, often I am connecting disks or sticks with multiple partitions, like 4 or even up to 10 or so. What happens is, one by one the partitions are mounted and the file manager windows pop up. This process is rather slow, there are 4 to 10 seconds between file manager windows appearing. Each one comes up on front, so you can't do anything in the mean time as the focus is taken away all the time. This gets annoying.
Is there any work around to this?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Lady Fitzgerald
Level 15
Level 15
Posts: 5806
Joined: Tue Jan 07, 2020 3:12 pm
Location: AZ, SSA (Squabbling States of America)

Re: When connecting disk with multiple partitions...

Post by Lady Fitzgerald »

Up to ten partitions? :shock: May I ask why so many?
Jeannie

To ensure the safety of your data, you have to be proactive, not reactive, so, back it up!
jsb
Level 3
Level 3
Posts: 166
Joined: Sat Feb 11, 2017 11:20 am

Re: When connecting disk with multiple partitions...

Post by jsb »

In XFCE you can change that behavior under file manager so they won't mount and/or open a file manager window. I'm on 19.3 with Thunar, so don't know if it is the same in 20. After opening Thunar, it's edit-preferences-advanced and then click on Configure....
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: When connecting disk with multiple partitions...

Post by rene »

vansloneker wrote: Wed Sep 22, 2021 12:08 pm Is there any work around to this?
There in fact is. Save (as root) the following as /etc/udev/rules.d/ignore-usb-partitions.rules (name free; extension must be .rules):

Code: Select all

SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="add", ENV{DEVTYPE}=="partition", ENV{PARTN}!="1", ENV{UDISKS_IGNORE}="1"
This has only the first partition of USB drives automount. Although it shouldn't be needed, use sudo udevadm control --reload if it doesn't work immediately after putting that file there.

Downside is that the other partitions are also not in fact listed in the file manager, meaning you also can't manually rclick-mount them; expected would be that this could be had by replacing ENV{UDISKS_IGNORE}="1" with ENV{UDISKS_AUTO}="0" but this does not work, supposedly due to udisks being it's usual garbage-tier self.

Anyways; for what it's worth...
vansloneker

Re: When connecting disk with multiple partitions...

Post by vansloneker »

Lady Fitzgerald wrote: Wed Sep 22, 2021 2:22 pm Up to ten partitions? :shock: May I ask why so many?
To have things sorted, like download, music, video, app-images, iso's, clones etc.
And the operating system partitions.
vansloneker

Re: When connecting disk with multiple partitions...

Post by vansloneker »

rene wrote: Wed Sep 22, 2021 3:32 pm
vansloneker wrote: Wed Sep 22, 2021 12:08 pm Is there any work around to this?
There in fact is. Save (as root) the following as /etc/udev/rules.d/ignore-usb-partitions.rules (name free; extension must be .rules):

Code: Select all

SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="add", ENV{DEVTYPE}=="partition", ENV{PARTN}!="1", ENV{UDISKS_IGNORE}="1"
This has only the first partition of USB drives automount. Although it shouldn't be needed, use sudo udevadm control --reload if it doesn't work immediately after putting that file there.

Downside is that the other partitions are also not in fact listed in the file manager, meaning you also can't manually rclick-mount them; expected would be that this could be had by replacing ENV{UDISKS_IGNORE}="1" with ENV{UDISKS_AUTO}="0" but this does not work, supposedly due to udisks being it's usual garbage-tier self.

Anyways; for what it's worth...
Do the other partitions show in 'disks' and can be mounted from there?
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: When connecting disk with multiple partitions...

Post by rene »

I just tested that, and, "yah".
User avatar
Lady Fitzgerald
Level 15
Level 15
Posts: 5806
Joined: Tue Jan 07, 2020 3:12 pm
Location: AZ, SSA (Squabbling States of America)

Re: When connecting disk with multiple partitions...

Post by Lady Fitzgerald »

vansloneker wrote: Wed Sep 22, 2021 4:03 pm
Lady Fitzgerald wrote: Wed Sep 22, 2021 2:22 pm Up to ten partitions? :shock: May I ask why so many?
To have things sorted, like download, music, video, app-images, iso's, clones etc.
And the operating system partitions.
I was afraid of that. Partitioning is an extremely inefficient and limiting method of organizing data and allocating storage space. Obviously, separate operating system partitions are needed but using folders in a single data partition (or drive) for organizing data is much better. With a partition, you are locked into how much room you have for data in it. If a partition runs out of room, you have to repartition the disk to steal space from another partition, a time consuming process fraught with peril that can result in the loss of data. Other partitions may underutilize space, such a 100GB partition using only 5GB of data that may or may not expand to fill the partition.

Folders, on the other hand, take up no more room than what they need to hold all their data and can freely expand or contract as needed with no intervention on your part as long as there is room for it remaining on the disk or partition. I've been organizing my data, such as music, downloads, isos, pictures, etc. seamlessly for years and never had to repartition anything just to get more room for a folder.
Jeannie

To ensure the safety of your data, you have to be proactive, not reactive, so, back it up!
vansloneker

Re: When connecting disk with multiple partitions...

Post by vansloneker »

rene wrote: Wed Sep 22, 2021 3:32 pm
vansloneker wrote: Wed Sep 22, 2021 12:08 pm Is there any work around to this?
There in fact is. Save (as root) the following as /etc/udev/rules.d/ignore-usb-partitions.rules (name free; extension must be .rules):

Code: Select all

SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="add", ENV{DEVTYPE}=="partition", ENV{PARTN}!="1", ENV{UDISKS_IGNORE}="1"
This has only the first partition of USB drives automount. Although it shouldn't be needed, use sudo udevadm control --reload if it doesn't work immediately after putting that file there.

Downside is that the other partitions are also not in fact listed in the file manager, meaning you also can't manually rclick-mount them; expected would be that this could be had by replacing ENV{UDISKS_IGNORE}="1" with ENV{UDISKS_AUTO}="0" but this does not work, supposedly due to udisks being it's usual garbage-tier self.

Anyways; for what it's worth...
Thanks.
One more thing, I suppose this does not work when connecting disks through the e-sata dock?
vansloneker

Re: When connecting disk with multiple partitions...

Post by vansloneker »

Lady Fitzgerald wrote: Wed Sep 22, 2021 4:49 pm
vansloneker wrote: Wed Sep 22, 2021 4:03 pm
Lady Fitzgerald wrote: Wed Sep 22, 2021 2:22 pm Up to ten partitions? :shock: May I ask why so many?
To have things sorted, like download, music, video, app-images, iso's, clones etc.
And the operating system partitions.
I was afraid of that. Partitioning is an extremely inefficient and limiting method of organizing data and allocating storage space. Obviously, separate operating system partitions are needed but using folders in a single data partition (or drive) for organizing data is much better. With a partition, you are locked into how much room you have for data in it. If a partition runs out of room, you have to repartition the disk to steal space from another partition, a time consuming process fraught with peril that can result in the loss of data. Other partitions may underutilize space, such a 100GB partition using only 5GB of data that may or may not expand to fill the partition.

Folders, on the other hand, take up no more room than what they need to hold all their data and can freely expand or contract as needed with no intervention on your part as long as there is room for it remaining on the disk or partition. I've been organizing my data, such as music, downloads, isos, pictures, etc. seamlessly for years and never had to repartition anything just to get more room for a folder.


It is what ever suits you best. Nothing wrong with your choices but mine are different.

I have several partitions equally sized to a back-up USB-stick. E.g. 32GB for Windows drivers and software, if it's full, something has to go, period.
App-images ditto.
ISOs sync with a 128GB Ventoy stick so I can boot them everywhere. It doesn't matter to me if the preserved space is not fully utilized. If it is, I know there are far to many ISOs I will never use and a clean-up is needed.
If a partition gets screwed, it is one partition, not an entire disk. There is at least one back-up, usually more.

Just what suits me and my priorities.
mikeflan
Level 17
Level 17
Posts: 7106
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: When connecting disk with multiple partitions...

Post by mikeflan »

But, often I am connecting disks or sticks with multiple partitions, like 4 or even up to 10 or so. What happens is, one by one the partitions are mounted and the file manager windows pop up. This process is rather slow, there are 4 to 10 seconds between file manager windows appearing.
You may have discovered another reason why using partitions are directories is a bad idea :wink:

Please do try rene's suggestion to see if it works through the e-sata dock. If not, maybe we can come up with another solution.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: When connecting disk with multiple partitions...

Post by rene »

vansloneker wrote: Thu Sep 23, 2021 2:29 am One more thing, I suppose this does not work when connecting disks through the e-sata dock?
Directly, no; I through the SUBSYSTEMS=="usb" match in fact specifically excluded anything but USB-connected drives. That rule is only applicable to the automounter and if you only ever let automount drives only the first partition of which you want to automount, simply deleting that SUBSYSYSTEMS="usb", part from the line would be all you need to have it apply to eSATA also...

... although eSATA drives do not in fact tend to automount anyway without another udev rule present, so check what you in fact need.
jsb
Level 3
Level 3
Posts: 166
Joined: Sat Feb 11, 2017 11:20 am

Re: When connecting disk with multiple partitions...

Post by jsb »

vansloneker wrote: Wed Sep 22, 2021 4:05 pm
rene wrote: Wed Sep 22, 2021 3:32 pm
vansloneker wrote: Wed Sep 22, 2021 12:08 pm Is there any work around to this?
There in fact is. Save (as root) the following as /etc/udev/rules.d/ignore-usb-partitions.rules (name free; extension must be .rules):

Code: Select all

SUBSYSTEM=="block", SUBSYSTEMS=="usb", ACTION=="add", ENV{DEVTYPE}=="partition", ENV{PARTN}!="1", ENV{UDISKS_IGNORE}="1"
This has only the first partition of USB drives automount. Although it shouldn't be needed, use sudo udevadm control --reload if it doesn't work immediately after putting that file there.

Downside is that the other partitions are also not in fact listed in the file manager, meaning you also can't manually rclick-mount them; expected would be that this could be had by replacing ENV{UDISKS_IGNORE}="1" with ENV{UDISKS_AUTO}="0" but this does not work, supposedly due to udisks being it's usual garbage-tier self.

Anyways; for what it's worth...
Do the other partitions show in 'disks' and can be mounted from there?
I don't understand what the advantage of doing this is over just turning off automatic mounting in the file manager preferences?

If I uncheck the "mount removable..." all the partitions still appear on the desktop when I plug in an external drive. Each partition can then mounted from there with a click (or right-click). A click opens the partition in file manager, a right-click mounts the partition, without opening file manager.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: When connecting disk with multiple partitions...

Post by rene »

jsb wrote: Thu Sep 23, 2021 11:38 am I don't understand what the advantage of doing this is over just turning off automatic mounting in the file manager preferences?
This has the filesystem on the first partition of an inserted USB-connected stick/drive still automount. Whatever value that may or may not have to anyone else is largely the same question as what value automount has in the first place; poster in any case very explicitly indicated wanting exactly that in the original post.
vansloneker

Re: When connecting disk with multiple partitions...

Post by vansloneker »

I appreciate all the help. I will try the 'usb solution'. I think I was hoping for a way to speed up mounting and opening but apparently there isn't.
I might as well uncheck browse removable media when inserted from removable drives and media. It's not that difficult to open a file manager. Actually on Windows I never used self opening file explorers. But I like it on Linux.
I am not going to change my system. I know some people are a bit scared of partitions and partitioning, well, I am not. You do it your way, I do it mine.
jsb
Level 3
Level 3
Posts: 166
Joined: Sat Feb 11, 2017 11:20 am

Re: When connecting disk with multiple partitions...

Post by jsb »

rene wrote: Thu Sep 23, 2021 11:43 am
jsb wrote: Thu Sep 23, 2021 11:38 am I don't understand what the advantage of doing this is over just turning off automatic mounting in the file manager preferences?
This has the filesystem on the first partition of an inserted USB-connected stick/drive still automount. Whatever value that may or may not have to anyone else is largely the same question as what value automount has in the first place; poster in any case very explicitly indicated wanting exactly that in the original post.
Oh, I read it as a just statement of what is not wanted (not wanting to wait for 10 partitions to mount). But I can see how one might read it differently, based on the first sentence.
Locked

Return to “Beginner Questions”