Moved /usr to a separate partition - setuid problems

I had run out of space on my root partition, so I decided I'd create another slice and partition on another drive and move my /usr contents there and mount that as /usr to free up some space. The copy (with cp -R) and mount of the drive went fine, but I now cannot use any programs such as sudo or su that rely upon setuid. Additionally, the XFCE terminal program now displays a blank prompt.

Anyone have any ideas on what caused this, and if so, what can fix it? I must have screwed up pretty badly somewhere along the line. Did the cp -R somehow cut off the setuid flags?
 
That's entirely possible, yes - I've found it safer to use pax when you want to make sure all flags and permissions survive.
(Check the man page - I think pax -p e -r -w source dest should work.)

edit: dump works - but I think using pax is easier.
 
Thanks for the reply Djn. Well that was a learning experience, thank god the data from the old /usr was still around.
 
Don't use cp, even with the -p flag. Cp will screw up on hardlinks. Instead of creating a new hardlink it'll copy the file. Using tar or pax is a more safer option.

Try it:

Code:
mkdir test
cd test
echo "this is a test" > test.txt
ln test.txt test2.txt
Now edit test.txt and see what happens to test2. Next copy the directory test to test2. Then in test2 edit test.txt and see what happens to test2.txt.
 
Back
Top