2

I was able to move /usrto an external harddrive. In fstab I mistakenly mounted the drive with nosuid. Now I can't use sudo or su. I can't edit the fstab entry. When I manage to open it I can't do so as root and it therefore is read-only. I can provide more details if need be.

How can I fix this?

2
  • You probably have a mistake in your question: fstab sits in /etc/ so it does not reside on /usr/(??)
    – Rinzwind
    Sep 13, 2011 at 13:28
  • @Rinzwind Sorry that was referring to another question which I asked earlier I mentioned that because when I edited fstab to mount the usr directory I set it to mount as nosuid. This is, to my knowledge, what caused the problem. Sep 13, 2011 at 19:43

3 Answers 3

6

Boot into recovery mode and choose the root shell option, then edit and fix your fstab:

nano /etc/fstab
2
  • This is the easiest method :)
    – Rinzwind
    Sep 13, 2011 at 13:54
  • Unfortunately I wasn't able to boot into recovery due to several reasons. Thankyou for your input. Sep 13, 2011 at 22:11
2

I'm probably late to the party, but recently I learned that having /usr on a separate partition is not such a good idea anyway - some things during the early Linux boot expect /usr to be available - so generally there will be silent failures unless you also modify the initrd to mount /usr during the early boot:

Most of the failures you will experience with /usr split off and not pre-mounted
in the initramfs are graceful failures: they won't become directly visible, 
however certain features become unavailable due to these failures.
...
Here's a short, very in-comprehensive list of software we are aware that currently
they are not able to provide the full set of functionality when /usr is split off 
and not pre-mounted at boot: udev-pci-db/udev-usb-db and all rules depending on
this (using the PCI/USB database in /usr/share), PulseAudio, NetworkManager, '
ModemManager, udisks, libatasmart, usb_modeswitch, gnome-color-manager, usbmuxd, 
ALSA, D-Bus, CUPS, Plymouth, the locale logic of most programs and a lot of 
other stuff.

See Booting Without /usr is Broken for more details.

3
  • Well, Ubuntu of course doesn't use systemd, so the details of that page and the boot order don't exactly apply. But generally, I agree, it's not a great idea. Have a separate /boot if you want, and then the rest of the OS on /.
    – poolie
    Sep 14, 2011 at 4:52
  • Good catch! Still, I agree with you agreeing with me that it feels extremely fragile :)
    – Sergey
    Sep 14, 2011 at 8:05
  • Waaait a minute!.. The problem is caused by udev, not by systemd: "systemd itself is actually completely fine with /usr on a separate file system that is not pre-mounted at boot time"; "(some) udev rules ... will silently fail to work if /usr is split off and not pre-mounted" :)
    – Sergey
    Sep 14, 2011 at 8:09
2

I am exactly not sure if I understood you right but I think you may could reboot your machine and go in grub in the recovery mode and create a new user or use your normal user and give him back his admin/sudo permissions but I may understood your wrong. Just a question at last: You have stil got a /usr folder right? If not uhh this will a little bit mor complicated.(I think)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .