Re: Moving /home
- From: The Ghost In The Machine <ewill@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 10 Jun 2007 10:06:26 -0700
In comp.os.linux.setup, zeno
<geoffrey.froner@xxxxxxxxx>
wrote
on Wed, 06 Jun 2007 18:46:27 -0000
<1181155587.928272.283800@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>:
Thanks for your suggestions, however, I'm not sure about the
sequences.
First off, I am NOT now an administrator nor are their other users on
my system. No need for explications.
h.googlegroups.com>:
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.
Good.
[1] mv /home /home.old
[2] mkdir /home
[3] chmod 755 /home
From where do I issue this command? The new partition? Or from / ?
Root; at this point you've not prepped the new partition yet.
[4] 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
following steps?
If you want your partition mounted at bootup you generally
have to put it into /etc/fstab as described above. (There
are alternatives such as mounting it in /etc/init.d/local,
but, since editing /etc/fstab is so simple, unless one has
removable devices or other special requrements, there's
usually not much point.)
[5] mkfs.ext3 /dev/hdax
(This, BTW, is the prep part. Partitioning using fdisk simply allocates
space.)
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.
[6] mount /dev/hdax /home
And here's the actual mount. During bootup /etc/fstab is read,
and this mount automatically done.
[7] 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.
Thanks,
Zeno (Geoffrey)
HTH
--
#191, ewill3@xxxxxxxxxxxxx
"Woman? What woman?"
--
Posted via a free Usenet account from http://www.teranews.com
.
- References:
- Re: Moving /home
- From: zeno
- Re: Moving /home
- Prev by Date: Re: filesystem 100% full, but files do not occupy the space
- Next by Date: Re: "no valid devices were found on which to create new filesystems"
- Previous by thread: Re: Moving /home
- Next by thread: Awesome
- Index(es):
Relevant Pages
|