Showing posts with label mount. Show all posts
Showing posts with label mount. Show all posts

Tuesday, July 22, 2014

How to recover from a broken sudo

You cannot fix a broken sudoers file while logged in. You would need access to sudo for that...and it's broken. You can't get to the root account because it's locked in normal use.

So you need to reboot into a condition where root is unlocked and available.

1) Save all your work and then reboot.

2) Hold down the left SHIFT button to get to the GRUB prompt.
If you get a pretty splash screen, reboot and hold down the button earlier.

3) At the Grub prompt, select Advanced Options

4) At the Advanced Options prompt, select any Recovery Console

5) Watch the boot technobabble run across your screen.

6) At the Recovery Console prompt, select Drop To A Root Shell

7) You should see a warning about a read-only filesystem.
The prompt should look like '#'

8) Remount the root filesystem as read-write instead of read-only. We want to make changes that stick.

# mount -o remount /


9) Try a test write. It should not cause an error:

# date > /tmp/test


10) Okay, now go into visudo and fix your mistake.

11) When complete, reboot into normal Ubuntu.

# shutdown -r now

Saturday, March 8, 2008

Mounting a USB stick drive on an OLPC Laptop

Success! How do you mount a USB stick on an OLPC laptop and get a window of the contents?

Tip #1: Try several of the USB ports. I was successful in the lower right side port.

Tip #2: Once inserted, the USB stick will automount under /media/UsbStickName. Just do an ls /media/ to see your stick there.

Tip #3: For the GUI, look in the Journal. The stick shows as an icon on the bottom. Click it, and the window of contents opens!

Tip #4: To unmount and eject the drive, use the Journal's USB Drive icon. Trying to use the umount command in Terminal fails, claiming the drive is busy.