• Booting a Pi 4 without an external USB drive when it is configured to a

    From NY@3:770/3 to All on Fri Sep 11 17:27:08 2020
    I have added a line

    /dev/sda1 /home/pi/ext ntfs defaults,umask=000,x-systemd.device-timeout=30 0
    0

    to /etc/fstab to auto-mount a USB drive that is on /dev/sda1

    This works fine.

    But if I accidentally forget to plug in the USB drive, booting halts with a message

    https://postimg.cc/4nbX0gkZ

    about being in emergency mode

    Interestingly, if I then plug the drive in (while the Pi is turned on) and press enter again, it boots normally.

    So despite the x-systemd.device-timeout=30 it is stopping dead if the drive
    is not present.


    Originally I had the line

    /dev/sda1 /home/pi/ext ntfs defaults 0 0


    but
    https://www.raspberrypi.org/documentation/configuration/external-storage.md alerted me to the umask parameter to allow access to all files/folders, and
    the shortened timeout x-systemd.device-timeout=30 instead of 90 seconds.


    The only difference from the web page is that I am referring to the drive by /dev/sda1 rather than by its UUID. Is that significant? Is there another parameter that I should be using on the /etc/fstab line?

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From NY@3:770/3 to me@privacy.invalid on Fri Sep 11 18:40:05 2020
    "NY" <me@privacy.invalid> wrote in message
    news:rjg8io$3e9$1@dont-email.me...
    I have added a line

    /dev/sda1 /home/pi/ext ntfs defaults,umask=000,x-systemd.device-timeout=30
    0 0

    to /etc/fstab to auto-mount a USB drive that is on /dev/sda1

    This works fine.

    But if I accidentally forget to plug in the USB drive, booting halts with
    a message

    https://postimg.cc/4nbX0gkZ

    about being in emergency mode

    Interestingly, if I then plug the drive in (while the Pi is turned on) and press enter again, it boots normally.


    Solved it! I should have used the keyword nofail to prevent boot stalling if the drive isn't present:

    /dev/sda1 /home/pi/ext ntfs defaults,nofail,umask=000,x-systemd.device-timeout=30 0 0

    https://raspberrypi.stackexchange.com/questions/75765/how-to-boot-without-mount ing-a-drive-present-during-booting
    gave me that information.



    The consequences of the drive not being present are fairly catastrophic
    because the Pi is used as a TV recorder which expects to write its
    recordings to the USB drive, but its better that the Pi at least boots than that it just stops dead in its tracks and throws its toys out of the pram.

    The chances of me failing to plug the drive in are fairly remote: it only happened because I moved the Pi from the TV back to my PC to investigate why I'm not getting any sound, either analogue through the 3.5 mm jack or HDMI
    to the TV, and forgot to bring the external drive with me.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From f6k@3:770/3 to me@privacy.invalid on Sat Sep 12 11:49:01 2020
    On 2020-09-11, NY <me@privacy.invalid> wrote:
    Solved it! I should have used the keyword nofail to prevent boot stalling if the drive isn't present:

    /dev/sda1 /home/pi/ext ntfs defaults,nofail,umask=000,x-systemd.device-timeout=30 0 0


    https://raspberrypi.stackexchange.com/questions/75765/how-to-boot-without-mount ing-a-drive-present-during-booting
    gave me that information.

    i had the exact same problem but didn't took the time to investigate.
    thank you very much for the info, you save me the effort :)

    The consequences of the drive not being present are fairly catastrophic because the Pi is used as a TV recorder which expects to write its
    recordings to the USB drive, but its better that the Pi at least boots than that it just stops dead in its tracks and throws its toys out of the pram.

    The chances of me failing to plug the drive in are fairly remote: it only happened because I moved the Pi from the TV back to my PC to investigate why I'm not getting any sound, either analogue through the 3.5 mm jack or HDMI
    to the TV, and forgot to bring the external drive with me.

    yes, i have somehow the same problem. my chances to forget to plug my
    usb drive are low, but it happened already!

    -f6k

    --
    ~{,_,"> indignus LabRat - ftp://shl.huld.re

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From NY@3:770/3 to f6k@huld.re on Sat Sep 12 16:50:43 2020
    "f6k" <f6k@huld.re> wrote in message news:slrnrlp6cn.jec.f6k@xila.huld.re...
    On 2020-09-11, NY <me@privacy.invalid> wrote:
    Solved it! I should have used the keyword nofail to prevent boot stalling
    if
    the drive isn't present:

    /dev/sda1 /home/pi/ext ntfs
    defaults,nofail,umask=000,x-systemd.device-timeout=30 0 0

    https://raspberrypi.stackexchange.com/questions/75765/how-to-boot-without-mount ing-a-drive-present-during-booting
    gave me that information.

    i had the exact same problem but didn't took the time to investigate.
    thank you very much for the info, you save me the effort :)

    No problem. Glad to be able to help. When I first got a dark grey screen
    (just discernibly lighter than with the HDMI plug unplugged) I thought the
    Pi (or more likely the SD card image) was buggered. I'd shut the Pi down cleanly, brought it into the other room, connected it to the PC monitor, plugged in the power supply - what could have gone wrong in those stages?
    After a couple of times, I brought up a text-boot screen (probably the one
    that is hidden if you choose Splash Screen in the /boot/config.txt) which reported retries on /dev/sda1. Bugger it! That's the external HDD. Plugging
    it in allowed the Pi to boot. Phew!

    It then took a bit of research to find out what parameters to add to the /etc/fstab entry to make it *always* mount /dev/sda1 if it was present but
    to skip mounting it without protest if /dev/sda1 was not present.

    It was interesting to read the forum where someone had asked the question.

    First of all someone says "don't auto-mount, let the user do it". Then
    someone else says "don't use fstab, use udev rules and usbmount". I could
    hear Harry Enfield's voice "you don't want to do it like *that*" ;-) Various "solutions" that didn't answer the precise question or requirement and over-complicated things. Eventually someone stepped in and said "just add nofail to the fstab entry" - the voice of sanity: the simplest solution is
    the best one.

    Reducing the timeout was a supplementary, to make sure that the Pi doesn't
    hang around for so long if the drive isn't present. I could probably reduce
    it even more.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)