Re: Moving /home
- From: zeno <geoffrey.froner@xxxxxxxxx>
- Date: Wed, 06 Jun 2007 18:46:27 -0000
Thanks for your suggestions, however, I'm not sure about the
First off, I am NOT now an administrator nor are their other users on
my system. No need for explications.
How to move /home dir, which is now a sub-dir of root, to a separate
partition? To be able to upgrade/alter system without affecting main data.
First, do you have a partition?
I can make one.
 mv /home /home.old
 mkdir /home
 chmod 755 /home
From where do I issue this command? The new partition? Or from / ?
 edit /etc/fstab, adding a line similar to the following.
/dev/hdax /home ext3 noatime 1 1
/dev/hdax is the new partition location.
/home is the directory you wish to mount during bootup.
ext3 is the filesystem type.
It is possible /etc/fstab may not be using /dev/hdax, but
hopefully the comments are clear in that case.
I'm running Ubuntu 6.06 which seemed a good way to get the feet wet,
except Deb is different. There is an
/etc/fstab file. Okay, is this where we go after creating /dev/
hdax: ? In that case, the previous command:
$ mv /home /old.home is not done? Or is that an alternative to the
 mkfs.ext3 /dev/hdax
This prepares the partition for mounting, by writing out
(erasing, if there's already stuff on it!) blocks in
special locations (one of them's called the superblock)
and generally ensuring things are emptied/readied.
 mount /dev/hdax /home
And here's the actual mount. During bootup /etc/fstab is read,
and this mount automatically done.
 At this point you have some options, depending on how much data you
have and your paranoia.
(a) mv /home.old/* /home
This is the simplest but can be problematic if there's
an error. mv is smart enough to do a copy/delete,
however, if the destination is not on the same
partition as the source -- which is the case here.
(b) cp -rp /home.old/* /home
This doesn't handle symbolic links all that well.
(c) (cd /home.old; tar cf - .) | (cd /home; tar xpf -)
This complicated-looking command is two tar commands end to end.
(d) cd /home.old; tar czf /somewhere/backup/directory/home.dir.tgz .
cd /home; tar xzf /somewhere/backup/directory/home.dir.tgz
This is (c) with compression and an explicit file as an
intermediary. The file is of course a backup of your home directory
at that point in time.
Looking forward to clarification.
- Re: Moving /home
- From: The Ghost In The Machine
- Re: Moving /home