1

I successfully mounted an external USB HD by editing the /etc/fstab file as detailed here, and everything worked great, until I tried booting up my Pi without the drive attached. The Pi refused to boot so I powered it down, reconnected the drive - and it still won't boot. I'm not sure what to do - I can't undo my changes to the /etc/fstab file without first booting up the Pi, and I don't want to have to scrub the SD card and start again - can anyone help?

  • Can you please tell us what you entered into the /etc/fstab and also what the error message during boot is? – Uwe Plonus Aug 4 '18 at 19:40
  • 1
    "I can't undo my changes to the /etc/fstab file without first booting up the Pi" -> You can modify fstab without the system running, although of course you would need another computer which can read ext4 filesystems. Doing without one seems like an exercise in frustration as far as the Pi goes. – goldilocks Aug 4 '18 at 20:27
  • Do you can read the second partition that has an ex4 file system from another computer? Do you use a linux computer? – Ingo Aug 4 '18 at 23:03
2

It's odd that reconnecting the drive won't allow boot to complete. Did you change the drive in any way after unplugging it, and before plugging it back in? If so, that would explain the issue. If this is the case, try to restore the drive configuration as it was before, and try booting again with it plugged in. If you didn't change the drive config, or can't recall the config changes...

It would seem you may have stepped into a hole :) And as @goldilocks has indicated in his comment, without a system that can read ext4 filesystems, you may not be able to edit the errant line in your /etc/fstab file to recover. I've heard that Windows PCs are able to read ext4, but I can't confirm that personally. However, this thread suggests that you can, altho' it may require a third party app be installed. For Macs, you probably will need a third party app to read ext4. OTOH, many Linux systems will allow you to mount your SD card (possibly via a USB/SD adapter), and once you mount your SD card, you simply go to etc/fstab and correct your entry.

You probably can't tell us exactly what you put into your /etc/fstab file since it's not an entirely memorable character string, to say the least. However, I will hazard a guess that an option you omitted from your entry was this one:

nofail

It would be entered on the same line with the other options; here's an example of how it could be used, taken from an entry in one of my /etc/fstab files:

LABEL=SANDISK16GB /home/pi/mntThumbDrv exfat rw,user,nofail 0 0

Neither the documentation you followed, nor the man page (man fstab) state that omission of the nofail option will prevent the boot process from completing. And quite frankly, I don't know where the wheels come off, but I do know this:

If I don't have the nofail option in my /etc/fstab entry, and the thumb drive is not plugged in at boot time, I cannot connect to mt RPi using SSH.

But as one of the moderators here says, "Don't Panic" :) The worst case is that you re-install Raspbian on your SD card, and start over again.

Finally, mounting drives in Linux has always struck me as far more complicated than it should be (but that's just me), and this GitHub page may be helpful.

Hope that helps - let us know if you have further questions.

  • Thanks so much for your help. I didn't make any changes to the drive so that part remains a mystery, but I followed your suggestion and installed 'extFS for Mac' (with a free 10-day trial) paragon-software.com/home/extfs-mac added the 'nofail' option to the line and everything started working again, the Pi boots whether the drive is attached or not. – codebox Aug 5 '18 at 7:23
  • @codebox: Happy to do it. I hope to get some answers as to how nofail figures in to boot failures, and why that's not covered in the docs. If I learn anything, I'll edit my answer here. – Seamus Aug 5 '18 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.