Multi-boot: Prevent debian from forcefully mounting all partitions at boot, esp openSUSE partitions

Yes, this is a question about debian, but I have searched extensively for the solution to this problem on the internet.

There are a (very) few hits about this kind of a problem, but none with an answer. Most simply suggest fstab, but that does not work, is overridden somehow.

User objections to this behaviour turn up in Ubuntu questiions, debian questions, AV Linux questions, among maybe a couple others, without arriving at the solution.

So, I decided to ask here, where we have better support. (Obviously, since openSUSE does not do this, someone here must also know the answer.)openSUSE devs are smarter?

I have a multi-boot system. Besides openSUSE, I have AV Linux (debian-based) for music production, and in the future I want more systems, such as I am right now preparing to install 15 for testing and QA.

The problem? When I boot into AV Linux, it insists on mounting ALL partitions on ALL installed drives!

This cannot be stopped in fstab, it is obviously being overridden.

I cannot find any udev .unit files that are forcing this, in etc (highest priority), run (next highest), nor in /usr/lib.

Here is what I tried in fstab (comments and commented out should show you what has failed). I have changed names and paths in this to protect my true paths:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# SWAP
UUID=47dff67a-48d7-46a1-84fa-adacbxxxxxxx   none   swap   sw   0   0
# /
UUID=3e0086c8-57d4-401c-b7dd-d93bcxxxxxxx   /   ext4   noatime,errors=remount-ro   0   1
# /home
UUID=e865fa1f-070a-4253-8613-89844xxxxxxx   /home   ext4   noatime   0   2

# THIS FAILED TO PREVENT MOUNTING AT BOOT
# UUID=faa296a1-d1d6-4739-8022-14a7fxxxxxxx   /media/the_label_name_of_my_openSUSE_system_partition   ext4   noauto,ro   0   2
# UUID=80fc8014-f1cc-48df-b57b-782b5xxxxxxx   /media/the_label_name_of_my_openSUSE_label_partition   ext4   noauto,ro   0   2

# THIS ALSO FAILED TO PREVENT MOUNTING AT BOOT
# LABEL=the_label_name_of_my_openSUSE_system_partition   /media/the_label_name_of_my_openSUSE_system_partition   ext4   noauto,ro   0   2
# LABEL=the_label_name_of_my_openSUSE_label_partition   /media/the_label_name_of_my_openSUSE_label_partition   ext4   noauto,ro   0   2

#THIS FAILED AS WELL, ALSO FAILED TO MOVE THE MOUNT POINT TO THE DESIRED PATH
# LABEL=my_shared_data   /run/media/my_username/my_shared_data   ext4   noauto   0   2
#THIS ALSO FAILED TO MOVE IT TO MY DESIRED MOUNT PATH
    # LABEL=DATA   /run/media/my_username/my_shared_data   ext4   default   0   2
#YET, THIS SUCCEEDED IN MOUNTING IT AS I DESIRED
LABEL=DATA   /run/media/my_username/my_shared_data   ext4   noatime   0   2

#THESE ALSO FAILED TO PREVENT MOUNTING OF THE OPENSUSE SYSTEM AND HOME PARTITIONS
# /dev/sdXN   /media/DIRECTORY_NAME   ext4   noauto,ro   0   2
# /dev/sdXN   /media/DIRECTORY_NAME   ext4   noauto,ro   0   

I have not found the answer, yet, as I said.

In the meantime, I have created this workaround, a script I named “fixmount” in /bin, which I run from a root console as soon as I log in:

#!/bin/sh
    # Tested with this, first, but, No need to unmount all
    # umount -a
    umount /media/the_label_name_of_my_openSUSE_system_partition
    umount /media/the_label_name_of_my_openSUSE_label_partition
    umount /media/boot

Of course, this means I have to update the script any time I add new partitions to the drive, such as those for 15. Also, it requires the step of dropping to a root console to run the script each time I boot into AV Linux, which is a minor problem, but still undesired if it can be avoided.

