Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Solved Cloning Drive

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
User avatar
Soapm
Posts: 603
Joined: 2012-05-22 04:23
Has thanked: 1 time

Solved Cloning Drive

#1 Post by Soapm »

I have a old 80gb windows drive that is starting to fail the smart test so I want to clone it over to a 2TB drive before it fails.

I figure I can hook both drives to my Debian server and run the DD command... What is the dd command I would enter on the command line to have it copy boot sectors and all? Is there a better way to do this?

Also, I lost my notes but I remeber there is something I have to do to get the drives mounted. Can someone walk me through getting the drives to mount so I can run the dd command?
Last edited by Soapm on 2016-04-15 07:05, edited 1 time in total.

v&n
Posts: 624
Joined: 2015-02-04 02:57

Re: Cloning Drive

#2 Post by v&n »

Soapm wrote:Is there a better way to do this?
Use partimage or clonezilla - much faster and much smarter. dd is a terrible way to 'copy' huge partitions/disks (even if they are empty).

But if you don't want to try those things, and would rather stick with dd anyway, a typical dd command would be something like -

Code: Select all

# dd if=/dev/sda of=/dev/sdb bs=2M
..where sda is your source disk (the 80 GB one), and sdb is the destination disk. Reverse these and see how gloriously dd can destroy the disk/data :twisted: (hence the nickname - "Destroyer of Disks")
(more examples : http://www.thegeekstuff.com/2010/10/dd- ... -examples/)

Be aware that you will then need extra steps to expand the filesystem on your 2TB drive to make the rest of the space usable. So like I said first, just use a clonezilla live cd/usb and forget dd. You can find plenty of tutorials on clonezilla (including screenshots, PPTs and videos).

Oh, but also be aware that IF there are bad sectors on the source disk, clonezilla or partimage will fail with default settings. In that case, you'll need to go into 'Advanced User' mode to skip/ignore errors, or much better, use 'ddrescue' program ('gddrescue' package in debian repos) to create an image of the failing disk. It is specially designed to rescue data from failing disks, and despite the 'dd' in its name, does it very smartly and efficiently.

User avatar
Soapm
Posts: 603
Joined: 2012-05-22 04:23
Has thanked: 1 time

Re: Cloning Drive

#3 Post by Soapm »

I am giving cloneziilla a try... Looks like the drive is dying so it may be touch and go...

User avatar
Soapm
Posts: 603
Joined: 2012-05-22 04:23
Has thanked: 1 time

Re: Cloning Drive

#4 Post by Soapm »

I guess the old drive died, the most I've gotten cloned is about 30% then it flakes out. So I loaded Windows 7 fresh but I still get frequent blue screens...

I know this isn't a debian question but can someone suggest something to test the rest of the hardware?

v&n
Posts: 624
Joined: 2015-02-04 02:57

Re: Cloning Drive

#5 Post by v&n »

Soapm wrote:I know this isn't a debian question but can someone suggest something to test the rest of the hardware?
If you mean the rest of the hardware of the computer, (like the CPU, RAM, Mobo.. etc.), there are different tools to test different things, like memtest for memory (RAM). You can disconnect the dying HDD and use a live CD (like HBCD (Hiren's Boot CD) which has a bunch of such tools) to test them.

If you want to salvage any data from the hard disk, I think ddrescue (again, the one that comes with 'gddrescue' package, it is a better version of the original 'ddrescue' program) is your best bet. It simply makes large 'jumps' to skip bad parts of the disk, to complete rescuing whatever data can be rescued easily, keeps a log of these skipped parts (when run with the log file option), then retries the skipped parts later, making smaller jumps this time, keeping logs to retry later.. and so on until it hits a decisive "can't rescue anymore" state. It keeps all this rescued data in one contiguous image of the disk, leaving gaps in parts that it skipped, filling them later as the data is rescued in further attempts.

Be aware though, that due to intensive searching, failing disks are prone to die completely when such excessive search takes place. The ddrescue program is considered better only because it recovers the easily recoverable parts firsts, skipping bad areas, thus saving most that can be saved while the disk is alive.

User avatar
Soapm
Posts: 603
Joined: 2012-05-22 04:23
Has thanked: 1 time

Solved Cloning Drive

#6 Post by Soapm »

Thanks all, I ended up getting a refurbished all in one at Sams for $269 and was able to retrieve most of my stuff from the failed harddrive.

I guess the computer, like most of us, just got old and died...

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Solved Cloning Drive

#7 Post by kiyop »

Soapm wrote:I ended up getting a refurbished all in one at Sams for $269 and was able to retrieve most of my stuff from the failed harddrive.

I guess the computer, like most of us, just got old and died...
Thus you need backup.
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

Post Reply