× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

how to clone a compromised disk with ddrescue

fearless_fool
Aspirant

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:


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
Top Contributors
Discussion stats
  • 0 replies
  • 4464 views
  • 0 kudos
  • 1 in conversation
Announcements