LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Cloning from working pc to black harddrives (https://www.linuxquestions.org/questions/linux-hardware-18/cloning-from-working-pc-to-black-harddrives-83567/)

Proud 08-19-2003 02:03 PM

Cloning from working pc to black harddrives
 
Ok, at the moment I currently have 1 pc containing a Win98SE FAT32 40gig drive with 3 partitions, and a 20gig linux drive containing 5 partitions. I also have cd and cd-rw drives.

I'm planning to buy a second pc, almost identical stats, and wish to clone the windows install at least, so I dont have to bother re-install. I might clone the linux one and edit a few drive and monitor settings, as it'll be hard to repatch a fresh install (I could get some more cds to burn the packages on to).

So my questions is: How can I copy one drive's contents exactly onto another if I cant have linux and the two windows drives in the pc at once, and cant copy the windows data onto the linux drive temporarily?
Could I put a few apps on a floppy? Would a non-harddrive-using linux distro be the answer? Can I remove one of the cd drives to attach the new harddrive?
And what problems might I encounter? ;)

AltF4 08-19-2003 02:40 PM

Take a look at:

http://www.partimage.org/

http://www.gnu.org/software/parted/

http://qtparted.sourceforge.net/

Proud 08-19-2003 04:00 PM

And how exactly are they going to help if I dont have 30+ cds to feck with to copy 40 gigs, or not being able to have a linux drive connected at the time? :confused: :rolleyes:

Partimage: Are empty blocks not important when trying to ensure the windows clone works straight off?-Swap page file etc.

Parted: Will the boot disk simply try to boot a linux drive, or run a stand alone tiny kernel and then parted?

QtParted: Gui not needed, and seems very beta.

Can I not replace a cd drive with the new harddrive and then move data? I'd like to not break my working system swapping these things about.

Proud 08-20-2003 04:41 PM

Anyone, simply questions: Can I have 3 harddrives in my pc at once with my current system?

AltF4 08-21-2003 12:45 PM

usually you can have 4 IDE devices (harddisk, cdrom, dvd, burner )

modern borads have 1 primary ( master + slave device possible ) and 1 secondary ( master + slave device possible ) controller.

Proud 08-22-2003 12:29 AM

Thank you.
I spoke to the guy I'm ordering my custom pc from, and he's talked me through how we're gunna try this.

If I change a cd drive for a hard drive, what will I need to change apart from /etc/fstab?

leonscape 08-22-2003 12:35 AM

Try looking at the command dd.

Its usually used to copy boot blocks, but I have used it to clone harddrives before.

dd -if=/dev/hda -of=/dev/hdc cbs=1048576

Copy a meg at a time from device at hda to hdc.

This is a Block for Block copy, SO Its best if both devices are the same size.

Its best to boot from something else to do this, as it won't interfere with your set up then, a rescue disk should do (It'll probably have the command dd as well)

AltF4 08-23-2003 05:21 AM

>modern borads have 1 primary ( master + slave device possible )
master: /dev/hda
slave: /dev/hdb
>and 1 secondary ( master + slave device possible ) controller.
master: /dev/hdc
slave: /dev/hdd

you migh want to buy/borrow an additional PCI IDE card for even more devices ( /dev/hde, /dev/hdf, etc.) or disconnect a cdrom/burner device and attach a HDD there

liontech2002 08-23-2003 01:20 PM

XCOPY C:\*.* /s /v
 
This command on a Dos or Win 3.0 - 98se (include the destination drive letter at the end [a formated and active (bootable) fat32 partition] after booting to a command prompt only will do what you want. I am still a newbie to linux so i can't give you a command for that yet. Hope this helps.

:)

Electro 08-23-2003 06:12 PM

Using CDs are ugly when making an image of a 10 gigabyte hard drive or bigger. Who wants to shuffle around with about 20 or more CDs. I suggest buying a 120 gigabyte hard drive or bigger. A 5400 RPM hard drive will be just fine. For each drive or partition make an image to the 120 gigabyte hard drive or to the biggest hard drive.

When using dd, make sure you un-mount the input and output drives first for a block to block copy. If you are outputting to a file, you only need to un-mount the input drive. Not all filesystems work with dd.

You can copy all your LINUX configurations files to a few floppies. With Windows, you have to resort to disk imaging for a perfect copy. xcopy sometimes work perfectly.

Proud 08-25-2003 02:26 PM

Ok, so what'll happen if I use dd and the target drive/partition is larger than the source?

Is Windows's XCOPY command reliable for copying a running Windows partition to a new drive?

I'm thinking I'll get a nice 70 or 80 gig 7200rpm drive for linux, not sure if i'll stick windows as the first OS on it, or risk re-using a 4 year+ old drive. Either way I could be badly screwed if a drive fails. Would a second new ~30gig drive be worth it for just windows?

liontech2002 08-25-2003 06:07 PM

DOS/WIN XCOPY or XCOPY32
 
Yes it is reliable, I have used it many, many times in the past 12 years as a PC technician. It is not an image copy or block for block copy, and won't work on NTFS partitiions. For DOS FAT or FAT32 it is fine. After copying file for file (*.*) you just run FDISK and make the new partition HD active. If it didn't boot after that, just boot up to a WIN system disk and use the SYS C: command to reintall the system files. You can also use FDISK /MBR in case the master book record is not working right. These additional steps should not be needed as long as the newly copied file system resides on the first partitiion of the first hard drive in the system when it is booted up for the first time. And will work fine as long as the Windows registry or startup files aren't making calles to other drives or partitions that are no longer in existence at the same drive letter specs.

Hope this helps.

AltF4 08-25-2003 08:28 PM

first create and format your destination partition on your new HDD

after that you can:

1) use xcopy

2) mount both partitions under linux and use "cp -R" (man cp) to copy the entire structure
e.g.
### log on as root
### create source & destination
mkdir /dos1
mkdir /dos2
### mount source partition read-only
mount -r -t vfat /dev/hda1 /dos1
### mount destination partition
mount -t vfat /dev/hdc1 /dos2
### go to source
cd /dos1
cp -R * ../dos2
###or if you are paranoid:
find . -depth -print | cpio -pdvm ../dos2

3) use "partimage" etc. under linux

4) use commercial cloning tools like "partition magic" under dos

dd is unlikely to work and possibly dangerous if you do not REALLY REALLY know what you are doing :-)

rocaddict 08-26-2003 06:51 PM

Re: XCOPY C:\*.* /s /v
 
Quote:

Originally posted by liontech2002
This command on a Dos or Win 3.0 - 98se (include the destination drive letter at the end [a formated and active (bootable) fat32 partition] after booting to a command prompt only will do what you want. I am still a newbie to linux so i can't give you a command for that yet. Hope this helps.

:)

Don't forget the /a to catch any hidden files.
SYSTEM.DAT and USERS.DAT come to mind

liontech2002 08-26-2003 08:40 PM

Oops, yeah sorry that would not work right without /a...

:D


All times are GMT -5. The time now is 11:35 PM.