LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-15-2008, 10:24 PM   #1
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Raspbian, Ubuntu, Chrome/Crouton
Posts: 374

Rep: Reputation: 50
Advice wanted on moving dying Windows XP box to dual boot


Sorry for the lengthy prose, but bear with me.

I have an older 1.2 GHz HP Pavilion 750n with Windows XP SP and one 70GB ATA disk. The disk is going bad, I think. There is some place on the drive, I do not know where exactly, that when read, causes the system to spontaneously reboot. Occasionally when I save a file, which just happens to use this location, my backups start to fail with reboots. By deleting the suspect file I am back in business. Running the pitiful XP diagnostics does not seem to locate or help the problem. Time to get a new disk (unless someone can suggest an alternative).

The problem is this system does not come with an XP install disk. Instead, you are expected to recover from an image in a reserved disk partition. So buying a new disk does me no good unless I can copy the original bit for bit (partition by partition) to the new drive.

I have been wanting to go dual boot with his box for sometime. So I was thinking of getting 2 new disks. One to copy my XP bit for bit to. The other to install Fedora 9 onto for the dual boot. I'd have the fedora disk as the master and the XP as the slave. Grub would allow me to boot to either.

I am look for advice or pointers to recipes to do this.

I was thinking of installing the new XP disk as a slave. Then using the fedora live DVD to boot to fedora and then use something like gparted (never used it actually) to do the bit-for-bit, partition for partition copy of XP. Then I would replace the original XP disk with the new blank fedora disk in the master slot. I would then install fedora on the blank disk, expecting that it would see the new XP disk, and configure grub to allow booting from either.

Any advice, tips or gotchas on this are welcome.

Phil
 
Old 09-16-2008, 12:31 AM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Any good hard drive cloning software (like Norton Ghost) should be able to clone an exact copy of your old disk to the new one. If there are bad sectors on your drive, it seems like they are not being marked as such. The inbuilt tools in winblows are pathetic, I use Paragon Hard Disk Manager to perform drive maintainence. There plenty of other good hard disk managers (even freeware) that are miles better than what winblows provides.
 
Old 09-16-2008, 12:45 AM   #3
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,939

Rep: Reputation: 129Reputation: 129
You can clone your XP parition, and then copy it to the new drive.
Here are two links to help you ... if still confused, post back and
I'll help more. I cloned a Vista partition to test another version
of the software yesterday. What I did was mount a 40G USB drive,
then clone Vista with dcfldd (a version of dd), using this command:
Code:
dcfldd if=/dev/sda1 of=/dev/sdb1 conv=notrunc,noerror
If you do that, substituting the appropriated devices, then you
will have a duplicate of your Win XP system that you can then
copy to your new hard drive. It will boot, and you will not
have lost anything from it.

Read those articles ... dd is better than Ghost, and free.

How To Do Eveything With DD

Using a Linux Live CD to clone XP

Last edited by Bruce Hill; 09-16-2008 at 12:47 AM.
 
Old 09-18-2008, 06:32 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,581

Rep: Reputation: Disabled
This http://www.heise.de/software/downloa...streamer/39047 is home to software to create a fully functional installation disk from your existing XP. You'll have to know german, though.
 
Old 11-04-2008, 10:12 PM   #5
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Raspbian, Ubuntu, Chrome/Crouton
Posts: 374

Original Poster
Rep: Reputation: 50
Well I bought a couple of IDE disks. I set one up with an IDE to USB adapter. I then booted up the XP box with F9 Live CD and tried to dd copy the XP disk to the new drive using the full disk copy:

Code:
dd if=/dev/sda of=/dev/sdb bs=32256
Something is really wrong with this box. Despite several tries the system froze in the middle of the dd copy. I rebooted each time and got the same result. I tried booting with XP and doing a chkdsk with all the repair options, but it says the disk is OK.

Not sure where to from here. Any ideas?
 
Old 11-05-2008, 02:57 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,581

Rep: Reputation: Disabled
You can do that only when the geometry and size of the disks is identical, else you'll copy the wrong partition information to the target.

Why "bs=32256"?

Do you know this (dd-HowTo):

http://www.linuxquestions.org/questi...ommand-362506/

Last edited by JZL240I-U; 11-05-2008 at 03:01 AM.
 
Old 11-05-2008, 12:20 PM   #7
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Raspbian, Ubuntu, Chrome/Crouton
Posts: 374

