I just got a raspberry pi and got an image from school where we had to change the IP address to something else, by mistake instead of having auto lo in my /etc/network/interfaces
file, I have 4auto lo. This is a huge problem because now I can't connect to my Raspberry Pi with putty. I connected it directly to a screen but I don't have a USB keyboard to connect as well. I tried changing the file but I need to be root for that, then I thought maybe I could use sudo nano /etc/network/interfaces
in bash but I can't press enter or any key that does that. Now is there any way I can use a mouse to get root permission and change the file so that I can continue my homework?
1 Answer
When you have made changes to a Raspberry Pi OS and it will not boot, there is no way of using a LiveUSB system to correct it, as you would on any other Ubuntu machine. Fortunately, it's easy to pull out the SD card and change it from another computer with a card reader.
On the SD card there will be two partitions. The first one is /boot
; it contains a FAT file system, which a Windows computer can read. Unfortunately, your Raspberry Pi ´root´ file system is on the other partition. This is an ext4
file system, which cannot be read by Windows. If a Windows computer is all you have available, you have two options:
install
ext2fsd
, which is small Windows program that acts as a device driver for the card. When installed, it will allow you to read and write files on the Raspberry Pi root partition.use a LiveUSB (stick, or drive) to boot your Windows computer into a Ubuntu live session. (Choose "Try Ubuntu".). Your Windows drive will not be modified. The Raspberry Pi card will show up as an external drive.
If you have a Linux computer, things are much easier because Linux can read the ext4
root partition straightaway.
Correct the mistake, unmount the card safely, and reboot the Raspberry Pi.
/boot
partition, which is FAT and is readable by Windows. The/
partition is ext4 and is not readable from Windows unless you install a driver like ext2fsd. Or you try @NickWeinberg's solution.