I am attempting to mount a usb drive to a specific directory at boot time so that it's mapped to the same directory each time. I read this article, Automounting USB drive on boot, that says to add it to /etc/fstab
proc /proc proc defaults 0 0
PARTUUID=bf444af9-01 /boot vfat defaults 0 2
PARTUUID=bf444af9-02 / ext4 defaults,noatime 0 1
UUID=b994a97c-027d-465e-8483-ad519866f87c /mnt/usb2 ext4 defaults,umask=000 0 0
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
I tried both PARTUUID and UUID, same results both times.
Here's what I've tried:
PARTUUID=b994a97c-027d-465e-8483-ad519866f87c /mnt/usb2 ext4 defaults,umask=000 0 0
PARTUUID=fc69e031-8593-4c67-9cf9-c364d0166117 /mnt/usb2 ext4 defaults,umask=000 0 0
UUID=b994a97c-027d-465e-8483-ad519866f87c /mnt/usb2 ext4 defaults,umask=000 0 0
UUID=fc69e031-8593-4c67-9cf9-c364d0166117 /mnt/usb2 ext4 defaults,umask=000 0 0
When I restart, it is giving this error:
Cannot open access to console, the root account is locked.
I got out of this by modifying the cmdline.txt and adding bash.
I did a blkid
to see my usb drive UUID. Here is what I got:
pi@raspberrypi:~ $ sudo blkid
/dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="6284-658D" TYPE="vfat" PARTUUID="bf444af9-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="3a324232-335f-4617-84c3-d4889840dc93" TYPE="ext4" PARTUUID="bf444af9-02"
/dev/sda2: UUID="b994a97c-027d-465e-8483-ad519866f87c" TYPE="ext4" PARTLABEL="Basic data partition" PARTUUID="fc69e031-8593-4c67-9cf9-c364d0166117"
/dev/mmcblk0: PTUUID="bf444af9" PTTYPE="dos"
/dev/sda1: PARTLABEL="Microsoft reserved partition" PARTUUID="4792d598-bd1e-4784-99a5-27db1f5d937b"
What am I doing wrong? I cannot get this usb drive to mount at boot up to a specific directory.
Any suggestions please?
sudo mount -a
once I've added the line in. Once that reports no errors and works I feel safe to reboot :-). Also addnofail
to the line - see unix.stackexchange.com/questions/53456/…. It would help to know what works in the file and what you are adding :-). Though this is on a Raspberry Pi - its actually a Linux issue so it should be closed here and moved (daft I know)