Original Poster
Rep: Reputation: 50
Quote:
Originally Posted by JZL240I-U View Post
You can do that only when the geometry and size of the disks is identical, else you'll copy the wrong partition information to the target.

Why "bs=32256"?
I got that from the link mentioned in Using a Linux Live CD to clone XP
mentioned by Bruce Hill.

Quote:
Originally Posted by JZL240I-U View Post
I did try several dd incantations. I understood that dd would duplicate the source partitions on the destination device if it was not partitioned, which it did, but the dd stopped (the system locked up actually) in the middle of copying the second partition.

Dropping the bs=32256 caused dd to stop (without lock up) when an error occurred. The system log file had the following errors:

Code:
Nov  4 16:33:06 localhost kernel: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
Nov  4 16:33:06 localhost kernel: ata1.00: BMDMA stat 0x25
Nov  4 16:33:06 localhost kernel: ata1.00: cmd c8/00:08:e0:76:52/00:00:00:00:00/e1 tag 0 dma 4096 in
Nov  4 16:33:06 localhost kernel:          res 51/40:03:e5:76:52/00:00:00:00:00/e1 Emask 0x9 (media error)
Nov  4 16:33:06 localhost kernel: ata1.00: status: { DRDY ERR }
Nov  4 16:33:06 localhost kernel: ata1.00: error: { UNC }
Nov  4 16:33:06 localhost kernel: ata1.00: configured for UDMA/100
Nov  4 16:33:06 localhost kernel: sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE,SUGGEST_OK
Nov  4 16:33:06 localhost kernel: sd 0:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor]
Nov  4 16:33:06 localhost kernel: Descriptor sense data with sense descriptors (in hex):
Nov  4 16:33:06 localhost kernel:         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 
Nov  4 16:33:06 localhost kernel:         01 52 76 e5 
Nov  4 16:33:06 localhost kernel: sd 0:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed
Nov  4 16:33:06 localhost kernel: end_request: I/O error, dev sda, sector 22181605
Nov  4 16:33:06 localhost kernel: printk: 2 messages suppressed.
Nov  4 16:33:06 localhost kernel: Buffer I/O error on device sda2, logical block 1551760
Nov  4 16:33:06 localhost kernel: ata1: EH complete

I have now downloaded the diagnostics tool for the Samsung SV8004H disk that was OEM'ed into the Pavilion 750n. This tool runs in DOS mode from a DOS boot floppy. The surface scan reports one LBA error and then somewhat later into the scan it locks up! I try it again and this time I get two sequential LBA errors, the first in the same place, but the scan completes and reports two unrecoverable errors.

Is there a way to have dd skip the bad LBA when doing the copy? I suspect they are in the free space as the disk is only 20% full. I just want copy/rescue this XP partition.
 
Old 11-05-2008, 01:51 PM   #8
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Raspbian, Ubuntu, Chrome/Crouton
Posts: 374

Original Poster
Rep: Reputation: 50
The previous dd's created two partitions on the new disk, and successfully copied the first smaller partition (sda1). So I have been trying to just copy the remaining much larger sda2 at this point.

I just tried:

Code:
dd if=/dev/sda2 of=/dev/sdb2 conv=notrunc,noerror
I dropped the bs option as the large bs values seem to aggravate the lock ups. I added the noerror option to see if it would skip the error.

No luck. I did get dd to report an error that 6GB was copied, so many blocks read and written. Then the system locked up.

Would anyone think that moving this disc to a slave position or off the the IDE-to-USB adapter might stop the lock ups and let me complete the copy?
 
Old 11-05-2008, 02:57 PM   #9
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Your symptoms sure do sound like a failing disk.

The best tool for the job you are facing (and I do mean the BEST tool) is spinrite. This is not a free utility, IIRC it is $89. However it will recover your old drive, perhaps indefinitely but more likely for long enough, and you will be able to then use dd to make your clone copy.

Moving the drive to another point on the cable is a waste of time.
 
Old 11-05-2008, 03:05 PM   #10
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Quote:
Originally Posted by jiml8 View Post
The best tool for the job you are facing (and I do mean the BEST tool) is spinrite.
Agreed. It's well worth paying for.
 
Old 11-06-2008, 01:01 AM   #11
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,581

Rep: Reputation: Disabled
There is also for free

