nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   General Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=27)
-   -   Cloning hard drive with dump and restore commands (http://www.nvnews.net/vbulletin/showthread.php?t=36157)

satimis 09-03-04 09:37 PM

Cloning hard drive with dump and restore commands
 
Hi folks,

Debian

I'm prepared to clone a hard drive of 7G capacity (ATA-33) to a new drive of 40G (ATA-100) with 'dump and restore' commands as follows;
(Remark: old and new drives of unequal capacity)

1)
connect ATA-100 drive as Primary slave

2)
# fdisk -l (to find the partitions on ATA-33 drive, e.g.)
Code:

  Device Boot      System
/dev/hda1  *      Linux
/dev/hda2          Linux
/dev/hda3          Linux swap
/dev/hda4 /var      Linux
etc.

3)
Make partitions on ATA-100 drive same as ATA-33 drive but of different capacity
# fdisk n /dev/hdb
etc.

4)
Then make following mount points (still on ATA-33)
# mkdir /mnt/boot
# mkdir /mnt/root
# mkdir /mnt/var

5)
# mount /dev/hdb1 /mnt/boot
# mount /dev/hdb2 /mnt/root
(/dev/hdb3 is swap)
# mount /dev/hdb4 /mnt/var

6)
Do follows;
Code:

# dump f - /boot | (cd /mnt/boot; restore rf -)
# dump f - / | (cd /mnt/root; restore rf -)
# dump f - /var | (cd /mnt/var; restore rf -)

Can folks on the forum shed me some light because I'm inexperienced on 'dump and restore' commands in particular cloning drives with them. This is my first time. I searched Internet but could not find identical case.

Furthermore I still face a problem about the cable. Old drive ATA-33 uses 40-wire cable but the new drive ATA-100 80-wire cable. 40-wire cable can go into the sock of a ATA-100 drive but a 80-wire cable can't go into the socket of ATA-33 drive because of a blind hole on its plug. I shall use a 40-wire cable connecting the new drive ATA-100 as slave. If it can't be detected by BIOS then I will connect the ATA-100 drive to Secondary IDE, removing the burner and CDrom temporily. Because 80-wire cable also can't go into the socket of burner and CDrom respectively.

Kindly advise. TIA

B.R.
satimis

Soul-Crusher 09-06-04 03:41 PM

Re: Cloning hard drive with dump and restore commands
 
An alternative method that you might find easier is using the find command and piping it to cpio. To do this:
1. Mount all partitions
2. find -print -mount / | cpio -pdmv /mnt/
find -print -mount /boot | cpio -pdmv /mnt/boot
find -print -mount /var | cpio -pdmv /mnt/var
and so on for all your partitions. You might also try:
find -print / | cpio -pdmv /mnt/
to do all partitions at once.

The advantage to this over cp -R is that it won't get confused on symlinks and devices. The advantage of it over dd is that it won't try to copy empty space. And finally, the advantage to using it instead of dump and restore is that it will work on any filesystem, not just ext2/3.

satimis 09-07-04 05:23 AM

Re: Cloning hard drive with dump and restore commands
 
Hi Soul-Crusher,

Thanks for your advice.

Quote:

You might also try:
find -print / | cpio -pdmv /mnt/
to do all partitions at once.

Is it applying the above command line (a single command line) to replace the 3 command lines in Step 2)

TIA

B.R.
satimis


All times are GMT -5. The time now is 08:22 PM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.