RobHenry
Posts: 452
Joined: Fri Sep 21, 2012 9:04 pm
Location: UK

jessie won't boot when fstab entries not found

Sat Jan 24, 2015 10:48 am

I upgraded a headless pi to jessie and couldn't log on afterwards as sshd didn't start.

After much inconvenience of hooking up a screen and keyboard I found that start up was not completing correctly after finding an entry in /etc/fstab that doesn't currently exist, wating for one minute thirty seconds and then coming to a prompt saying

Code: Select all

Welcome to emergency mode! After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" to try again
to boot into default mode.
Give root password for maintenance
(or type Control-D to continue):
I don't have a root password set and ctrl-d just moved to a new line without anything else progressing - I had to pull the power and amend cmdline.txt to boot my back up copy of wheezy to get at the file system to fix the problem.

offending entry in fstab is:

Code: Select all

/dev/mmcblk0p3                                 /sdcardp3                     ext4    defaults   0       0
I fixed it by adding noauto, but it seems a bit drastic to prevent booting simply because the partition isn't found and it didn't behave like this in wheezy.

Does anyone know what specifically has changed in jessie to cause this behaviour? I'm guessing it must be to do with systemd treating mounts differently but I'd like to understand it because I don't know systemd and would like to know how to prevent it without having to add noauto to all my fstab entries that might not be available at boot time.

A couple more things that are bugging me are the fact that I couldn't get past the emergency prompt without a root password or ctrl-d and when I type 'journalctl' I get a message saying no journal files were found.

I know I need to read up on systemd, but any pointers or explanations would be much appreciated.

Thanks

User avatar
rpdom
Posts: 15223
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: jessie won't boot when fstab entries not found

Sat Jan 24, 2015 1:55 pm

Yes, it is to do with systemd (and is one of the main reasons I'm not going to use it until it is mature).

Try adding "nofail" to the fstab options.

RobHenry
Posts: 452
Joined: Fri Sep 21, 2012 9:04 pm
Location: UK

Re: jessie won't boot when fstab entries not found

Sun Jan 25, 2015 12:54 pm

Thanks. Adding nofail to the fstab options allows the system to boot without the partition present. It is slightly annoying that I will have to do this for all partitions that might not be available at boot time - would be much better if this was the default option.

I still have to test that the option doesn't prevent the mount when it is present!

pipinoob
Posts: 10
Joined: Sat Apr 25, 2015 3:37 am

Re: jessie won't boot when fstab entries not found

Sat May 02, 2015 7:24 am

I'm having the same problem. I made a bad entry in /etc/fstab now it is stuck at Welcome to Emergency mode! .... screen. I don't have keyboard to plug into the RPi2, I always SSH into the Pi. How do I fix the bad entry in fstab? Can I mount the image in the SD Card on my Mac then edit fstab?

User avatar
rpdom
Posts: 15223
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: jessie won't boot when fstab entries not found

Sat May 02, 2015 7:27 am

I don't think a Mac will be able to understand the Linux partition (without additional software).

You'll need another Linux system (or boot your Pi with a spare SD card) and connect your SD card with a USB card reader. Then you can mount the partition and edit the file.
Last edited by rpdom on Sat May 02, 2015 7:33 am, edited 1 time in total.

pipinoob
Posts: 10
Joined: Sat Apr 25, 2015 3:37 am

Re: jessie won't boot when fstab entries not found

Sat May 02, 2015 7:30 am

Is there any other option? I don't have a usb external sd card reader or another sd card lying around.

pipinoob
Posts: 10
Joined: Sat Apr 25, 2015 3:37 am

Re: jessie won't boot when fstab entries not found

Sat May 02, 2015 7:49 am

If i get a usb keyboard, would typing Ctrl-D let me boot up the pi and then change the fstab?

RobHenry
Posts: 452
Joined: Fri Sep 21, 2012 9:04 pm
Location: UK

Re: jessie won't boot when fstab entries not found

Sat May 02, 2015 7:53 am

pipinoob wrote:If i get a usb keyboard, would typing Ctrl-D let me boot up the pi and then change the fstab?
Based on how my system behaved in the op then yes, that would work.

I can't think of any other way of doing it if you don't have the tools to edit the ext4 partition offline.

User avatar
rpdom
Posts: 15223
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: jessie won't boot when fstab entries not found

Sat May 02, 2015 7:53 am

Yes, a USB keyboard should work.

pipinoob
Posts: 10
Joined: Sat Apr 25, 2015 3:37 am

Re: jessie won't boot when fstab entries not found

Sat May 02, 2015 8:17 am

Cool, thanks guys. I'll try that then report back

A quick off topic question, how do I mount the external Usb drive and make the current user able to write to the drive?

sudo mount /dev/sda3 /mnt/mydrive -o uid=pi,gid=pi

Doesnt work

Just mount, only root can write.

User avatar
rpdom
Posts: 15223
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: jessie won't boot when fstab entries not found

Sat May 02, 2015 8:23 am

pipinoob wrote:how do I mount the external Usb drive and make the current user able to write to the drive?
You won't be able to. As the drive is a Linux file system it will use the Linux permissions.

You will need to edit the same way you would if the drive were mounted normally. Use sudo or switch to root user.

erotavlas
Posts: 41
Joined: Wed Mar 11, 2015 5:26 pm

Re: jessie won't boot when fstab entries not found

Sun May 03, 2015 4:21 pm

I upgraded from wheezy to jessie on Raspberry pi 2 and I cannot boot with the same error of the first post. In my case nor noauto neither nofail works. Any idea?

This is my fstab

Code: Select all

# /etc/fstab: static file system information.
#
#/dev/mmcblk0p3 /               ext4    noatime,discard,data=writeback,journal_async_commit,nouser_xattr,barrier=0,errors=remount-ro 0       1
/dev/mmcblk0p3 /               ext4    noatime,nouser_xattr,errors=remount-ro,noauto 0       1
/dev/mmcblk0p1  /boot        vfat    utf8,user,rw,umask=111,dmask=000            0       0
Ramdisk   /run/shm        tmpfs   defaults,size=256M,noexec,nodev,nosuid        0       0

erotavlas
Posts: 41
Joined: Wed Mar 11, 2015 5:26 pm

Re: jessie won't boot when fstab entries not found

Mon May 04, 2015 1:17 pm

The solution is to check the disk for errors with the following command

Code: Select all

sudo fsck -MC /dev/[sd_name]
then the system is able to boot again properly.

jcbyem
Posts: 4
Joined: Sat Sep 19, 2015 9:36 pm

Re: jessie won't boot when fstab entries not found

Sun Sep 20, 2015 11:17 am

I'm having the same problem, but I cant fix it...
you said:
"I had to pull the power and amend cmdline.txt to boot my back up copy of wheezy to get at the file system to fix the problem."

any help???

RobHenry
Posts: 452
Joined: Fri Sep 21, 2012 9:04 pm
Location: UK

Re: jessie won't boot when fstab entries not found

Sun Sep 20, 2015 1:17 pm

jcbyem wrote:I'm having the same problem, but I cant fix it...
you said:
"I had to pull the power and amend cmdline.txt to boot my back up copy of wheezy to get at the file system to fix the problem."

any help???
That was specific to my set up. Unless you have a copy of the root filesystem available on another partition then it won't apply to you.

If you've got a spare sd card and a usb sd reader then create another copy of raspbian and use it to edit fstab on the other card. Alternatively, booting a live linux cd on a pc or laptop is an option if you don't have a permanent linux system.

jcbyem
Posts: 4
Joined: Sat Sep 19, 2015 9:36 pm

Re: jessie won't boot when fstab entries not found

Sun Sep 20, 2015 4:43 pm

...Thanks RobHenry ... I thought there was another solution
then I'm trying to do a live cd

Graymalk
Posts: 55
Joined: Wed Nov 11, 2015 8:33 pm

Re: jessie won't boot when fstab entries not found

Tue Jan 26, 2016 2:06 am

Just ran into this today. Googled, found this thread and no solutions elsewhere. Decided to try the steps here:
http://www.raspberrypi-spy.co.uk/2014/0 ... -password/

It works. Just skip the password reset part. You can just edit the fstab file directly (normal shell commands work) and take out the offending line. Don't forget to edit your cmdline.txt file back afterwards so you don't get stuck again.

markocro
Posts: 1
Joined: Tue Apr 19, 2016 1:19 pm

Re: jessie won't boot when fstab entries not found

Tue Apr 19, 2016 1:29 pm

I have the same issue; if the partition is mounted, it is mounted as root:root, no way to solve in fstab...
Just a newbie's observation: what about a

Code: Select all

chown user:group -R /mounted/partition/path
in /etc/rc.local??

Can someone tell me pros and cons of such a solution?

wally333
Posts: 89
Joined: Mon Jun 06, 2016 7:09 pm

Re: jessie won't boot when fstab entries not found

Mon Jun 06, 2016 8:05 pm

Sorry to bring back an old thread that appears to have no real resolution, but I'm having a similar issue. Found this via Google and joined the forum to post. My difference from the title is it won't boot even if the fstab entries are found unless a mouse/keyboard are attached. A wireless mouse/keyboard is not good enough!

Raspbian Jessie with all updates as of June 4, 2016 (apt-get update, upgrade, dist-upgrade & rpi-update). I set everything up with a GUI login and am ready to make it headless. Problem is it boots but immediately crashes into "emergency mode" (no ssh) if the keyboard/mouse is not plugged in.

Basically it is an ftp server and samba server using a 4TB USB drive. A commercial security DVR loads files via vsftpd on the RPi2 and the Samba server feeds them to other machines for near real-time analysis of a small subset of the files chosen from the outputs from other sensors. A root cron job runs to delete directories and files older than X days on the server so the drive doesn't fill up.

Its been running fine for a couple of months so I thought I was done until I tried to boot it headless by running the GUI configuration utility, unchecking autologon, and GUI, and then powering down. I then unplugged the HDMI and mouse/keyboard and was greeted by this unhappy situation when the power was reapplied :(

If I comment out the /etc/fstab entry for the USB hard drive it will boot without the mouse/keyboard but then I can't mount the USB hard drive as /dev/sda1 doesn't exist after it boots, even if I unplug and replug the USB drive (not really an option). While I may not have permuted all the sequence possibilities, /dev/sda & /dev/sda1 only seem to exist if I boot with a mouse/keyboard attached or attach a mouse/keyboard and then login from the console. An ssh login doesn't do it, so no version of a mount command will work from an ssh login or cron job.

IMHO somebody really screwed the pooch introducing a mouse/keyboard dependency into the USB hard drive startup.

wally333
Posts: 89
Joined: Mon Jun 06, 2016 7:09 pm

Re: jessie won't boot when fstab entries not found

Mon Jun 06, 2016 11:01 pm

If I comment out the /etc/fstab entry for the USB hard drive it will boot without the mouse/keyboard but then I can't mount the USB hard drive as /dev/sda1 doesn't exist after it boots, even if I unplug and replug the USB drive (not really an option). While I may not have permuted all the sequence possibilities, /dev/sda & /dev/sda1 only seem to exist if I boot with a mouse/keyboard attached or attach a mouse/keyboard and then login from the console.
After some more trial and error this is even weirder.

I had my mouse/keyboard on a USB (powered) hub along with a web cam and BT dongle. So I started trying other things, directly into the Pi USB along with the USB drive to see what was required for the bootup with the USB drive to succeed. Wireless 2.4GHz mouse/keyboard prevents bootup same as having not having the hub (with the mouse/keyboard) plugged in. So I tried a USB to PS/2 mouse/keyboard adapter, still nogo with all three possibilities -- nothing, PS/2 keyboard only, PS/2 mouse+ keyboard (the PS/2 keyboard works in emergency mode. Then I tried just a USB mouse, nogo, then I tried my USB mouse and keyboard (removed from the disconnected hub) and still nogo!

This is just too strange. I then tried the USB hub with everything unplugged and it booted fine! Then I tried with the hub unpowered and nogo. I had an older cheaper hub lying around and tried it powered and unpowered, nogo.

This just makes absolutely no sense to me!

This hub setup is normally my "test jig" with Logitech mouse (trackball actually) and Logitech USB keyboard along with a couple of web cams and a BT dongle. This way I can easily switch between the RPi2 and Beaglebone Black (which needs a powered hub for most anything).

The hub that doesn't work shows:
ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
with lsusb when plugged into another system.

On the RPi2 booted with the USB drive and empty powered hub lsusb shows:
Bus 001 Device 005: ID 0bc2:ab28 Seagate RSS LLC
Bus 001 Device 006: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I believe the pair of Terminus Technology 4-port hubs are the "generic" 7-port hub I'm using.

It would suck, but I may have to go back the Wheezy as in its intended use and location I can't have a bunch of crap hanging off it and plugging in another wall wart for the hub is problematic.

PI_Stuart
Posts: 4
Joined: Mon Jan 04, 2016 6:42 pm

Re: jessie won't boot when fstab entries not found

Sat Dec 09, 2017 10:11 pm

Thanks for this. I commented out the entry related to a usb device in my /etc/fstab and it fixed the problem.

Return to “Troubleshooting”