Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
how to clone a compromised disk with ddrescue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2014-03-05
10:35 AM
2014-03-05
10:35 AM
how to clone a compromised disk with ddrescue
I've been working with Netgear support on resurrecting my ReadyNAS NV (won't boot due to some bad sectors). This note focuses on one aspect of my journey: how to clone (aka "make an image copy of") a compromised disk that is going bad.
If the "pending sectors" in a disk's SMART report is climbing, it means the disk is headed for trouble. If you're able to pull it out and replace it with a new one, letting the ReadyNAS rebuild it, you're in luck. But if your ReadyNAS won't boot at all (perhaps because two drives are in trouble), read on...
I was advised by Netgear support to clone one of the disks in my ReadyNAS that was marginal. (A second one had already died.)
I'm running Mac OS X 10.8.5 (mountain lion), and didn't have ready access to a PC or Linux system. But this recipe should apply to other systems as well (notably Linux). Here's what I did:
From this, you can see that /dev/disk2 is the 1TB disk removed from the ReadyNAS and /dev/disk1 is the new 2TB disk. The ddrescue program is really great in that it writes a log file, allowing you to quit and later restart the rescue process. (You can do a bunch of other tricks with it; refer to the docs for more info on that.)
I invoked it as follows:
The bad news: At the average rate of 3966 kB/s, copying one terabyte takes 3.13 days. (Hint: try a google search for '1 terabyte / (3966 kilobytes/second)') -- as of this writing, I'm less than a third of the way through the process. This is one reason that ddrescue is great: if the process is interrupted (e.g. I need to take my laptop somewhere else), I can restart the process later. [If you have a computer and a docking station that supports Raid3, it will go much faster!]
If the "pending sectors" in a disk's SMART report is climbing, it means the disk is headed for trouble. If you're able to pull it out and replace it with a new one, letting the ReadyNAS rebuild it, you're in luck. But if your ReadyNAS won't boot at all (perhaps because two drives are in trouble), read on...
I was advised by Netgear support to clone one of the disks in my ReadyNAS that was marginal. (A second one had already died.)
I'm running Mac OS X 10.8.5 (mountain lion), and didn't have ready access to a PC or Linux system. But this recipe should apply to other systems as well (notably Linux). Here's what I did:
- read up on ddrescue on http://www.gnu.org/software/ddrescue/ddrescue.html
- found a mac-specific version at http://tinyapps.org/blog/mac/2008082207 ... _os_x.html
- downloaded http://tinyapps.org/downloads/ddrescue_1.17.zip and unzipped it into ~/bin
- purchased a SIIG Dual SATA to USB 2.0 Docking station (about $30 at Fry's electronics)
- removed the faulty drive from the ReadyNAS and inserted in docking station slot A
- inserted a fresh drive in docking station slot B
- plugged in docking station, opened a terminal window
- as root, ran `diskutil list` to find out which disk was which
bash-3.2# diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.1 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS MacBookHD 499.2 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: *2.0 TB disk1
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *1.0 TB disk2
1: Linux 2.1 GB disk2s1
2: Linux_Swap 262.1 MB disk2s2
3: Linux_LVM 247.7 GB disk2s5
4: Linux_LVM 749.9 GB disk2s6
From this, you can see that /dev/disk2 is the 1TB disk removed from the ReadyNAS and /dev/disk1 is the new 2TB disk. The ddrescue program is really great in that it writes a log file, allowing you to quit and later restart the rescue process. (You can do a bunch of other tricks with it; refer to the docs for more info on that.)
I invoked it as follows:
bash-3.2# ~/bin/ddrescue_1.17 --force /dev/disk2 /dev/disk1 ~/ddrescue_samsung_seagate_3.log
GNU ddrescue 1.17
Press Ctrl-C to interrupt
rescued: 284368 MB, errsize: 65536 B, current rate: 4063 kB/s
ipos: 284368 MB, errors: 1, average rate: 3966 kB/s
opos: 284368 MB, time since last successful read: 0 s
Copying non-tried blocks...
The bad news: At the average rate of 3966 kB/s, copying one terabyte takes 3.13 days. (Hint: try a google search for '1 terabyte / (3966 kilobytes/second)') -- as of this writing, I'm less than a third of the way through the process. This is one reason that ddrescue is great: if the process is interrupted (e.g. I need to take my laptop somewhere else), I can restart the process later. [If you have a computer and a docking station that supports Raid3, it will go much faster!]
Message 1 of 1
Labels: