LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 05-17-2007, 01:36 AM   #1
darkscot
Member
 
Registered: Jul 2006
Location: West Yorkshire, UK
Distribution: Mandriva, Leeenux, Saluki
Posts: 103

Rep: Reputation: 21
Windows XP cloning help required!


No, I don't think I am in the wrong forum!
I have 200GB HD with Sabayon, Zenwalk and WinXP installed. Sabayon is my main distro but that partition has run out of space. The obvious solution, resize the partition, doesn't work. Neither Gparted nor Partition Magic can read the drive properly (Gparted says the whole drive is "unassigned" and PM just will not run. The problem seems to be that I have installed and uninstalled so many different distros over the years that the partition table is confused and bewildered. If I look at it in disk management in XP there are about twelve partions scattered about the disk, some only 100K.
My preferedd choice would be to format the whole drive and start again. But if I do that my family (XP users) would throw me out of the house. (They are already fed up with seeing a new Grub screen every three months). So I thought I would take this oppurtunity of adding another HD, copying XP onto that and reformatiing the exisitng drive. However, i am unsure about the best way of going about this. When I installed my current HD I used Maxblast software to clone the old HD. But I think that will only clone the whole drive and I want just the Windows partitions. Has anyone been in a similar position and can offer some advice?
Reinstalling Windows would be the very, very last resort and would cause me a lot of grief! (A LOT of grief!)
 
Old 05-17-2007, 01:42 AM   #2
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
If you are looking for open source solutions, then you should look at partimage. It is a Linux utility for saving and restoring partitions. NTFS is experimental, though. If you don't mind shelling out the cash, get a copy of Norton Ghost.
 
Old 05-17-2007, 02:01 AM   #3
milindlokde
Member
 
Registered: Apr 2007
Location: Mumbai, India
Distribution: Fedora, ubuntu
Posts: 121

Rep: Reputation: 21
Try g4l

Quote:
Originally Posted by GrueMaster
If you don't mind shelling out the cash, get a copy of Norton Ghost.
Norton Ghost is definitely very good tool for the purpose. Similar tool is now available for linux users - 'g4l - Ghost for Linux'. Ghost for Linux is free and available under GPL license and its interface is intuitive and similar to Norton Ghost.
g4l can be obtained from http://freshmeat.net/projects/g4l/
 
Old 05-17-2007, 03:13 AM   #4
darkscot
Member
 
Registered: Jul 2006
Location: West Yorkshire, UK
Distribution: Mandriva, Leeenux, Saluki
Posts: 103

Original Poster
Rep: Reputation: 21
Thanks to both of you for the advice! Ghost for Linux sounds very interesting and I will take a look at that. However, I notice that Norton offer a free trial of Ghost on their website. Don't know if that is a 'time limited' or 'feature limted' trial.
Whatever I choose I will let you know how i get on.
 
Old 05-17-2007, 03:30 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Or you could clone the entire drive with the program you have and then delete the other partitions on the new drive.

You could also use dd to copy the image of the xp partition to the new drive. Also copy the MBR and then delete the extra (unformatted) partitions with fdisk.
 
Old 05-17-2007, 04:15 AM   #6
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Little task dd eats for breakfast I would say.

I've never gone back to Norton Ghost after I entered in Linux. dd can do it better, faster and more reliably especially if you want to migrate to a bigger disk.

Just purchase a raw disk, cut off the seal, drop it into a USB external enclosure, hook it up, boot up any Live CD or simply use one of the existing distros in the hard disk and fire off one line of command in root terminal
Code:
dd if=/dev/hda of=/dev/sda bs=32768
In the above I assume you have the device hda as the input file and device sda (standard name for the first SCSI/Sata/USB disk) the output file. The 32768 byte for the block size is for one full track of 64 sectors each 512 bytes to be cloned at a time as one record. Omitting bs will cause dd to default to 512 bytes in each transfer and will be a lot slower.

For best result hook up the disk internally to get 45 to 55Mb/s transfer rate. If one of the disks has to go through the USB port the transfer rate will drop to 1/4 or 1/3.

I migrate my systems from 200Gb to 300Gb, then 400Gb and again to 500Gb disk this way. My disks have the maximum 63 partitions too and every PC system, including Vista, BSD and Solaris, will boot exactly like the original.

dd just reads the binary pattern of the input device and writes on the output device to produce a 100% mirror image. It only works if the two disks are identical in size (down to the exact number of sectors) or just larger.

The excess hard disk capacity in the cloned drive becomes unalloacted space and I use Parted Magic or Gaparted (latest version) to absorb it by resizing the partitions.

The first time you run the cloned XP it will detect the hard disk serial number has been altered and will demand an immediate reboot. After the reboot XP will work normally.

I hate seeing Linux users proposing going back to Ghost, which is a Windows based software, when a fundamental Linux terminal command "dd" can outperform the proprietary software.

My advice to the OP is to clone the whole disk, put away the original for safe keeping as a backup, use the clone straight away, delete Linux partitions or migrate them to different areas of the hard disk.

For users intending to multi-boot putting a distro in a single partition is a lot easier to maintain, to resize and to migrate. Multiple partitions installation for one Linux is for servers where the Admin has a need to play tunes with the user permissions to the different parts of the Linux.

The first link in my signature is on the subject of cloning XP and you will find I am just repeating its Section B here. Its Section A is to clone XP as one partition.

Last edited by saikee; 05-17-2007 at 04:31 AM.
 
Old 05-17-2007, 06:18 AM   #7
red_lego_man
LQ Newbie
 
Registered: Jun 2006
Posts: 7

Rep: Reputation: 0
I would have to agree with saikee. DD and gparted are excellent free ways to clone any drives, including windows.
There is a gparted live cd available, here which will make things even easier!
 
Old 05-17-2007, 07:28 AM   #8
darkscot
Member
 
Registered: Jul 2006
Location: West Yorkshire, UK
Distribution: Mandriva, Leeenux, Saluki
Posts: 103

Original Poster
Rep: Reputation: 21
Wow! That is a lot of useful and interesting information. I have never heard of DD before but I will investigate that further. It still seems that Ghost/G4L is the best option on this occasion though? I do not want to clone the whole disk as the partition table seems totally ******* up! Gparted cannot read the disk so I am assuming that if I clone it to a new one it will have the same problem. That is why I just want to clone the two Windows partitions.
Having said all that I suppose it wouldn't hurt to give DD a go first? I have just been out and bought an Hitachi Deskstar 320GB internal drive (60quid!?). So I am assuming the command would be:
Code:
dd if=/dev/sda of=/dev/sdb bs=32768
Hmmmm? Nah, I am still drawn towards G4L on this occasion.
 
Old 05-17-2007, 07:34 AM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You could partition the new drive with 2 partitions the exact size as the windows partitions on the old drive and then use dd to copy just the partitions, rather than the entire drive. Use the device such as /dev/sda1.

Also read the article on the MBR in Wikipedia.

Last edited by jschiwal; 05-17-2007 at 07:36 AM.
 
Old 05-17-2007, 07:56 AM   #10
darkscot
Member
 
Registered: Jul 2006
Location: West Yorkshire, UK
Distribution: Mandriva, Leeenux, Saluki
Posts: 103

Original Poster
Rep: Reputation: 21
Unhappy

Quote:
Originally Posted by jschiwal
You could partition the new drive with 2 partitions the exact size as the windows partitions on the old drive and then use dd to copy just the partitions, rather than the entire drive.
Would the new partitions have to be the exactly the same size, or could they be bigger (but obviously not smaller)?
Quote:
Use the device such as /dev/sda1.
Oh yeah! So:
Code:
dd if=/dev/sda1 of=/dev/sdb1 bs=32768
If it was just me to consider then I would try that (my idea of a good time is reinstalling operating systems), but there is also my family to consider. I still remember the ugly scenes when I switched from Ubuntu to SUSE and lost all the high scores on Gnome Games. That is NOT something I want to go through again!
 
Old 05-17-2007, 09:17 AM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Issue this command in root console
Code:
fdisk -l
It will list every partition of every disk in your PC.

From the output you should know the disks name by the capacity and the partitions inside. Partition Type 7 is NTFS, Type 82 is swap and normal Linux has Type 83.

If you clone a partition it is "vital" that you create the target partition in exactly the same size as the original because dd carries out cloning from the first sector to the last according to the boundary defined.

To clone the whole disk you can igore completely the partitioning requirements and use a raw disk directly off a sealed bag. It would be the method I recommend because I never have one fail yet. If you don't like the other partitions just boot up a Live CD and use the terminal cfdisk program to delete all of them except xp. They will disappear in seconds.

The whole disk cloning is attractive because the first sector you clone has the MBR and partition table and thereafter it is only a question of how long it takes.


To clone a 200Gb disk to a 320Gb only 200Gb will be transferred. This is 1:15 hour job if both disks are internal.

The only thing you need to watch out is make sure the input file (if=) is the source device with 200Gb inside and the output file (of=) is the one with 320Gb. Reversing the two can have dire consequence.

Ghost will perform the cloning in a similar fashion as it need to exit XP, load a DrDos program to do the cloning. The advantage with Ghost is that you can have a target partition different in size to the original, including being smaller.
 
Old 05-21-2007, 12:44 AM   #12
darkscot
Member
 
Registered: Jul 2006
Location: West Yorkshire, UK
Distribution: Mandriva, Leeenux, Saluki
Posts: 103

Original Poster
Rep: Reputation: 21
Windows XP cloning [SOLVED}

Well it has been done, though it was not a quick task! Because of my concerns about copying over corrupt partition data I decided to try G4L first. After downloading it and burning to disk I decided the learning curve was just too steep for a Friday night.
I then downloaded and installed the trial version of Norton Ghost. (This experience reminded me how easy it is to install stuff in Linux nowadays). After a reboot I ran Ghost and discovered the trial version has the cloning function disabled. I then attempted to uninstall it which proved a LOT more difficult than you would think. In the end the only way I could get rid of it was to use the uninstall tool in CCleaner.
This left the ‘dd’ command. I ran ‘dd if=/dev/sda of=/dev/sdb bs=32768’ and it worked! No fuss, no bother! (Though a progress bar would be nice?) As predicted it took about 75 minutes.
Unfortunately, my fears that the new cloned disk would have the same problems (i.e. corrupt partition table) as the old drive proved correct. So I spent most of Saturday morning trying to sort them out. As before, neither Gparted nor Partition Magic could do anything with them. In the end I had to 'repair' XP using the XP disk and then use the disk management function in Windows XP to delete the partitions. Then use Gparted* to sort out the empty space.

So after all that I now have WinXp on one drive and Sabayon 3.3 on another. Both with an embarrassment of free space and both of them run a lot faster now.

(*I actually used ‘Parted Magic’ which is a very nice little package that includes Gparted.)
 
Old 05-21-2007, 01:36 AM   #13
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
I once tried to clone a multi-boot drive to a larger one once using either Data Lifeguard or Maxblast3 from dos, both of which are Ontrac disk management. The old drive probably had 14 primary partitions or so with Swap, a few Linux, Home, many Windows. I'm pretty sure, (this was a while back), it only cloned the latest version of Windows Operating system partition taking up the whole new drive in one partition.
 
Old 05-21-2007, 02:19 AM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I wrote this thread hoping it may solve the problem once and for all.

There has been a report from a very happy user.
 
Old 05-21-2007, 02:44 PM   #15
darkscot
Member
 
Registered: Jul 2006
Location: West Yorkshire, UK
Distribution: Mandriva, Leeenux, Saluki
Posts: 103

Original Poster
Rep: Reputation: 21
Quote:
Originally Posted by saikee
I wrote this thread hoping it may solve the problem once and for all.
I think that is an excellent guide, which i have already passed on to several people.
 
  


Reply



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
Settings required for Samba to access the windows desktop from LAN Nishant Desai Linux - Networking 1 11-18-2006 05:17 AM
Default Windows required Jazzy108 Fedora 5 07-29-2006 10:40 AM
help required to join ubuntu breezy to windows 2003 active directory manojm Linux - Networking 1 06-10-2006 02:56 PM
Help required I Can connect to Internet through Windows but not through Linux ! Sreecharan Linux - Networking 2 12-18-2005 09:17 AM

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

All times are GMT -5. The time now is 05:17 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