Loss of sudo right after remounting /usr/

Asked by inkybutton

I am trying to upgrade to 6.10 aka. Edgy. I don't have much space left in my root partition so I decided to mount another partition to my /usr directory. After copying all the files of /usr/ to partition hda9, I deleted all /usr/ files (under Recovery Mode) and edited /etc/fstab and /etc/mtab so /dev/hda9 mounts at /usr directory. After rebooting, everything seems to work fine until I realize that I lost my sudo right! This is what happens when I type, for example,

 $ sudo apt-get install audacity
 sudo: must be setuid root

This means I can't even go to "Users and Groups" to change my rights back to sudo status! Help...

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Solved by:
Frode M. Døving
Last query:
Last reply:
Revision history for this message
Best Frode M. Døving (frode) said :

You need to boot to recovery mode and set sudo setuid root.

reboot to recovery mode and run
'chmod +s /usr/bin/sudo'

My guess is that you have copied everything without preserving permissions. If you still have the old /usr around I'd suggest copying again, with rsync. That's the best way to preserver all permissions and ownerships.

If you don't have it, this is the list of suid files in my /usr:

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) said :

As an alternative to rsync you can copy using cp with the -p parameter.

Revision history for this message
inkybutton (inkybutton) said :

User confirmed that the request is solved.

Revision history for this message
indemo (tiberiukiss) said :

sorted my similar problem too. Thanks!