Skip to main content
Added explanation
Source Link
Milliways
  • 61.5k
  • 32
  • 108
  • 212

You can repair most such problems on the Pi by rebooting to a root shell.

  1. Append init=/bin/sh at the end of cmdline.txt and reboot. (This needs to be performed by mounting the SD Card on another computer.)
  2. After booting you will be at the prompt in a root shell.
  3. Your root file system is mounted as readonly now, so remount it as read/write mount -n -o remount,rw /

You can then edit files.

NOTE if you are running NOOBS the appropriate cmdline.txt WILL NOT be in the first partition, but one of the other FAT partitions (depends on what you installed).

You can repair most such problems on the Pi by rebooting to a root shell.

  1. Append init=/bin/sh at the end of cmdline.txt and reboot.
  2. After booting you will be at the prompt in a root shell.
  3. Your root file system is mounted as readonly now, so remount it as read/write mount -n -o remount,rw /

You can then edit files.

NOTE if you are running NOOBS the appropriate cmdline.txt WILL NOT be in the first partition, but one of the other FAT partitions (depends on what you installed).

You can repair most such problems on the Pi by rebooting to a root shell.

  1. Append init=/bin/sh at the end of cmdline.txt and reboot. (This needs to be performed by mounting the SD Card on another computer.)
  2. After booting you will be at the prompt in a root shell.
  3. Your root file system is mounted as readonly now, so remount it as read/write mount -n -o remount,rw /

You can then edit files.

NOTE if you are running NOOBS the appropriate cmdline.txt WILL NOT be in the first partition, but one of the other FAT partitions (depends on what you installed).

Source Link
Milliways
  • 61.5k
  • 32
  • 108
  • 212

You can repair most such problems on the Pi by rebooting to a root shell.

  1. Append init=/bin/sh at the end of cmdline.txt and reboot.
  2. After booting you will be at the prompt in a root shell.
  3. Your root file system is mounted as readonly now, so remount it as read/write mount -n -o remount,rw /

You can then edit files.

NOTE if you are running NOOBS the appropriate cmdline.txt WILL NOT be in the first partition, but one of the other FAT partitions (depends on what you installed).