15

I deleted two unused user accounts. Now I am unable to login even into my own account. I rebooted in recovery mode in the root shell and tried to restore the back-up of /etc/passwd. However, the filesystem is read-only!

I can only access root shell via recovery.

Can you help me?

muru
  • 193,181
  • 53
  • 473
  • 722
Louis
  • 303
  • 2
  • 9
  • 22
  • @Jobin There is [an existing bug](https://bugs.launchpad.net/ubuntu/+source/friendly-recovery/+bug/996454) for this. You may want to add your vote (the green writing near the top-left of the bug page). – Paddy Landau Feb 12 '13 at 16:59
  • Thanks @PaddyLandau. Thought it was a security measure rather than a bug. Marked it as it affects me too :) – jobin Feb 12 '13 at 17:06
  • Well, it used to work until (I think) 11.10. – Paddy Landau Feb 12 '13 at 21:19

2 Answers2

37

If I am not wrong, the filesystem is mounted read-only by default in Recovery mode. To mount it as read-write, go the recovery mode and choose root. Now type the following command:

mount -o rw,remount /

Note the spaces, you'll get an error if you ignore the spaces, or add extra ones too. And then you can copy as you tried earlier.

muru
  • 193,181
  • 53
  • 473
  • 722
jobin
  • 27,142
  • 16
  • 100
  • 116
0

Recently on my Ubuntu 16.04 LTS, I encountered error "System is running in low-graphics mode" and there is no way you can login or proceed beyond this error screen.

For me this happened when I renamed /usr/share/X11/xorg.conf.d directory while I was trying to solve one of the graphics related problems.

Workaround:

On the error window, press ctrl+alt+f3 to get to the console. Here the filesystem is mounted but in read-only mode so you can't edit to rename the directory back for correction.

To mount the filesystem in read-write mode, use following command

Command: mount -o rw,remount /

It would mount the filesystem in read-write mode. Now you can correct the name of the directory using mv command. Then, use exit command and Press Alt + multiple times till you get to the UI again.

If required, reboot the system using reboot command, now you should be able to login as usual.