4

So I was trying to mount a drive on boot. I was editing /etc/fstab and then I rebooted to see if my drive would mount on boot. Now I can't do anything. The prompt I see Give root password for maintenance (or press Control-D to continue):

When I press Control-D this prints: sulogin: cannot read /dev/tty1: Operation not permitted

I've tried all kinds of root passwords but none of them work. I tried to tap shift while it boots and nothing happens.

EDIT: This question is not a duplicate because when I press Control-D at the prompt I get an error message

I'm on a Pine64. Is there any way to salvage the device or save the files?

Bootable USB's do not work

Elder Geek
  • 36,023
  • 25
  • 98
  • 183
  • 1
    Please, instead of tapping the Shift, keep it pressed since the BIOS, until you see a boot menu. Then select "recovery mode", wait the system to boot, choose "root" from the menu that will appear and then undo all the changes you've made to fstab. – 0x2b3bfa0 Jul 27 '18 at 20:47
  • If you keep getting the Control-D message, reboot and press e with the recovery mode menu entry highlighted, then modify the parameters to have the init parameter set to /bin/bash (you would end with something like init=/bin/bash) – 0x2b3bfa0 Jul 27 '18 at 20:57
  • So when I press either of those while it's booting it causes the screen to stop working, it is still on but the display is off – MrEngineer13 Jul 27 '18 at 21:19
  • Whoops... That's weird. Can you get the GRUB menu by powering off the computer abruptly while booting? Allegedly, the next boot should display the menu. Anyhow, I would recommend you to boot from any live installation media (CD, USB) and work from there to fix the fstab. – 0x2b3bfa0 Jul 27 '18 at 21:45
  • Shutting off while rebooting doesn't work, neither do bootable usb's – MrEngineer13 Jul 30 '18 at 21:19
  • Could you try booting this from an external storage device (USB or CD/DVD)? https://www.supergrubdisk.org/super-grub2-disk/ – 0x2b3bfa0 Jul 30 '18 at 22:24

1 Answers1

1

Some quick research indicates that the Pine64 Utilizes a MicroSD card for storage. If this is indeed the case you can easily edit the /etc/fstab file by mounting the aforementioned card in another Ubuntu (or for that matter probably any other) system that supports the file system in use, by editing /mountpoint/etc/fstab on the system you've mounted the SDcard in and reversing the changes you made previously. If you cannot locate a system with an SDcard reader, there are USB card readers available that you can utilize for this process. Since /etc/fstab is a text file you should be able to edit it with virtually any text editor that is available to you on the system you are using to edit the SDcard. If you created a backup copy before you began editing you can simply copy the backup over the current file to resolve the issue. It might be necessary to use root permissions to edit the file or adjust permissions after you are done to match what is expected. Typically you should get -rw-r--r-- 1 root root permissions and ownership when you issue the command ls -a /etc/fstab You may have to adjust these by using the chmod and chown commands respectively. which corresponds to read write permissions for root, read permissions for the root group and read permissions for others. The file is owned by root and the root group. These results are obtained via octal notation using the commands chmod 644 filename and chown root:root filename where filename is the file you are changing permissions on (in this particular case with the SDcard mounted in another system /mountpoint/etc/fstab) Once you've completed the edit you can simply unmount and then return the SDcard to the Pine64 and boot normally. If it still doesn't boot you can attempt to recover the data from the SDcard in a similar fashion by mounting it in another system and simply copying the data to another device or if necessary using data recovery tools like ddrescue or testdisk or photorec. If any part of this answer is confusing or unclear please drop me a comment and I'll do my best to clarify.

Elder Geek
  • 36,023
  • 25
  • 98
  • 183