LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices



Reply
 
Search this Thread
Old 08-12-2012, 02:12 PM   #1
ghoultek
Member
 
Registered: Sep 2011
Location: New York City
Distribution: Testing Ubuntu/XUbuntu/KUbuntu 12.04, Mint 13 (all flavors)
Posts: 56

Rep: Reputation: 2
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.
 
Old 09-09-2012, 06:18 AM   #2
rootaccess
Member
 
Registered: Mar 2012
Posts: 211

Rep: Reputation: Disabled
Well. What was the exact 'dd' command you used??
 
Old 09-09-2012, 12:55 PM   #3
jefro
Guru
 
Registered: Mar 2008
Posts: 12,087

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
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.
 
Old 09-10-2012, 03:08 AM   #4
ghoultek
Member
 
Registered: Sep 2011
Location: New York City
Distribution: Testing Ubuntu/XUbuntu/KUbuntu 12.04, Mint 13 (all flavors)
Posts: 56

Original Poster
Rep: Reputation: 2
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"
 
Old 09-10-2012, 07:49 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,469
Blog Entries: 4

Rep: Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525
Member Response

Hi,

On LQ: Learn The dd Command Revised

Is very resourceful!
 
Old 09-10-2012, 02:12 PM   #6
rootaccess
Member
 
Registered: Mar 2012
Posts: 211

Rep: Reputation: Disabled
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.
 
Old 09-10-2012, 06:28 PM   #7
ghoultek
Member
 
Registered: Sep 2011
Location: New York City
Distribution: Testing Ubuntu/XUbuntu/KUbuntu 12.04, Mint 13 (all flavors)
Posts: 56

Original Poster
Rep: Reputation: 2
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
data rescue from Knoppix nnjond Linux - Newbie 16 05-21-2008 09:00 AM
LXer: Knoppix and 'Knoppix Hacks' rescue me from borked GRUB on the $0 Laptop LXer Syndicated Linux News 0 04-25-2008 01:50 AM
Rescue my Knoppix 5.0 newbielinux_user Linux - Newbie 1 02-13-2007 10:58 AM
knoppix as a rescue disk lynnevan Linux - General 4 08-23-2006 06:48 AM
LXer: Knoppix to the rescue LXer Syndicated Linux News 0 06-03-2006 01:03 PM


All times are GMT -5. The time now is 01:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration