Piiiiiiiiiiiiiii
Posts: 8
Joined: Tue Nov 24, 2015 2:00 am

Stuck in a boot loop after editing fstab (i think)

Tue Nov 24, 2015 2:05 am

I followed this tutorial in at attempt to add a network share http://geeks.noeit.com/mount-an-smb-net ... pberry-pi/
However, now when I reboot, it's stuck in a loop and never stops rebooting.
Is there a way for me to fix this without wiping the system?

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Stuck in a boot loop after editing fstab (i think)

Tue Nov 24, 2015 8:25 am

Is this NOOBS/Raspbian or plain Raspbian?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.


User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Stuck in a boot loop after editing fstab (i think)

Tue Nov 24, 2015 3:57 pm

OK.

Hold [SHIFT] while you boot and that starts the NOOBS recovery system.

There's a config/cmdline editor as part of that recovery system. You want to edit your /boot/cmdline.txt (on partition #5) to change

Code: Select all

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait
to

Code: Select all

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait init=/bin/bash
just add that extra init= stuff on the end of the line (don't change anything else).

Reboot and you'll get a black screen with a single user $. That's a root shell, which means everything you do runs like it's been prefixed with sudo and careless commands could completely destroy your system.

mount /dev/mmcblk0p6 / -o remount,rw
cd /etc
nano fstab
sync;sync;sync
/sbin/reboot

if it doesn't reboot, wait ten seconds then pull the power. Those sync commands mean nothing is going to get broken.

Reboot holding [SHIFT] again and use the NOOBS recovery system to undo the changes to your cmdline.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Piiiiiiiiiiiiiii
Posts: 8
Joined: Tue Nov 24, 2015 2:00 am

Re: Stuck in a boot loop after editing fstab (i think)

Thu Nov 26, 2015 3:13 pm

Thank you, i manage to get to the file and removed my changes, but it's still stuck in the bootloop.
Now I am wondering what else I might have changed since it's been working for a little bit. I might have installed some SMB related package.

Aslo, i realized that mounting the SD card under the ubuntu VM that I have is a much faster way for me to get to fstab file.

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Stuck in a boot loop after editing fstab (i think)

Thu Nov 26, 2015 4:52 pm

Piiiiiiiiiiiiiii wrote:Aslo, i realized that mounting the SD card under the ubuntu VM that I have is a much faster way for me to get to fstab file.
Ah, sorry my crystal ball was offline :mrgreen: . Doing anything to a Raspberry SDcard using any other Linux system is always easier. Booting a RPi from another SDCard and mounting the duff one in a USB reader works as well.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Troubleshooting”