[PLUG] Moving /home directory
Eric Wilhelm
ewilhelm at sbcglobal.net
Fri May 13 17:26:30 UTC 2005
# The following was supposedly scribed by
# Reid Leake
# on Thursday 12 May 2005 09:44 pm:
>Is there anything else I need to do besides move my files from the
>old /home to the new partition (hdb1) to make this transition?
>If so, this sure is easier than certain 'other' OSes.
>I am running Ubuntu, which is Debian based, if that makes a
> difference.
The way *nix sees the filesystem is as one single tree, which means that
you can do all sorts of crazy (and even stupid) things with your mount
points and everything will work exactly the same.
The one tricky bit here would be the copy/move operation onto a mount
point. You probably don't have any hidden files directly under /home/,
but if you did, you would have to use the cp as shown below to get them
all in one blow.
mkdir /mnt/disk
mount /dev/hdb1 /mnt/disk
# 'mv /home/* /mnt/disk/' misses hidden files
cp -a /home/./ /mnt/disk/
cd /
# got backups?
# rm /home/ -rf
# ^-- that assumes that home is not currently a mount point
mkdir /home/
umount /mnt/disk
mount /home
Heck, you don't even have to delete everything that's under /home to
mount on top of it (unless you wanted that disk space back :-)
Now. Does anyone know of an mv command which is equivalent to the above
copy? That is, moves everything from *within* a directory to another
(including hidden files.)
--Eric
--
"Everything goes wrong all at once."
-- Quantized Revision of Murphy's Law
---------------------------------------------
http://scratchcomputing.com
---------------------------------------------
More information about the PLUG
mailing list