Go Back   nV News Forums > Linux Support Forums > General Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 09-03-04, 08:37 PM   #1
satimis
Registered User
 
Join Date: Sep 2004
Posts: 10
Default 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
satimis is offline   Reply With Quote
Old 09-06-04, 02:41 PM   #2
Soul-Crusher
Leadtek 6800GT
 
Join Date: Aug 2002
Location: Albuquerque, NM, USA
Posts: 195
Send a message via ICQ to Soul-Crusher Send a message via AIM to Soul-Crusher Send a message via Yahoo to Soul-Crusher
Default 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.
__________________
"Floating in a dream-like state, I am the emporer of a parallel universe." --Arch Enemy
My xorg.conf file
Soul-Crusher is offline   Reply With Quote
Old 09-07-04, 04:23 AM   #3
satimis
Registered User
 
Join Date: Sep 2004
Posts: 10
Default 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
satimis is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:45 AM.


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