0

My FSTab /etc/fstaballows 2 boots partitions, one on the machine HDD (where there are swapand FS /), another on a USB pendrive.

I duplicated the boot line in /etc/fstab and changed the UUID and format:

UUID=</boot partition on HDD> /boot ext2 defaults 0 2
UUID=</boot partition on USB> /boot vfat defaults 0 2

Can I tell FSTAb to "priorize" USB ? How ?

Thanks a lot (I promise I googled, but maybe with not-right words...)

EDIT What am I aiming ? This process: if USB is plugged then use USB /boot, else: use HDD boot.

Why am I aiming that ? Because my USB pendrive contains a LUKS-keyfile registered in /etc/crypttab. Maybe I dont even need to boot from USB, but I need to only mount it ; anyway crypt has to get my key.

It's a fallback plan: no USB ? give the LUKS text passphrase input. USB ? get the keyfile from USB mounted drive.

6
  • You are trying to do something wrong. Why do you want to mount two partitions to the same directory, especially to /boot?
    – Pilot6
    Aug 10, 2015 at 13:01
  • You'd better explain what are you trying to achieve.
    – Pilot6
    Aug 10, 2015 at 13:01
  • @Pilot6 I dont want, actually, do that exactly. I want to use USB /boot. But if USB is not plugged, I want to use HDD /boot.
    – 3pic
    Aug 10, 2015 at 13:02
  • Why do you want it to be mounted to /boot? You can mount it somewhere else with nofail parameter.
    – Pilot6
    Aug 10, 2015 at 13:07
  • Originally, I wanted to disable /boot if the USB is not plugged. But finally I prefer the fallback process. Thank you @Pilot6 , I'm going to get the nofailstuff. You should post an answer, rather than comment, ? BR
    – 3pic
    Aug 10, 2015 at 13:09

1 Answer 1

1

It is not possible to setup automounting options in fstab to mount two partitions to the same mount point.

You can mount your pen drive somewhere else with nofail parameter.

You will not get error messages if pen drive is not plugged.

4
  • Thank you. If I want my pendrive : stores the keyfile (added to /etc/crypttab) and allows to auto enter my linux session (avoiding to have to manually enter the passphrase), shouldnt I boot on the pendrive ? and comment the usual /boot in etc/fstab ?
    – 3pic
    Aug 11, 2015 at 7:54
  • I am not an expert in encryption, but I think you do not have to boot from the pendrive. You can mount it somewhere and setup the path in /etc/crypttab to it.
    – Pilot6
    Aug 11, 2015 at 10:15
  • I did. For now, no success. I'm still proposed the text-input for passphrase.
    – 3pic
    Aug 11, 2015 at 12:33
  • I suggest asking another question that makes it clear that you want to have a key on your pen drive.
    – Pilot6
    Aug 11, 2015 at 12:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .