How to clone an XP hard disk with Slacko? .. SOLVED

Using applications, configuring, problems
Message
Author
User avatar
wimpy
Posts: 406
Joined: Wed 22 Aug 2012, 10:30
Location: Essex, UK

How to clone an XP hard disk with Slacko? .. SOLVED

#1 Post by wimpy »

I'm not sure if this is the correct area to raise this topic. I'm trying to clone my wife's Dell computer's HD (running windows XP). I got it working again when it refused to boot Windows XP with a registry error, using Slacko 5.5. Since the HD could well be flaky, I installed a second new HD (slightly larger) with the intention of doing a full clone. Dell, in their wisdom, have formatted their disk with 3 partitions (Win32,NTFS and Win98.). Slacko sees these as sda1,sda2,sda3. Parted can see the new disk as sdb1 but I can't get it to mount unless I create a partition. I would like to use dd to do a bit-to-bit copy..
Any help or suggestions would be appreciated
Last edited by wimpy on Wed 30 Apr 2014, 12:08, edited 1 time in total.

User avatar
nilsonmorales
Posts: 972
Joined: Fri 15 Apr 2011, 14:39
Location: El Salvador

start with gnost

#2 Post by nilsonmorales »


Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#3 Post by Sylvander »

If you suspect there may be faulty regions on the source HDD....

I suggest you use ddrescue to do the cloning. :D
See this thread of mine on my pleasantly successful 1st use of ddrescue to clone a faulty source HDD to a new HDD.

You could use the commands I used as guidance, but...
You'd need to figure out how to alter them [if necessary] to suit your own setup.

I suggest you read the manual and tutorial which are linked in the 5th post [present bottom of the page].

Bligh
Posts: 480
Joined: Sun 08 Jan 2006, 11:05
Location: California

#4 Post by Bligh »

Clonezilla has worked well for cloning win partitions and hard disks. I like to keep a separate data partition or disk.
Cheers

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#5 Post by Flash »

It's odd that Slacko sees the second hdd as sdb1 but can't mount it. As far as I know, Linux can't see unformatted media, which means the disk must already be formatted, which means it's probably all one NTFS or FAT32 partition, which means that Slacko should be able to mount it. Is the hard disk new or used?

User avatar
wimpy
Posts: 406
Joined: Wed 22 Aug 2012, 10:30
Location: Essex, UK

#6 Post by wimpy »

Flash wrote:It's odd that Slacko sees the second hdd as sdb1 but can't mount it. As far as I know, Linux can't see unformatted media, which means the disk must already be formatted, which means it's probably all one NTFS or FAT32 partition, which means that Slacko should be able to mount it. Is the hard disk new or used?
Yes, I was surprised at this. It's a brand new SATA disk. I'm pretty sure it is not formatted. Windows can see it but will not format it until I've created a partition. Since the source disk contains 3 partitions (with 3 different formats) I'm unsure how to proceed. I'll be looking at some of the other suggestions as well which look quite good.-
@Sylvander I'm not sure if there are any duff sections on the HD. After restoring the Windows registry hives, Winxp proceeded to do a chkdsk (which rather put the frights in me) but I decided it was safer to let it do it rather than pull the plug. After it had found and corrected a lot of orphan files, it booted OK and has been running fine since
@bligh I'll certainly have a look at Clonezilla
@nilsmorales That thread looks fine but I think it's above my league at the moment. I'm still learning .
LxXenial16.08, LxPupSc17.07.01,Lucid 5.2.8 and others - all frugal

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#7 Post by Sylvander »

1.
wimpy wrote:@Sylvander...Winxp proceeded to do a chkdsk (which rather put the frights in me) but I decided it was safer to let it do it rather than pull the plug. After it had found and corrected a lot of orphan files, it booted OK and has been running fine since.
a. This is as I'd expect.
My non-expert understanding is as follows:
If you were ever to "improper power-off" whilst windows was running...
It's quite likely that the Windows "partition-file-system" [PFS] would be corrupted as a result.
This might result in this-or-that type of nasty.
e.g. Orphan files or folders.
So it is NECESSARY at next boot of Windows [or prior to that] to scan&fix the PFS.
Windows would automatically scan during the next boot.
However...
In the past, when I used Windows ...
I would [use something other than the possibly/probably corrupted Windows to] manually scan&fix the PFS [FAT32 in my case] prior to any attempt to boot Windows.
I've done this quite often and successfully.
[I did this because (in my opinion) it isn't a good idea to attempt to use a possibly corrupted Windows to fix itself]
[e.g. A mentally ill doctor aught not to attempt to fix his own mental illness]
But wouldn't leave it at that if there were orhan files.
See b below.

b. Those "orphan files" [or parts of files] have not been "corrected"...
They have been identified and separated out and saved.
I've never managed to re-integrate them; I normally just deleted them.
The orphans are no longer connected as they aught to be, so the files [orphans, or fragments of those are orphaned] are now failing to do their job.
Hence, your presently-in-use Windows has suffered an irreversible corruption.
Cross your fingers and hope that Windows can still function effectively/normally without those.
What I'd normally do under such circumstances, is to restore an image backup, made prior to the introduction of this corruption, when all was uncorrupted and functioning well [normally, and/or to my satisfaction].
You might instead decide to use a "Restore Point", but I would choose not to do that [never use a corrupted Windows to attempt to fix itself].

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#8 Post by jafadmin »

Puppy isn't going to mount a disk without a partition. That would be silly. Why mount something that doesn't exist? In this instance you don't want to mount the drive anyway, you just want to clone to it.

the following command should suffice:

dd bs=4096k if=/dev/sda of=/dev/sdb conv=notrunc

This assumes the disk you want to clone is "sda" and is unmounted, and the new drive is "sdb".

Now, for extra grade points, after cloning the drive, resize the main OS partition with gparted to take advantage of all that new space 8)

User avatar
wimpy
Posts: 406
Joined: Wed 22 Aug 2012, 10:30
Location: Essex, UK

#9 Post by wimpy »

So far, in Slacko, only parted sees the disk as sdb. On the desktop there are only sda1, sda2,and sda3. There is of course the question of the MBR. Is there any way I can be sure that dd is going to write to the new disk? Actually the 2 disks are not very different in size - the new one being a bit bigger. After, 8 years, her used space is about 20% of the available space.
LxXenial16.08, LxPupSc17.07.01,Lucid 5.2.8 and others - all frugal

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#10 Post by musher0 »

Thanks, guys, for the very useful information.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#11 Post by Sylvander »

wimpy wrote:On the desktop there are only sda1, sda2,and sda3. There is of course the question of the MBR. Is there any way I can be sure that dd is going to write to the new disk?
1. Going from memory...
If I remember right...
When using ddrescue:
a. You don't mount the partition-file-systems on the source drive [and there are, as yet, none on the destination drive to mount].

b. Since the destination drive initially has nothing on it [i.e. no partitioning, no formatting, no MBR, no partition file systems]...
Initially there is nothing seen of it on the Puppy desktop.
BUT...

c. Once ddrescue has cloned at least the partitioning and their formatting and partition file systems...
Then the "drives" [actually the cloned partition file systems] appear as if by magic on the desktop.
.
.
Last edited by Sylvander on Tue 04 Jun 2013, 21:58, edited 2 times in total.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#12 Post by Flash »

Wimpy, that's a good question. If you format the new disk with Gparted so that Puppy can see it, Puppy will give it a name. If you then use dd, it might completely change the formatting since it might overwrite that part of the disk with the information from the old disk. That would be fine. The question is whether dd will write to the new disk if you use the name Puppy gives it, or will it make up its own names and wind up writing to the old disk. At least, I think that's your question, and I don't know the answer.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#13 Post by jafadmin »

if gparted sees the new drive you're good to go. YOU DON'T WANT THE NEW DRIVE MOUNTED TO DO THIS.

dd will clone the mbr, fats, partitions, flags, formatting, and all the data to the new drive.

Just run the command I listed above, and it should work.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#14 Post by Flash »

Jafadmin, do you mean he should use Gparted to find out what name to use for the new drive in the dd command?

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#15 Post by 01micko »

jafadmin's first post
jafadmin wrote:if gparted sees the new drive you're good to go. YOU DON'T WANT THE NEW DRIVE MOUNTED TO DO THIS.

dd will clone the mbr, fats, partitions, flags, formatting, and all the data to the new drive.

Just run the command I listed above, and it should work.
Sound advice. There is risk of further damaging the original drive, but in this case you have nothing to lose and everything to gain.

To get disk id run this:

Code: Select all

root@work-horse:~# fdisk -l|grep  -w '^Disk'
Disk /dev/sda: 500.1 GB, 500107862016 bytes
Disk identifier: 0x000bfb22
Disk /dev/sdb: 8004 MB, 8004304896 bytes
Disk identifier: 0x00036d56
EDIT: just to be clear, the command you type in console is : fdisk -l | grep -w '^Disk' , or you can just type fdisk -l and search the lines for the relevant information.

Given you know the size of each disk then you now know what command to type in based on jafadmin's first post (linked above for quick reference).

Side note: I have successfully dd'd partitons as against whole drives cloning Windows 7. In that case you need to dd the MBR as well, provided Windows is on the first partition. Since you are NOT doing this, but cloning the whole drive, everything is preserved, right down to the UUID (rfc).

I hope you learn from this that there is no substitute for tested backups!

One more piece of important information

I notice wimpy you wrote: "Parted can see the new disk as sdb1 but I can't get it to mount unless I create a partition."

I believe you misread that because it would not see sdb1 or any other number because there is no partition table on the disk. It would just see sdb. This is important because only partitions are suffixed with the number. Physical entire drives are denoted just by the letters sdX, where X is the letter assigned by the kernel either at bootup or hot plugging. (older kernels use hd). It is very important when using dd to get this right.


Good luck!
Puppy Linux Blog - contact me for access

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#16 Post by jafadmin »

Flash wrote:Jafadmin, do you mean he should use Gparted to find out what name to use for the new drive in the dd command?
yes.

to make it more clear, "if" (Input File) should point to the source device, and "of" (output File) should point to the target device.

Ideally, this would be done from a LiveCD with neither drive mounted.

User avatar
wimpy
Posts: 406
Joined: Wed 22 Aug 2012, 10:30
Location: Essex, UK

#17 Post by wimpy »

01micko wrote:I believe you misread that because it would not see sdb1 or any other number because there is no partition table on the disk. It would just see sdb. This is important because only partitions are suffixed with the number. Physical entire drives are denoted just by the letters sdX, where X is the letter assigned by the kernel either at bootup or hot plugging. (older kernels use hd). It is very important when using dd to get this right.
Yes. I'm sure you are right. I was confused by the distinction between devices (sda,say) and partitions (sda1,sda2, etc) where hard disks are concerned. All the advice here has been super and I am really grateful to everybody for the replies. Hopefully, I'll be able to mark this as "Solved" when I complete the switch.
LxXenial16.08, LxPupSc17.07.01,Lucid 5.2.8 and others - all frugal

User avatar
wimpy
Posts: 406
Joined: Wed 22 Aug 2012, 10:30
Location: Essex, UK

#18 Post by wimpy »

Just an update.
I cloned the HD using dd as advised.
The main problem in puppy was that the windows partition was ntfs, and gparted would only mount it as readonly (advising me to run chkdsk in Windows). Since Windows was out (problem with the hives) I downloaded Hirens bootcd from the net. This contained a program ntfsdos which had an option to run chkdsk. I did this on the cloned HD and it found and corrected a large number of errors. I then rebooted - it went into Windows which now offered a chkdsk. I let it carry on - the cloned disk was new so should be OK. It found a huge number of errors and orphan files. I had a copy of the hives from a previous problem and using puppy gparted mounted the ntfs disk in puppy. I substituted the backup hives and rebooted into Windows OK. My wife is pleased that she's got her PC back.
My thanks to all who helped. I'll mark this as saved.
LxXenial16.08, LxPupSc17.07.01,Lucid 5.2.8 and others - all frugal

gcmartin

#19 Post by gcmartin »

Hello @Wimpy

Forgive me for asking, but, why was GParted needed for a new disk that you had "dd"?

I do understand the need for the hive, but, am failing to see the need for GParted for the Windows resurrection you were working toward on a new HDD.

Thanks in advance for the understanding you provide

cthisbear
Posts: 4422
Joined: Sun 29 Jan 2006, 22:07
Location: Sydney Australia

#20 Post by cthisbear »

I copy everything in Puppy...just through Rox file manager....

usually just works in XP.

If I went from IDE to sata I would just setup the drive
and only copy 1% of the XP files.

I reboot Puppy....delete all those 1% of new XP files...

and just copy the old files straight over.

My computer shop...
near where I used to live had a Toshiba laptop with an iffy drive...

he had cloned the drive....tried cloning it back to the new drive....

and it kept failing to hit the desktop.

I did my usual 1% install as above.

Copied all the files back as stated.

Bingo. No more problems.

He had never seen it done that way.

:::

Just to be clearer.

I just let the XP cd setup the files >> 1%...
and then cancel the copy.

I reboot with Puppy and then >> delete all the newer Windows files....
such as

Documents and Settings

Program Files

RECYCLER

System Volume Information

AUTOEXEC.bat
boot.ini

hiberfil.sys ( if it is there )

IO.SYS
ntldr
NTDETECT.com
ntldr
pagefile.sys

and I then copy the old install straight across.

I then usually boot first time into Safe mode
Hit F8 etc >> for that menu.

Chris.

Post Reply