http://www.garloff.de/kurt/linux/ddrescue/
http://www.kalysto.org/utilities/dd_rhelp/index.en.html
http://www.gnu.org/software/ddrescue/ddrescue.html

I have no experience with spinrite which may well be more appropriate for your problem.
 
Old 11-06-2008, 09:14 AM   #12
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by JZL240I-U View Post
There is also for free

http://www.garloff.de/kurt/linux/ddrescue/
http://www.kalysto.org/utilities/dd_rhelp/index.en.html
http://www.gnu.org/software/ddrescue/ddrescue.html

I have no experience with spinrite which may well be more appropriate for your problem.
None of these tools do what spinrite does. I don't know of anything else available that does do what spinrite does. These other tools will rescue data from a corrupted disk, but won't help with a disk that is in the process of failing.

Spinrite will adjust head position back and forth on the track, will vary the R/W head currents, and will try over and over to read the bad sector as it does this, collecting statistics on what it reads and doing a statistical analysis to attempt recovery of data on the bad block.

I have seen it succeed many times to recover content on a drive that other products wouldn't touch. It often manages to restore the functionality of the bad block too. It really is an incredible product. ddrescue and other products based on dd just are not in the same league at all.
 
Old 11-06-2008, 10:36 AM   #13
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,581

Rep: Reputation: Disabled
Hi, jiml8

Quote:
Originally Posted by pwalden View Post
...Is there a way to have dd skip the bad LBA when doing the copy? I suspect they are in the free space as the disk is only 20% full. I just want copy/rescue this XP partition.
That's why I suggested dd_rescue.

What you describe of spinrite sure sounds impressive. I'll keep that in mind.
 
Old 11-07-2008, 02:47 PM   #14
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Raspbian, Ubuntu, Chrome/Crouton
Posts: 374

Original Poster
Rep: Reputation: 50
Thank you all for the advice. Here is what I did.
  1. I did not try to rescue the data on the current disk. Thanks for the advice on this. I'll keep this in my pocket for future emergencies. Instead, as dd did copy the first partition rescue image onto the new disk and since I kept all my application install disks and also use NASBackup religously, I went for a fresh rebuild.
  2. I swapped the new disk in and invoked the HP Pavilion rescue restore to rebuild the XP instance from the rescue partition into the second partition. As an added bonus, the rescue logic rebuilt the instance using all of the disk, so I got 150GB, instead of the original 60GB. I then restored from my backups and reinstalled the applications I still wanted. The downside was that I had to remove all the junk that the original came with (ie AOL instant start, adware, etc).
  3. I then moved the Windows disk to the slave position and put the second new disk in the primary position.
  4. I then installed F9 from the install CD disks onto this new primary.
  5. F9 booted up right away. I then edited the grub.conf. The Windows boot was already listed under Other (thank you Fedora installer), but I had to add
    Code:
    map (hd0) (hd1)
    map (hd1) (hd0)
    lines to get the Windows boot to work.
  6. Finally, I ran into the clock discrepencies. Linux set the ayatem clock to UTC, Windows likes it on local time. I found that adding a RealTimeIsUnversal=1 entry to the TimeZoneInformation registry key fixed this problem.

Everything is booting up fine right now, although I have not played too much with either installation yet. So I may run across other problems, but I am happy now. I have my original Windows environment working on a good disk and I can dual boot to Linux.
 
Old 11-10-2008, 02:10 AM   #15
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,581

Rep: Reputation: Disabled
Reasonable.

You might want to put the broken disk on the second IDE channel and read it from your linux installation (without the hassle of an entire system stalled). When you get a read error you'll have the name of the file and can get around that one -- if it is of any interest for you anymore...
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need advice on turning existing Linux dual-boot into tri-boot with XP mojovski Linux - Newbie 7 03-14-2006 10:55 PM
Removing windows from a dual boot box kkempter Linux - General 7 08-19-2005 11:08 AM
Questions about dual boot. My Windows XP box is collecting dust! kersten78 Linux - General 7 11-05-2004 08:14 PM
Advice (and some) Needed: Dual-HDD, Dual-Boot - Linux, WinXP elnomadkvn Linux - General 1 03-28-2004 10:11 AM
Re-installation coaching wanted (for dual boot scenario) lhoff Linux - Hardware 1 01-14-2003 05:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:15 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
Open Source Consulting | Domain Registration