Creating /home partition

Gary W. Swearingen garys at opusnet.com
Fri Jun 16 20:20:20 UTC 2006


Yorvik <yorvik.ubunto at googlemail.com> writes:

> Thanks.  I've read various things on this and ended up rather confused.
> strangely non of the articles I read ever mentioned deleting the contents of the original folder, some thing i assumed
> you'd have to do.

(Please limit your lines to about 70 characters.)

You don't HAVE to delete the contents of the directory, but when 
you mount a new device (partition) at that directory, the original
contents will be hidden until you unmount the device.  Of course,
the old contents will take up space on it's (old) partition, and
might (I suppose) make filesystem reports (eg from "df") confusing.


If you're going to keep the old content a while, maybe use
(in single-user mode, with "/home" unmounted):

mv /home /home.old
mkdir /home
(if neccessary: mkfs /dev/<new-home-partition> )
mount /dev/<new-home-partition> /home
(GLOBIGNORE='.:..'; cp -a /home.old/{,.}* /home)


(That last bit of obfusication seems to be necessary to make
filenames which begin with "." without getting "." and ".."
(something that's not necessary with the "pdksh" shell, BTW).
Maybe that's way so many people prefer to use "tar" for this.
Or maybe Linux "cp" needs yet another option.)




More information about the ubuntu-users mailing list