Toby DiPasquale on 12 May 2006 06:28:57 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Moving system between drives


On Thu, May 11, 2006 at 11:58:30PM -0400, Toby DiPasquale wrote:
> On Thu, May 11, 2006 at 10:23:36PM -0400, jazzman@exdomain.org wrote:
> > I know I should know this, but it's been a while since I've done it. I've 
> > got a RH9 box running on a system with a 10gig drive. I just got my hands 
> > on a 40gig drive and I'd like to upgrade. I know you can use dd to make a 
> > perfect clone of the system onto another drive, but I seem to recall you 
> > can only do that if the two drives are the same geometry. 
> > 
> > Is there an easy way to take the system as is, clone the system onto the 
> > bigger drive (adjusting partition sizes to account for the new drive size 
> > of course) and then just swap drives and merrily go on my way?
> 
> First build the partition table on the new disk to your liking. If you
> have only one partition on the first disk, all the easier. You can make
> any partition on the second disk bigger than the first, but you probably
> shouldn't make any of them smaller.
> 
> Assuming the first disk is /dev/hda and the second disk is /dev/hdc, then
> for each partition ($X) that you just created:
> 
> # mount /dev/hdc$X /mnt
> # cd /mnt
> # dump -0 -f - /dev/hda$X | restore -r -f -
> # cd ..
> # umount /mnt
> 
> Do this all as root.
> 
> dump(8) and restore(8) make full _filesystem_ copies, which is what you
> want. dd(1) will make a perfect disk copy, which is probably not what you
> want given that the two disks will likely have different geometry, as
> you've correctly pointed out above.
> 
> HTH
> 
> P.S. On RedHat the package containing dump(8) and restore(8) is called
> 'dump', in case you don't already have it. On Debian/Ubuntu its also
> called 'dump'. Don't know what Slack calls it.
> 
> P.P.S. It appears that Linux dump(8) and restore(8) only work on ext2
> filesystems. This should also translate to ext3, since the only difference
> is the hidden .journal file in the root of the FS which will also be
> copied, but if you're using Reiser or XFS or something, you may have to
> see if there is a dump(8)/restore(8) combo or similar utility for whatever
> FS you're using.

Oops, almost forgot. You will, of course, have to reinstall your
bootloader on the MBR of the new disk after you've done the dump/restore
above.

-- 
Toby DiPasquale
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug