Clay on 18 Jul 2015 18:01:25 -0700


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

Re: [PLUG] Cloning a dying hard drive


Hi Rich,

This could very well be a personal preference. I think it also depends on the external drive
in question. Many are preformatted for WIndows or Mac. I guess I should have included that
part.. if the drive is preformatted then I would remove the partition(s) and create a new partition
for good measure. I have not tested imaging a drive without fdisking it first. I will now just to
see what happens.

Cheers,
Clay

On 07/18/2015 08:52 PM, Rich Mingin (PLUG) wrote:
I would humbly suggest that making partitions on the new disk before using dd is not doing anything useful and adds another chance for fat fingers to kill your data.

Please tell me, in whatever detail you can, how I'm wrong, if you feel I am. Thanks!

On Sat, Jul 18, 2015 at 8:49 PM, Clay <clayw@sas.upenn.edu> wrote:
Hi Walt,

Those instructions are sane. I'm sure folks have different approaches they
would take. My approach would be..

- power down the computer
- attach the new drive
- boot to a USB Kali linux drive
- make sure the new drive is /dev/sdb by doing fdisk /dev/sdb
 if this works then 'p' to print the partitions.
 'c' to create a new partition (use 1 primary and use all space)
 'w' write changes and quit
- mkfs /dev/sdb1

I'd probably use dc3dd which is just a patched version of dd that's intended for
forensics use. It takes the same options, etc.

- dc3dd if=/dev/sda of=/dev/sdb

If there are errors then you can add the dc3dd option, conv=noerror,sync

- dc3dd if=/dev/sda of=/dev/sdb conv=noerror,sync

This will prevent dc3dd, or dd, from halting on error.

That should do it.

You could test by trying to boot from /dev/sdb and see how it goes. Of course you
can also boot as normal and make sure everything you want it on the new drive.

Hope this helps. Let me know if you have any questions.

Cheers,
Clay

On 07/18/2015 08:23 PM, Walt Mankowski wrote:
The hard drive on my home server is starting to give me errors.  I
actually got a kernel panic today while I was out because of it.  I
fsck'ed it and it seems OK for now, but that's what I thought when I
fsck'ed it a few days ago when I saw errors, too...

The machine is old and needs to be upgraded, but I'm going to need a
few days to order the parts.  As a stopgap I just stopped by
Microcenter and picked up a 1 TB HD in hopes of copying everything off
the old 1 TB drive before things get any worse.

I've done this process at least once before, it was probably like 10
years ago.  Does anyone have any thoughts on the instructions here?

https://wiki.archlinux.org/index.php/Disk_cloning#Cloning_an_entire_hard_disk

That certainly seems the simplest method, assuming the errors remain
manageable.  Other methods that might work would be

* rsync from the roots of the old partitions to the new ones
* full restore from my backups

Thanks in advance for any advice.

Walt


___________________________________________________________________________
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

-- 
Clay Wells
Information Security Engineer
School of Arts & Sciences
University of Pennsylvania

GnuPG fingerprint:
D302 C83D BCF0 6FA2 3739  7B0B 9746 9259 5D27 7C89
-- 

___________________________________________________________________________
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




___________________________________________________________________________
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

-- 
Clay Wells
Information Security Engineer
School of Arts & Sciences
University of Pennsylvania

GnuPG fingerprint:
D302 C83D BCF0 6FA2 3739  7B0B 9746 9259 5D27 7C89
-- 
___________________________________________________________________________
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