# Moved /usr to a separate partition - setuid problems



## Chlorus (Apr 10, 2009)

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?


----------



## Chlorus (Apr 10, 2009)

I'm starting to guess I should have used dump instead...


----------



## Djn (Apr 10, 2009)

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.


----------



## Chlorus (Apr 10, 2009)

Thanks for the reply Djn. Well that was a learning experience, thank god the data from the old /usr was still around.


----------



## gordon@ (Apr 10, 2009)

See the cp man page. You need the -p flag.


----------



## SirDice (Apr 10, 2009)

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:


```
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.


----------

