You are not logged in.
Hi all,
I have my /boot partition on a USB key, and I set it up so that it does not automount. This means I can unplug it as soon as the computer finishes booting. I accomplished this with a line in /etc/fstab:
UUID=19968ab9-e0cd-4627-9f9e-69f3fd686d3f /boot ext2 defaults,noautoRecently the USB key has started automounting. Any idea why the noauto is getting ignored?
Initial googling indicates that maybe I shouldn't be using fstab anymore? I should be using udisks or udisks2? Why is that? I have udisks2 installed, but the only rules file I can find is /usr/lib/udev/rules.2/80-udisks.rules, which says not to edit it as it will be overwritten on updates.
So, what should I do?
Offline
You should use /etc/udev/rules.d/ for custom rules. If both directories contain a .rules file with the same name, the file in /usr/lib/ is ignored. See man udev for details.
Offline
First you need to find out what is mounting the partition. It might be that your DE is trying to be smart and automounting it for you.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
I don't have a DE (running stumpwm). How can I find out what's automounting it?
Offline
Ok, some more questions:
mich41, you said I should use /etc/udev/rules.d for custom rules. Should I need a custom rule to prevent a drive from automounting?
Is /etc/udev/rules.d the new place to put things like "always mount this UUID to /boot"? (Replacing use of /etc/fstab).
Is /ect/fstab being phased out?
I appear to have a /etc/udev, /etc/udisks, and /etc/udisks2 directories. Based on the wiki, udisks has been superceded by udisks2; is there any reason _not_ to just uninstall udisks and delete that directory?
And what is the relationship between udisks and udev?
Sorry for the dumb questions!
Offline
mich41, you said I should use /etc/udev/rules.d for custom rules. Should I need a custom rule to prevent a drive from automounting?
I don't know, I don't use systemd and it's been a few years since I last cared what's the flavor of the month in automounting daemons.
I assumed that you already know what rules you want to add and just aren't sure where to put them.
I don't know what mounts your disk. Is it mounted on /boot as instructed by fstab or somewhere else? Maybe there is some systemd-specific fstab replacement with (apparently buggy) fstab compatibility? No idea. This website or Arch wiki may help ![]()
Last edited by mich41 (2015-09-22 07:20:46)
Offline
I think /boot is mounted at boot time and it is not unmounted after that until shutdown.
So using /etc/fstab with noauto option is useless in this case, /boot is already mounted when /etc/fstab is read.
To do what you want, you need to unmount it manually and plug the USB key out.
AFAIK /etc/fstab is not deprecated, but in your case it is not the way to go.
Last edited by berbae (2015-09-22 14:40:25)
Offline
So using /etc/fstab with noauto option is useless in this case, /boot is already mounted when /etc/fstab is read.
My experience contradicts this. I added noauto to my fstab /boot line and it was not automounted next boot.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
Thanks for the clarification, mich. I uninstalled udisks, udisks2 and udiskie, and everything is back to normal. Once I have some time, I'll go back through figuring out how to get generic USB devices to mount/automount properly (given that they have unpredictable /dev/sdX assignments).
berbae and alphaniner: "normal" is what alphaniner describes. With noauto specified, once bootup is complete the /boot disk is not mounted, which is what I want, and is how my system was behaving up until a system update last weekend. So yes, it seems like one of the automounting setups was not respecting fstab properly.
Offline
I removed the first part of my post #7, I answered too quickly.
Looking more closely at my systemd journal, I see that /boot is mounted by systemd using /etc/fstab when it mounts all the partitions which have entries in fstab.
But I could not find explanations on how /boot is used before that, during the boot sequence; how it is mounted/unmounted to find the kernel and initial ram system.
If someone could provide a link, it would be nice, thanks.
Offline
Files in /boot are loaded by the bootloader (e.g. grub), which obviously uses its own filesystem drivers because Linux isn't even loaded to RAM yet.
If you don't care about being able to update the kernel, you can omit /boot from fstab and never mount it - everything else will work.
Offline
In general I don't mount /boot, but I learned the hard way that if I accidentally leave it unmounted while doing a pacman -Syu that updates the kernel, all kinds of bad things happen.
Offline