Copying from one hard drive to another

I have a hard drive that contains several ext3 partitions an NTFS partition and a FAT32 partition. Is it possible to copy it's contents to another drive of a different type but nominally the same capacity (one drive is 2.5" the other 3.5") using some sort of bitwise copy? If so then what commands do I need to do it? I could do it manually by creating the right partitions on the second drive and copying the files, but I'm wondering if there's a less tedious way? Glenn -- Glenn Ramsey <glenn(a)componic.co.nz> 07 8627077 http://www.componic.co.nz

Is it possible to copy it's contents to another drive of a different type but nominally the same capacity (one drive is 2.5" the other 3.5") using some sort of bitwise copy?
If so then what commands do I need to do it?
You could use dd to copy the contents of one partition (or disk) to another, assuming the partitions (or disks)were identical sizes. Be careful with this, as you can easily overwrite the file allocation table on the other disk, and it's even easier trash your data. You could just do, for example: dd if=/dev/hda of=/dev/sda bs=1M to copy the entire contents of hda - the FAT, all partitions, etc, in 1MB blocks, to /dev/sda. Read on though.
I could do it manually by creating the right partitions on the second drive and copying the files, but I'm wondering if there's a less tedious way?
Using dd might appear to be simpler, however it will take a lot longer unless your partitions are nearly full. I'd suggest partitioning the disks manually (it's really not *that* tedious, and you could possibly use something like sfdisk to make it easier still), mounting the partitions in the correct place, then using rsync to copy the data from the source disk to the destination. Using rsync also has the benefit that if the copy is interrupted for any reason, you can restart and rsync will catch up with where it left off. If you mount the second disk in /mnt, you might have to do something like DIRS="/root /boot /etc /lib /home /usr /var /tmp" rsync -arvHP $DIRS /mnt That's just to stop rsync recursing into the directory you're already syncing... There are other ways to do this too - you could use an exclude list for example.

On 20/10/06, Daniel Lawson <daniel(a)meta.net.nz> wrote:
Using rsync also has the benefit that if the copy is interrupted for any reason, you can restart and rsync will catch up with where it left off.
However, Linux can't write to NTFS file systems (it can read them however), so you will need to find another way to copy that partition. -- simon

Simon Green wrote:
On 20/10/06, Daniel Lawson <daniel(a)meta.net.nz> wrote:
Using rsync also has the benefit that if the copy is interrupted for any reason, you can restart and rsync will catch up with where it left off.
However, Linux can't write to NTFS file systems (it can read them however), so you will need to find another way to copy that partition.
Hmm. You know, I didn't read the first paragraph of the OP's email at all, it seems :)
participants (3)
-
Daniel Lawson
-
Glenn Ramsey
-
Simon Green