Instructions for relocating /home to a separate partition
Hi, I am currently in the middle of a house move, and hence don't have access to most of my books, etc. Can somebody please point me to a good resource for relocating /home to a separate partition. I've already created the partition, but I am not sure about the sequence of actions to copy the content of /home to the new partition. Thanks Werner
On Fri, 1 Aug 2003 17:39:26 +0200
Werner Guttmann
Hi,
I am currently in the middle of a house move, and hence don't have access to most of my books, etc.
Can somebody please point me to a good resource for relocating /home to a separate partition. I've already created the partition, but I am not sure about the sequence of actions to copy the content of /home to the new partition.
It's pretty simple. 1. Mount your new partition somewhere, like /mnt 2. Copy the entire contents of your current /home to /mnt midnight commander makes this easy 3. Change your /etc/fstab to reflect that /home is on /dev/hda? It should look something like this: /dev/hda8 /home ext2 defaults 1 2 4. Reboot or init 1 then back up. -- I'm not really a human, but I play one on earth.
The 03.08.01 at 17:39, Werner Guttmann wrote:
Can somebody please point me to a good resource for relocating /home to a separate partition. I've already created the partition, but I am not sure
/mini/Hard-Disk-Upgrade.gz Hard Disk Upgrade Mini How-To How to copy a Linux system from one disk to another. -- Cheers, Carlos Robinson
On Sat, 2 Aug 2003 01:39 am, Werner Guttmann wrote:
Can somebody please point me to a good resource for relocating /home to a separate partition.
Zentata replied: It's pretty simple. 1. Mount your new partition somewhere, like /mnt 2. Copy the entire contents of your current /home to /mnt midnight commander makes this easy 3. Change your /etc/fstab to reflect that /home is on /dev/hda? It should look something like this: /dev/hda8 /home ext2 defaults 1 2 4. Reboot or init 1 then back up. I'd add a step 0, backup the entire contents of /home to cd or something. To actually get the disk space back you have to delete the old copy of /home back to a bare empty directory. Yes, scary, see step 0. If you just mount over the top of it it will be invisible, frozen under the surface and will still take up disk space. So as a step 3a, rm -r /home/* -- Michael James michael.james@csiro.au System Administrator voice: 02 6246 5040 CSIRO Bioinformatics Facility fax: 02 6246 5166
On Mon, 4 Aug 2003 09:54:06 +1000 Michael.James@csiro.au wrote:
I'd add a step 0, backup the entire contents of /home to cd or something.
To actually get the disk space back you have to delete the old copy of /home back to a bare empty directory. Yes, scary, see step 0. If you just mount over the top of it it will be invisible, frozen under the surface and will still take up disk space.
So as a step 3a, rm -r /home/* I would think there is no need for step 0. First, you should be doing some sort of routine backup (but that is an assumption). But, after you do the copy, don't delete the old stuff until you verify that the new data is there.
the other comment is:
after I verify that the new /home is good, then I might move the old
contents to another directory on the same file system. But, when you
remove the old content, rather than use rm -r /home/*, I would cd /home
them do a rm -rf *
In any case, a typo:
for example: rm -r /home/ *
This will not only remove /home, but also the contents of the current
directory.
The bottom line is to be very careful when doing a recursive rm. rm -rf
/ will ruin your whole day.
--
Jerry Feldman
On Mon, 4 Aug 2003 10:07 am, gaf wrote: Some good points, particuarily suggesting moving /home to say /home.old Then mkdir /home and reboot. Check everything is still there in the new /home and then delete the old. Yes the extra space before the * in an rm command is deadly but care is the only protection. I have already been bitten by the difference between these 2 commands Intended> rm *.old Typed > rm * .old Having said that care is the only protection, why not an rm that insists that a loose globbing * be the only argument... -- Michael James michael.james@csiro.au System Administrator voice: 02 6246 5040 CSIRO Bioinformatics Facility fax: 02 6246 5166
Some good points, particuarily suggesting moving /home to say /home.old Then mkdir /home and reboot. Check everything is still there in the new /home and then delete the old. Why reboot?????? IMHO, the only time you really need to reboot Linux is when you want to
On Mon, 4 Aug 2003 10:26:47 +1000
Michael.James@csiro.au wrote:
put in a new kernel. (There are times when things do get hung, but even
then most of the problems are GUI oriented).
--
Jerry Feldman
participants (5)
-
Carlos E. R.
-
Jerry Feldman
-
Michael.James@csiro.au
-
Werner Guttmann
-
zentara