Author Topic: How to clone your LinuxMCE 7.10 drive--step by step  (Read 3332 times)

sedgington

  • Veteran
  • ***
  • Posts: 82
    • View Profile
How to clone your LinuxMCE 7.10 drive--step by step
« on: July 21, 2010, 02:29:46 pm »
For many linux users this will be trivial, but I had enough problems that I thought I would show one way to do it that worked for me.
My original drive was 80gb and perhaps through all the experimentation I had done with it and despite the fact that I had tons of other drives to store data, it kept giving me the "you are nearly out of disk space" message. This was an old IDE drive that I had used originally to test the idea of LinuxMCE and once I got it working I had added things like doorbells that ring asterisk and hylafax, so doing a simple reinstall would have forced me to retrace a lot of old (and partially forgotten) steps.
Grabbing a new 500 gb SATA drive I partitioned it according to this tutorial: http://wiki.linuxmce.org/index.php/DVD_Install_And_Custom_Partitions

Please note that in my case, the padding in the dd command seems to have expanded what is written to the new drive as a percentage of what was used on the old drive, so you may want to make the new drive partition only slightly larger than the original and then once everything is copied, reboot into gparted, expand the new partition and then add the extended partition as outlined. This is what I had to do.

However, instead of doing this manually, I used g-parted live CD which gave me a graphical interface and just set it up as suggested: http://gparted.sourceforge.net/livecd.php

The reason I partitioned it this way in advance was that my IDE drive had bad sectors that I could not seem to fix and also a major superblock error which prevented me from just cloning the drive to the SATA drive and getting it to work--the superblock error would show up in the new drive as well.

After setting up the new SATA drive as described in the tutorial, I opened a terminal in g-parted live and used the dd command to copy the original drive to the SATA drive.

The command I used was dd if=/dev/hda1 of=/dev/sda1 bs=32256 conv=noerror,sync

dd= data dump, the linux command that reads the binary file from the input and writes it to the output

if= input file, your original drive which you are copying from. You can easily see it in g-parted. I decided to copy only the first partition because it had all that I needed to get a new drive running and the drive had a lot of problems as outlined above

of= output file, the drive you are copying to-also easily determined in g parted. I copied only to sda1 because of the errors mentioned above. So this was a partition to partition copy instead of a whole drive to whole drive copy.

bs= block size, in this case it is 63 sectors each with 512 bytes in each transfer--this is supposed to be optimum, but you can research it if you want to try something else.
conv=noerror,sync converts the sectors without stopping when it finds errors. The sync pads the sector where the errors are so that the clone will be the same size as the original. As state above, because the original drive had errors I had to use this

Once everything is set up, you hit enter and the terminal command begins to run. When it finds an error, it will print it out in terms of input and output and number of bytes written. Be careful, because the program is not through at this point, and there is really no feedback about how long it will take other than a suggestion of how long it took to write the first transfer before finding an error. Wait until you have a new command prompt and the info above it tells you that it wrote the original used capacity of the drive and the process completed before doing anything else. In my case 70 gb took about 70 minutes.

Once this is done, exit g-parted and pull the power to your original drive keeping the new drive connected. Now you must install grub on the new drive so that it will boot properly. In my case, I used the kubuntu 7.10 live cd to do this: http://old-releases.ubuntu.com/releases/kubuntu/7.10/

I booted into the live cd and then followed the instructions for installing grub found here:http://www.arsgeek.com/2008/01/22/how-to-clone-your-bootable-ubuntu-install-to-another-drive/

For some reason, when I went into terminal and got a grub prompt and typed in the find /boot/grub/stage1 what was returned (hd0,0) would not work in the following steps unless I copied and pasted it from the terminal into the command. It kept giving me an error -11.

Once I completed the steps for installing grub outlined in the arsgeek article, I rebooted into the new SATA drive, it found grub, gave me a few errors and then ran. So far, the only thing I have found that LinuxMCE does not recognize the users in the telecom voicemail. The doorbell, phones, and hylafax all seem to work fine. I think running through the setup wizard again should be able to fix this telecom problem.

Hope this helps. If someone has a better method, please let us all know.
« Last Edit: July 21, 2010, 02:48:20 pm by sedgington »

wierdbeard65

  • Guru
  • ****
  • Posts: 449
    • View Profile
    • My Quest
Re: How to clone your LinuxMCE 7.10 drive--step by step
« Reply #1 on: July 21, 2010, 05:22:20 pm »
Thanks for sharing this :)

My only "criticism" is that howto's and similar useful information really needs to be on the wiki, rather than as forum posts. Any chance you could upload it there too?
Paul
If you have the time to help, please see where I have got to at: http://wiki.linuxmce.org/index.php/User:Wierdbeard65

valent

  • Guru
  • ****
  • Posts: 381
    • View Profile
    • /kernel_reloaded/
Re: How to clone your LinuxMCE 7.10 drive--step by step
« Reply #2 on: July 26, 2010, 09:29:38 pm »
jup, great post, please transfer it to the Wiki.
LinuxMCE - If it was easy, everybody would be doing it!!
My setup - http://wiki.linuxmce.org/index.php/User:Valent