1

Model: Raspberry Pi 3 B

SD: 8GB MicroSDHC

For the past couple of weeks I've been stuck with my Pi not working. I've followed numerous guides. I've downloaded Raspbian Stretch With Desktop OS from the official site, Written the image with both EtcherIO and Win32DiskImager to the SD card, Set the IP and ssh file in the SD card, and then connected to it with Putty, everything alright so far. Now on the Pi itself, no matter how many times I repeat this process it keeps telling me that the PI is Read-Only. I've tried using sudo, and even logging as Root, and it's still Read-Only. enter image description here enter image description here

I've found that raspi-config gives an error that there's nothing mounted, tried mounting with "mount /dev/mmcblk0p1 /boot", and then atleast I can access raspi-config but can still not edit anything with Nano. Looking through Google I also noticed that my /etc/fstab file is completely empty, and should be filled with something else. enter image description here

Is this a problem with the SD card, the Pi itself or am I doing something wrong that I haven't noticed at all, because I'm completely done with this right now, I cannnot figure out why I'm having this problem.

  • Can you post the exact contents of the cmdline.txt file in the /boot partition on the card? – RubberStamp Dec 3 '17 at 15:46
  • dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=ffe2f1bd-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles ip=169.254.0.180 -I've only added the ip-line, and changed nothing else. – Sven0567 Dec 3 '17 at 15:51
  • You probably shouldn't set the link-local IP address in the cmdline... if you remove that option, you can find out the link-local address by simply pinging the Pi... ping raspberrypi.local from your host PC... It seems like the filesystems on the card are not being mounted properly at boot. However, you can check to be sure that the partitions are setup properly by issuing this command on the Pi : lsblk -o NAME,PARTUUID,FSTYPE,SIZE ... make sure that the PARTUUID for the ext4 partition matches the one listed in the cmdline.txt ... Have you tried a different SD card? – RubberStamp Dec 3 '17 at 17:13
  • i.stack.imgur.com/9NWzQ.png this is what I got, I don't really see anything wrong here I think. – Sven0567 Dec 3 '17 at 17:41
  • I only have the one SD card, which is why I wouldve preferred if I could solve this, but I did just buy a 16gb Sandisk MicroSD, hoping that this fixes the problem. :V – Sven0567 Dec 3 '17 at 17:50
2

Since it seems that your /etc/fstab is missing, you may want to fill it in with the necessary information. You'll need to manually mount the root and boot partitions first:

sudo mount -o remount,rw /dev/mmcblk0p1 /boot
sudo mount -o remount,rw /dev/mmcblk0p2 /

And then create a new /etc/fstab

sudo echo -e "proc            /proc           proc    defaults          0       0\n/dev/mmcblk0p1  /boot           vfat    defaults          0       2\n/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1" > /etc/fstab

And the to verify that the above command worked:

$cat /etc/fstab

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1

And then change the root partition in your cmdline.txt to /dev/mmcblk0p2 You can do this on your Windows machine, just like you did to add the IP.

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
  • 1
    You should perhaps use mount -o remount,rw since at least the root fs partition must already be mounted. – goldilocks Dec 3 '17 at 18:13
  • Updated answer to reflect remount option. – RubberStamp Dec 3 '17 at 18:19
  • Following these steps at the very least gives me the ability to edit files again, but the /etc/fstab does not get saved, and I have to do it again every time I restart the PI, while other files DO get saved. Is there any solution to this? ... I keep getting the "Structure needs cleaning" message when I try to save it, and that apparently does link to file corruption. – Sven0567 Dec 3 '17 at 18:42
  • So, i'm pretty sure that the problem HAS to lie on the SD-card's end, because this is just too much trouble for even getting the basics to work. Regardless, I've tried searching for errors with e2fsck which gives me the message that mmcblk0p2 is still busy so it can't do it, but sudo umount /dev/mmcblk0p2 / just gives umount: /: target is busy (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1).) – Sven0567 Dec 3 '17 at 18:54
  • @Sven0567 : If you want to run fsck, you can place an empty file called forcefsck in the root directory... sudo touch /forcefsck This will enable fsck at next boot and also remove the /forcefsck file at the same time... My guess is either the image file was somehow corrupted upon download from the web or the SD card is flaky. – RubberStamp Dec 3 '17 at 18:58
0

I solved this issue by re-formatting the SD card using disk utility for MacOS, and then re-mounting the OS image (raspbian in my case) to the drive. I made sure to use MS-DOS format and GUID partition map:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.