This brings up a couple possible approaches.

  1. Does anybody here know where this is being controlled, and how to fix it? or;
  2. Does anyone know how to write the udev .unit file I can put in /etc to stop this behaviour?

I am trying to decipher the instructions for writing the necessary udev rules, if that is the route I need to go, but the support information is somewhat vague and a bit confusing to decipher.

Hi
I would guess it’s a udev rule you haven’t found, if you don’t login does it mount or just when you login as your user? What desktop environment is it?

It’s likely to be systemd related…

https://manpages.debian.org/stretch/systemd/systemd.generator.7.en.html
https://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html

Perhaps specifically DiscoverablePartitionsSpec

Hi Gerry,

Try editing the following file (and toggle “ResultActive=1” from zero to 1):

/var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

[Mounting, checking, etc. of internal drives]
Identity=unix-group:admin;unix-group:sudo
Action=org.freedesktop.udisks.filesystem-;org.freedesktop.udisks.drive-ata-smart;org.freedesktop.
udisks2.filesystem-mount-system;org.freedesktop.udisks2.encrypted-unlock-system;org.freedesktop.
udisks2.filesystem-fstab;
ResultActive=1

Cheers,
Peter

On 04/02/18 15:16, Fraser Bell wrote:
>
> Yes, this is a question about debian, but I have searched extensively
> for the solution to this problem on the internet.
>
> There are a (very) few hits about this kind of a problem, but none with
> an answer. Most simply suggest fstab, but that does not work, is
> overridden somehow.
>
> User objections to this behaviour turn up in Ubuntu questiions, debian
> questions, AV Linux questions, among maybe a couple others, without
> arriving at the solution.
>
> So, I decided to ask here, where we have better support. (Obviously,
> since openSUSE does not do this, someone here must also know the
> answer.)
> -openSUSE devs are smarter?-
>
>
> I have a multi-boot system. Besides openSUSE, I have AV Linux
> (debian-based) for music production, and in the future I want more
> systems, such as I am right now preparing to install 15 for testing and
> QA.
>
> The problem? When I boot into AV Linux, it insists on mounting ALL
> partitions on ALL installed drives!
>
> This cannot be stopped in fstab, it is obviously being overridden.
>
> I cannot find any udev .unit files that are forcing this, in etc
> (highest priority), run (next highest), nor in /usr/lib.
>
> Here is what I tried in fstab (comments and commented out should show
> you what has failed). I have changed names and paths in this to protect
> my true paths:
>
> Code:
> --------------------
> # /etc/fstab: static file system information.
> #
> # Use ‘blkid’ to print the universally unique identifier for a
> # device; this may be used with UUID= as a more robust way to name devices
> # that works even if disks are added and removed. See fstab(5).
> #
> # <file system> <mount point> <type> <options> <dump> <pass>
> # SWAP
> UUID=47dff67a-48d7-46a1-84fa-adacbxxxxxxx none swap sw 0 0
> # /
> UUID=3e0086c8-57d4-401c-b7dd-d93bcxxxxxxx / ext4 noatime,errors=remount-ro 0 1
> # /home
> UUID=e865fa1f-070a-4253-8613-89844xxxxxxx /home ext4 noatime 0 2
>
> # THIS FAILED TO PREVENT MOUNTING AT BOOT
> # UUID=faa296a1-d1d6-4739-8022-14a7fxxxxxxx /media/the_label_name_of_my_openSUSE_system_partition ext4 noauto,ro 0 2
> # UUID=80fc8014-f1cc-48df-b57b-782b5xxxxxxx /media/the_label_name_of_my_openSUSE_label_partition ext4 noauto,ro 0 2
>
> # THIS ALSO FAILED TO PREVENT MOUNTING AT BOOT
> # LABEL=the_label_name_of_my_openSUSE_system_partition /media/the_label_name_of_my_openSUSE_system_partition ext4 noauto,ro 0 2
> # LABEL=the_label_name_of_my_openSUSE_label_partition /media/the_label_name_of_my_openSUSE_label_partition ext4 noauto,ro 0 2
>
> #THIS FAILED AS WELL, ALSO FAILED TO MOVE THE MOUNT POINT TO THE DESIRED PATH
> # LABEL=my_shared_data /run/media/my_username/my_shared_data ext4 noauto 0 2
> #THIS ALSO FAILED TO MOVE IT TO MY DESIRED MOUNT PATH
> # LABEL=DATA /run/media/my_username/my_shared_data ext4 default 0 2
> #YET, THIS SUCCEEDED IN MOUNTING IT AS I DESIRED
> LABEL=DATA /run/media/my_username/my_shared_data ext4 noatime 0 2
>
> #THESE ALSO FAILED TO PREVENT MOUNTING OF THE OPENSUSE SYSTEM AND HOME PARTITIONS
> # /dev/sdXN /media/DIRECTORY_NAME ext4 noauto,ro 0 2
> # /dev/sdXN /media/DIRECTORY_NAME ext4 noauto,ro 0
>
> --------------------
>
>
> I have not found the answer, yet, as I said.
>
> In the meantime, I have created this workaround, a script I named
> “fixmount” in /bin, which I run from a root console as soon as I log in:
>
> Code:
> --------------------
> #!/bin/sh
> # Tested with this, first, but, No need to unmount all
> # umount -a
> umount /media/the_label_name_of_my_openSUSE_system_partition
> umount /media/the_label_name_of_my_openSUSE_label_partition
> umount /media/boot
>
> --------------------
>
>
> Of course, this means I have to update the script any time I add new
> partitions to the drive, such as those for 15. Also, it requires the
> step of dropping to a root console to run the script each time I boot
> into AV Linux, which is a minor problem, but still undesired if it can
> be avoided.
>
> This brings up a couple possible approaches.
>
> - Does anybody here know where this is being controlled, and how to
> fix it? or;
> - Does anyone know how to write the udev .unit file I can put in /etc
> to stop this behaviour?
>
>
> I am trying to decipher the instructions for writing the necessary udev
> rules, if that is the route I need to go, but the support information is
> somewhat vague and a bit confusing to decipher.
>
>

My apologies if it does not work with Debian as I just realised that the
file is named “com.ubuntu.desktop.pkla” (which works for Ubuntu-based
distros) but there might be a similar file relating to Debian(?).

Cheers

On 04/02/18 17:15, Peter_Abc wrote:
> Hi Gerry,
>
> Try editing the following file (and toggle “ResultActive=1” from zero to
> 1):
>
> /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
>
> [Mounting, checking, etc. of internal drives]
> Identity=unix-group:admin;unix-group:sudo
> Action=org.freedesktop.udisks.filesystem-;org.freedesktop.udisks.drive-ata-smart;org.freedesktop.
>
> udisks2.filesystem-mount-system;org.freedesktop.udisks2.encrypted-unlock-system;org.freedesktop.
>
> udisks2.filesystem-fstab;
> ResultActive=1
>
> Cheers,
> Peter
>
> On 04/02/18 15:16, Fraser Bell wrote:
>>
>> Yes, this is a question about debian, but I have searched extensively
>> for the solution to this problem on the internet.
>>
>> There are a (very) few hits about this kind of a problem, but none with
>> an answer. Most simply suggest fstab, but that does not work, is
>> overridden somehow.
>>
>> User objections to this behaviour turn up in Ubuntu questiions, debian
>> questions, AV Linux questions, among maybe a couple others, without
>> arriving at the solution.
>>
>> So, I decided to ask here, where we have better support. (Obviously,
>> since openSUSE does not do this, someone here must also know the
>> answer.)
>> -openSUSE devs are smarter?-
>>
>>
>> I have a multi-boot system. Besides openSUSE, I have AV Linux
>> (debian-based) for music production, and in the future I want more
>> systems, such as I am right now preparing to install 15 for testing and
>> QA.
>>
>> The problem? When I boot into AV Linux, it insists on mounting ALL
>> partitions on ALL installed drives!
>>
>> This cannot be stopped in fstab, it is obviously being overridden.
>>
>> I cannot find any udev .unit files that are forcing this, in etc
>> (highest priority), run (next highest), nor in /usr/lib.
>>
>> Here is what I tried in fstab (comments and commented out should show
>> you what has failed). I have changed names and paths in this to protect
>> my true paths:
>>
>> Code:
>> --------------------
>> # /etc/fstab: static file system information.
>> #
>> # Use ‘blkid’ to print the universally unique identifier for a
>> # device; this may be used with UUID= as a more robust way to name
>> devices
>> # that works even if disks are added and removed. See fstab(5).
>> #
>> # <file system> <mount point> <type> <options> <dump> <pass>
>> # SWAP
>> UUID=47dff67a-48d7-46a1-84fa-adacbxxxxxxx none swap sw 0 0
>> # /
>> UUID=3e0086c8-57d4-401c-b7dd-d93bcxxxxxxx / ext4
>> noatime,errors=remount-ro 0 1
>> # /home
>> UUID=e865fa1f-070a-4253-8613-89844xxxxxxx /home ext4
>> noatime 0 2
>> # THIS FAILED TO PREVENT MOUNTING AT BOOT
>> # UUID=faa296a1-d1d6-4739-8022-14a7fxxxxxxx
>> /media/the_label_name_of_my_openSUSE_system_partition ext4
>> noauto,ro 0 2
>> # UUID=80fc8014-f1cc-48df-b57b-782b5xxxxxxx
>> /media/the_label_name_of_my_openSUSE_label_partition ext4
>> noauto,ro 0 2
>> # THIS ALSO FAILED TO PREVENT MOUNTING AT BOOT
>> # LABEL=the_label_name_of_my_openSUSE_system_partition
>> /media/the_label_name_of_my_openSUSE_system_partition ext4
>> noauto,ro 0 2
>> # LABEL=the_label_name_of_my_openSUSE_label_partition
>> /media/the_label_name_of_my_openSUSE_label_partition ext4
>> noauto,ro 0 2
>> #THIS FAILED AS WELL, ALSO FAILED TO MOVE THE MOUNT POINT TO THE
>> DESIRED PATH
>> # LABEL=my_shared_data /run/media/my_username/my_shared_data
>> ext4 noauto 0 2
>> #THIS ALSO FAILED TO MOVE IT TO MY DESIRED MOUNT PATH
>> # LABEL=DATA /run/media/my_username/my_shared_data ext4
>> default 0 2
>> #YET, THIS SUCCEEDED IN MOUNTING IT AS I DESIRED
>> LABEL=DATA /run/media/my_username/my_shared_data ext4
>> noatime 0 2
>> #THESE ALSO FAILED TO PREVENT MOUNTING OF THE OPENSUSE SYSTEM AND
>> HOME PARTITIONS
>> # /dev/sdXN /media/DIRECTORY_NAME ext4 noauto,ro 0 2
>> # /dev/sdXN /media/DIRECTORY_NAME ext4 noauto,ro 0
>> --------------------
>>
>>
>> I have not found the answer, yet, as I said.
>>
>> In the meantime, I have created this workaround, a script I named
>> “fixmount” in /bin, which I run from a root console as soon as I log in:
>>
>> Code:
>> --------------------
>> #!/bin/sh
>> # Tested with this, first, but, No need to unmount all
>> # umount -a
>> umount /media/the_label_name_of_my_openSUSE_system_partition
>> umount /media/the_label_name_of_my_openSUSE_label_partition
>> umount /media/boot
>> --------------------
>>
>>
>> Of course, this means I have to update the script any time I add new
>> partitions to the drive, such as those for 15. Also, it requires the
>> step of dropping to a root console to run the script each time I boot
>> into AV Linux, which is a minor problem, but still undesired if it can
>> be avoided.
>>
>> This brings up a couple possible approaches.
>> - Does anybody here know where this is being controlled, and how to
>> fix it? or;
>> - Does anyone know how to write the udev .unit file I can put in /etc
>> to stop this behaviour?
>>
>> I am trying to decipher the instructions for writing the necessary udev
>> rules, if that is the route I need to go, but the support information is
>> somewhat vague and a bit confusing to decipher.
>>
>>
>

Yes, my sense as well. However, we must know something about it, since openSUSE is so much better behaved about this.

I will look at the links ASAP.

They are mounted before login, I believe, but I will check by booting to a console next time I am there.

Desktop is Xfce, but I believe it is a systemd thing, one that openSUSE has implemented properly.

Although, I would not rule out it being a udev rule I have not found, yet, still looking …

However, I did find this:

We are not. /etc/fstab always overrides automatic discovery and is indeed mentioned in the specifications.

In the OP case, fstab is not overriding the mounts, so it must be something else … though possibly related somehow.

Thanks, Peter. I will also use your clues to do some further checking and testing.

I think it would be amusing if we can supply the answer at openSUSE – where we don’t have that problem – that many Ubuntu and Debian-based Users are seeking, but cannot find at those information outlets.:wink:

… of course, if I understand what I have researched already, a .unit file in /etc with the proper udev rule ought to override this behaviour, according to precedence hierarchy. So, how to structure that file and udev rule would also be a solution.

Still, though, I would like to know the root of the problem, so I would still keep looking even if someone provides me with the udev method.

As for udev, yes I already have read how to use udevadm -info <device> to get the necessary information, so just a basic file – name, etc location, and basic udev rule I could fill in – would be all I need. Lacking such, I will try some tests as I have time.

My data is safe, so …

If something blows up, I can always rebuild it.:stuck_out_tongue:

Although you keep referring to it as a problem, I’m guessing that others may see this as a feature.

On 04/02/18 18:16, Fraser Bell wrote:
>
> Peter_Abc;2853884 Wrote:
>> My apologies if it does not work with Debian as I just realised that the
>> file is named “com.ubuntu.desktop.pkla” (which works for Ubuntu-based
>> distros) but there might be a similar file relating to Debian(?).
>
> Thanks, Peter. I will also use your clues to do some further checking
> and testing.

I have Ubuntu Mate installed (also had Mint Mate previously) on my
multi-boot laptop and hated how all my partitions were auto mounted
(unlike openSUSE, which is one of many reasons why I prefer it over
other distros) and I searched Google recently and found that one has to
edit the file I suggested in my first post. Now the default advice is to
toggle the No to Yes (or the other way round) but I found that did not
work for me but using the number ‘1’ did the trick.

For Debian, look for the “10-desktop-policy.pkla” file and edit it (the
required section should be at the top of the file).

> I think it would be amusing if we can supply the answer at openSUSE –
> where we don’t have that problem – that many Ubuntu and Debian-based
> Users are seeking, but cannot find at those information outlets.:wink:
>

The following is from
https://manpages.debian.org/jessie/policykit-1/pklocalauthority.8.en.html :

/var/lib/polkit-1
└── localauthority
├── 10-vendor.d
│ └── 10-desktop-policy.pkla
├── 20-org.d
├── 30-site.d
├── 50-local.d
├── 55-org.my.company.d
│ └── 10-org.my.company.product.pkla
└── 90-mandatory.d

This bug report describes a workaround for inhibiting similar unwanted behaviour…
https://bugs.freedesktop.org/show_bug.cgi?id=87230

This is also mentioned in the man page I linked to in my initial reply

A symlink to /dev/null or an empty file can be used to mask a generator, thereby preventing it from running.

For example

ln -s /dev/null /etc/systemd/system-generators/systemd-gpt-auto-generator
systemctl daemon-reload

Hope I’m on the right track here.

A similar thread…
https://unix.stackexchange.com/questions/270546/how-to-stop-debian-from-mounting-a-partition-at-startup

Are partitions mounted if you boot into run level 3?

Not a feature if you cannot easily make the choice, IMHO.

Thanks. I will be checking that the next time I boot into AV Linux.

I will be checking these things out next time I boot into AV Linux. Thanks for all the links and pointers.

ATM I am taking care of weekly maintenance and backups on the openSUSE machines, just stopped in now to get my daily openSUSE forums “fix”.:slight_smile:

Ok, let us know what you find. I’ll be interested to know if that generator is behind this ‘unwanted’ behaviour.