I ruined my RPi, by using Python script in rc.local which shutdowns RPi as soon as it starts. Thus I cannot even login or ssh. How could I edit SD card from windows to change that rc.local file?
Asked
Active
Viewed 656 times
-1
-
boot into safe mode, use this answer (not the accepted answer) - note, you will need keyboard and screen on the pi – Bravo Feb 03 '22 at 09:42
-
thanks, but I already installed fresh OS to sd card. I retrieved all important data with win32imager and 7zip – Ri Di Feb 03 '22 at 13:22
1 Answers
1
This can not be done on Windows, but it can be fixed on any Linux system (which can be a Pi).
You can repair most such problems on the Pi itself by rebooting to a root shell.
- Append
init=/bin/sh
at the end ofcmdline.txt
and reboot. - After booting you will be at the prompt in a root shell.
- 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 to fix the problem.
- Remove
init=/bin/sh
fromcmdline.txt
and reboot.

Milliways
- 59,890
- 31
- 101
- 209