0

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?

5
  • 3
    Take out the card, put it in another computer and edit the file.
    – Jos
    Jun 20, 2016 at 13:20
  • i cant edit the file on a windows because it shows totaly different files that i dont even recognise
    – Sporklan
    Jun 20, 2016 at 13:28
  • 2
    You could boot the Windows computer into a live Ubuntu session temporarily, just to edit the file on the card Jun 20, 2016 at 13:29
  • 2
    @Sporklan That is because what you see is the /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.
    – Jos
    Jun 20, 2016 at 13:34
  • Allow me to explain my hints in an answer.
    – Jos
    Jun 20, 2016 at 16:19

1 Answer 1

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .