# Cloning a drive - HD Music Server



## parasolution (Sep 23, 2006)

I've got an Onkyo Hard Disk music server. Its equipped with a 40GB drive and SUPPOSEDLY its OS is some form of Linux. Unfortunately, Onkyo's customer support will not provide any details on their system. Thus if the drive fails or if you want to upgrade the capacity, they simply want you to buy a new HD from them.

My drive is fine, but I would like to image the drive, just in case it fails. When I had a linux box, I couldn't get the drive to mount. I've installed on my PC hoping that Acronis True Image could do a sector by sector image, but it shows the drive as being empty.

Are there any other ways to clone this drive. Is DD my only option. I'm a linux newb, so I don't know the commands, but I did stay at a Holiday Inn Express. 

I did have to DD a small part of my ReplayTV drive that got corrupt.


----------



## daleg (Apr 21, 2007)

Have you tried any of the manufacture's hard drive copy utilities that comes with a new hard drive? I've had pretty good luck with Maxblast, but you have to have a maxtor hdd.


----------



## saikee (Jun 11, 2004)

I expect dd to deliver the clone image. 

dd does not care about the operating system or the content of the hard disk. It clones just the binary pattern sector by sector. It reads the source and write directly on a target effectively at a hardware level.

Your problem is to identify the operating system so that the content can be extracted as usable files by an operating system.

Even if the operating system is completely foreign you should still be able to clone it to a target disk which must be identical in size or larger. The target disk can then be used to replace the source disk. That is what I normally do with up cloning disks up to 500Gb large and with different operating systems inside and in up to 63 partitions.

Hard disk manufacturer software can also be used but they run probably at 1/20 of the speed of dd, which is flexible as it cloning block size can be freely selected.


----------



## parasolution (Sep 23, 2006)

Thanks for the responses. Here's my Linux new questions.

What command line do I use clone the drive? I used DD before, but it was only to copy a bit of the MBR to a drive that got corrupted.


----------



## gotrootdude (Feb 19, 2003)

I use PBA http://pba-vm.sourceforge.net/ along with vmware player to image linux drives.

Little warning, sometimes it swaps your partition order, this can be fixed by editing grub, or by re-imaging the drive back after restoring and restoring again.


----------



## saikee (Jun 11, 2004)

Threre is a guy called AwesomeMachine who wrote one of the best piece of howto (personal opinion) on using the dd command. It is here.

The actual command needed is dead simple as shown below.

Assuming in root console and have the source and target disks hooked up as USB hard disks identified as *sda* and *sdb* then the command needed is

```
dd if=/dev/[color=red][b]sda[/b][/color]  of=/dev/[color=blue][b]sdb[/b][/color] bs=32768
```
You must make absolutely sure the input file (if=) is the device *sda* and the output file (of=) is the *sdb* in the above. The input device is your Onkyo 40Gb disk. Reversing the order can have a dire consequence.

There is no need to prepare the new output disk and I often start with a factory sealed raw disk. In other word you don't need to format or partition it at all.

The block size parameter 32768 is from multiplying 64 sectors with 512 bytes per sector making dd cloning one complete track at a time. Omitting the bs paramter will make dd default to 512 bytes being cloned at a time and the progress will be slow. The one track size cloning is about the optimum from my experience.

If you use the current version of Live CD from the Slax or Knoppix families the cloning rate would be reported. For reading from a USB source disk and writing on a USB target disk the cloning rate should be about 10Mb/s on an average PC. The process should take less than 1.5 hour for cloning the Onkyo 40Gb disk.  dd does not report anything unless the process is completed. The speed of the flickering LEDs in hard disks is the only sign indicating how busy the cloning process.


----------



## parasolution (Sep 23, 2006)

You guys are awesome. It went well, but I didn't have complete success, but I'm hopeful.

I downloaded Knoppix Live DVD (I've used Red Hat Linux before, I got to say I was very impressed with Knoppix). I uninstalled all my drives in my windows box, except for the drive that was going to be written. I removed the Onkyo HD and installed into a USB box. Booted the DVD and ran DD.

All went well and it finished writing in 30 minutes. I installed the cloned drive into the Onkyo hardware, but I received an error when starting the Onkyo server. The drive was originally a windows NTFS drive and I did not erase it. I wonder if I should have written zeros to the drive prior to cloning it?

I'll give it a try again. But I have one last question.

Since the Onkyo drive is only 40GB and the new drive is 80GB. Will the unused 40GB on the cloned drive be available. If not, how do I make the 40GBs useable. I remember when I cloned my 40GB windows laptop drive with Acronis True Image. I installed the image onto an 80GB drive, but had to use Partition Magic to reclaim the unused portion of the drive. I have a feeling the same scenario will also happen with the Onkyo drive.


----------



## saikee (Jun 11, 2004)

Yep you can use Parted Magic, Gparted or even Partition Magic to resize the existing partition to absorb the excess capacity of 80Gb over the 40Gb.

You don't need to zero the drive before cloning. I never did it myself. In the PC standard the partition table is held in the sector 0 or the first 512 bytes. Your new disk has exactly the same partition table as the old one telling the operating system all information needed in the first 40Gb. It is perfectly normal for a user to partition part of the disk with plenty of unallocated space left.

If you have a problem with the Onkyo disk plug it and its clone into external enclosures to work as external USB hard disks. Post here the output of the Linux command

```
fdisk -l
```
The above will instruct Linux to list the details of every partition in every hard disk in your PC.


----------

