[NTLUG:Discuss] How to move data from one drive to another

Bryan J. Smith b.j.smith at ieee.org
Fri Aug 5 08:13:23 CDT 2005


On Fri, 2005-08-05 at 07:44 -0500, John Thomas wrote:
> My current idea is this:  Install the new larger drive as hdb, format it 
> and copy my existing /home to it.

<anal>I assume you meant sdb, not hdb</anal>

Yep,

1.  fdisk /dev/sdb
2.  mke2fs -j /dev/sdb1
3.  mkdir /newhome
4.  mount /dev/sdb1 /newhome
5.  cd /home
6.  find . -umount | cpio -pmdv /newhome
7.  umount /newhome

> Then, wipe the existing hda drive and do a clean install 
> (that would be Red Hat 4EL)

You don't need to wipe it, just make sure you formal new filesystems in
the Anaconda installer.

> Next, how do I modify fstab to show that /home is on the new drive?
> I've read the man page on fstab, but the use of the LABEL designation
> is still obscure to me.

You can either give the device name, e.g.:  /dev/sdb1

Or you can label the partition and use that in /etc/fstab.
E.g., after step #2 above, do:  
  e2label /dev/sdb1

And instead of step 4, use the new label:  
  mount LABEL=(whatever) /newhome

And make sure you now use that for the new filesystem.

Labels are just a way to make filesystems addressable/mountable without
having to worry what the exact disk/slice the filesystem may be at
boot/mount-time.  You don't have to use them.

But if you do use them, make sure your labels are _unique_.


-- 
Bryan J. Smith     b.j.smith at ieee.org     http://thebs413.blogspot.com
----------------------------------------------------------------------
The best things in life are NOT free - which is why life is easiest if
you save all the bills until you can share them with the perfect woman





More information about the Discuss mailing list