2

I have a RaspberryPi3 with a headless stretch installation. It ran a VPN server and a DNS server. Today I wanted to mount a HDD to use as a place to drop files in the LAN following this guide. After editing the fstab the system wouldn't boot. I then got the SD card and opened the drive under windows with ext2fsd, located the fstab file, found my changes and reverted them. The pi still won't boot. How can I fix this? I'd rather not wipe the SD and reinstall everything.

EDIT: I just found out that my SD card mounted under windows with ext2fsd is mounted in read-only mode. I can hit save in notepad++ but the file doesn't change. How can I write to that SD card?

EDIT2: Fixed it now. Was able to find a bootable linux DVD from which I was able to change the files of the SD card as root. Linux is so nice and tells you when the fail saves, which windows(Notepad++) did not. The last question still remains: How to mount an ext4 linux drive under windows to be able to change faulty config files?

EDIT3: Got it working by adding the following line to fstab:

UUID=<MYUID> /mounts/MOUNTFORTHISDISK ntfs-3g rw,default 0 0

fstab concents:

proc            /proc           proc    defaults          0       0
PARTUUID=eda353fb-01  /boot           vfat    defaults          0       2
PARTUUID=eda353fb-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
/dev/sda1 /mnt/mybook /ntfs defaults 0 0 # this is the faulty line
9
  • Just restore from your backup
    – Milliways
    Sep 21, 2018 at 11:16
  • That'd be not quite recent enough. Is there no way to fix this in the filesystem? After all I just changed a line in fstab.. can't this be reverted?
    – jaaq
    Sep 21, 2018 at 11:31
  • 1
    please add the content of /etc/fstab and search /var/log/syslog for "systemd-fsck"
    – Fabian
    Sep 21, 2018 at 11:46
  • I just remounted the sd and saw that the faulty line is still there despite me removing and saving it; this makes me thing ext2fsd is mounting it in readonly mode. How can I mount this in read-write mode under windows?
    – jaaq
    Sep 21, 2018 at 12:27
  • 1
    Remove the "faulty" /dev/sda1 line in fstab ... boot the Pi... Plug in the external HDD ... enter the following command in the Pi's terminal blkid ... use the UUID in your fstab instead of /dev/sda1 ... UUID=72bfc10d-73ec.... Be aware that NTFS has some extra requirements Sep 21, 2018 at 13:10

1 Answer 1

2

The mount I used did not edit the file even though saving worked without any warnings. Mounting via ext2fsd seems to be readonly. Grabbed a Linux DVD, booted my pc into there and fixed it with gedit in root. Correct line to mount is in initial question. Thanks for everyone that stepped me through in the comments!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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