LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Success Stories (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/)
-   -   Knoppix Live CD + DD command to the rescue... (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/knoppix-live-cd-dd-command-to-the-rescue-4175421722/)

ghoultek 08-12-2012 01:12 PM

Knoppix Live CD + DD command to the rescue...
 
So I recently moved to a new apartment. I'm unpacked and everything seems to be OK. Suddenly my PC would not boot into Win 7. I tried the Win 7 install DVD and that didn't help either. I had Win XP Pro on another HD and Ubuntu v11.04 on yet another. I tried loading Win XP and it took 2.5 hours to get to the login screen. Uh-oh it might a HD problem. Oh noes!!!

I rebooted and loaded Ubuntu with no problem. However, Ubuntu stated it wanted to check my HDs, which I let it do. It said there was trouble with one of my drives. Oh noes!!!

I was able to download and run a Seagate diag. tool which confirmed that my Win 7 HD had bad sectors. The same diag. tool helped me remedy the problem temporarily but suggested that I get the drive replaced. I got the drive replaced but what about my Win 7 install, my games, my customizations, my data, and my wife's work etc. I don't have Symantec Ghost. Oh noes!!!

Knoppix Live CD to the rescue!!!

I did a Google search on the Linux DD command and found out the correct parameter syntax to use. I popped in a Knoppix 6.x Live CD and used the DD command to copy the partitions from the old drive to the new drive. It took a little more than 2 hours (big HD), but I could boot Win 7 on the new drive immediately. Woot!... cheers... and beers all around... my treat... cookies and milk for the youngsters.

I didn't use the Ubuntu install because I wanted to have only the bad HD and the new HD (and DVD drive) connected to the PC when I performed the copy. This prevents the accidental destruction of drive partitions on the wrong drive.

There might have been many more goodies/tools on the Knoppix Live CD but DD was sufficient.

rootaccess 09-09-2012 05:18 AM

Well. What was the exact 'dd' command you used??

jefro 09-09-2012 11:55 AM

There are a lot of good cd/dvd's out now. At one time Knoppix was the king of live cd's.

Windows 7 has a great backup. Use it.

ghoultek 09-10-2012 02:08 AM

I don't remember the exact parameters at this time. However, a quick google search will provide sites with plenty of examples. I just did a search and one of the links on the first page of the result is:
http://www.backuphowto.info/linux-ba...-disk-clone-dd

It has several example of how to use the dd commmand. The command this most likely the closest to what I used would be:
"dd if=/dev/sda1 of=/dev/sdb1"

onebuck 09-10-2012 06:49 AM

Member Response
 
Hi,

On LQ: Learn The dd Command Revised

Is very resourceful!

rootaccess 09-10-2012 01:12 PM

Im familiar with using dd, I just wanted to know what the exact parameters were that he used.
If it was just a simple "dd if=/dev/sda1 of=/dev/sdb1" then that doesn't really work well because of a few reasons. First of all, dd copies the entire partition in its most RAW format. Meaning it copies literally everything from the disk. If you did that from a linux partition to another partition, you would probably notice some errors because you are copying the proc and sys folders and a few other devices if I remember correctly. Dont know about windows there.

The second reason this isn't good either is because it renders the remaining destination drive space useless after what you copied. Look at your new hard drive space now. Is it the size of what it says on the disk/box or the size of your wife's original HD partition? Lets say your wife's partition was 20GB and your new drive was 80GB. If you did a simple 'dd' command like above, you would notice that your new drive doesn't have 80GB anymore. It says 80GB but the filesystem only shows 20GB. Thats because you made a raw copy. The way around this is to use resize2fs..you have to have fsck before you use resize2fs.

Here is a link to help you out
http://crashrecovery.org/CrashRecove...resize2fs.html

Post back the results of your new hard drive space. I am betting it is not what you thought.

ghoultek 09-10-2012 05:28 PM

The duplicated Win7 installation and partitions worked fine after using DD. The size of the partitions and free space was the correct. However, due to my wife no longer needing some programs for work, I wanted to repartition the drive, and replace MS Virtual PC with Virtual Box, several days later I did a clean install of Win 7 and created new partitions.


All times are GMT -5. The time now is 07:24 AM.