Loss of sudo right after remounting /usr/

Asked by inkybutton

Hi,
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

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

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:
/usr/bin/wall
/usr/bin/newgrp
/usr/bin/chage
/usr/bin/chfn
/usr/bin/chsh
/usr/bin/expiry
/usr/bin/gpasswd
/usr/bin/passwd
/usr/bin/X
/usr/bin/sudoedit
/usr/bin/sudo
/usr/bin/screen
/usr/bin/at
/usr/bin/bsd-write
/usr/bin/crontab
/usr/bin/arping
/usr/bin/traceroute6
/usr/bin/mtr
/usr/bin/ssh-agent
/usr/bin/fileshareset
/usr/bin/kgrantpty
/usr/bin/kpac_dhcp_helper
/usr/bin/lppasswd
/usr/bin/fping
/usr/bin/fping6
/usr/bin/pmount
/usr/bin/pumount
/usr/bin/kdesud
/usr/bin/sperl5.8.8
/usr/bin/kppp
/usr/bin/slocate
/usr/bin/xterm
/usr/bin/traceroute.lbl
/usr/bin/schroot
/usr/bin/smbmnt
/usr/bin/dotlockfile

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

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

Revision history for this message
inkybutton (inkybutton) said :
#3

User confirmed that the request is solved.

Revision history for this message
indemo (tiberiukiss) said :
#4

sorted my similar problem too. Thanks!