LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Using dd to clone an NTFS partition from a strange partition table (http://www.linuxquestions.org/questions/linux-software-2/using-dd-to-clone-an-ntfs-partition-from-a-strange-partition-table-495620/)

jgombos 10-25-2006 11:15 PM

[solved] Using dd to clone an NTFS partition from a strange partition table
 
hda1 is the source partition, and hdb1 is the destination. The partitions appear to be the same when I ask for a basic listing:
Code:

root@1[knoppix]# fdisk -l

Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1        561    4506201    7  HPFS/NTFS
/dev/hda2            562      24321  190852200    f  W95 Ext'd (LBA)
/dev/hda5            562      24191  189807943+  7  HPFS/NTFS
/dev/hda6          24192      24321    1044193+  7  HPFS/NTFS

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hdb1              1        561    4506201    7  HPFS/NTFS
root@1[knoppix]#

But I get some strange output when I list hda1 seperately:
Code:

root@1[knoppix]# fdisk /dev/hda1

Command (m for help): p

Disk /dev/hda1: 4614 MB, 4614349824 bytes
255 heads, 63 sectors/track, 560 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

This doesn't look like a partition table
Probably you selected the wrong device.

    Device Boot      Start        End      Blocks  Id  System
/dev/hda1p1  ?      13578      119522  850995205  72  Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
    phys=(368, 111, 45) logical=(13577, 238, 11)
Partition 1 has different physical/logical endings:
    phys=(371, 101, 51) logical=(119521, 238, 60)
Partition 1 does not end on cylinder boundary.
/dev/hda1p2  ?      45382      79243  271987362  74  Unknown
Partition 2 has different physical/logical beginnings (non-Linux?):
    phys=(67, 115, 32) logical=(45381, 70, 3)
Partition 2 has different physical/logical endings:
    phys=(299, 114, 44) logical=(79242, 34, 29)
Partition 2 does not end on cylinder boundary.
/dev/hda1p3  ?      10499      10499          0  65  Novell Netware 386
Partition 3 has different physical/logical beginnings (non-Linux?):
    phys=(114, 111, 32) logical=(10498, 56, 41)
Partition 3 has different physical/logical endings:
    phys=(353, 115, 52) logical=(10498, 56, 40)
Partition 3 does not end on cylinder boundary.
/dev/hda1p4          167628      167631      25817+  0  Empty
Partition 4 has different physical/logical beginnings (non-Linux?):
    phys=(0, 0, 0) logical=(167627, 190, 52)
Partition 4 has different physical/logical endings:
    phys=(0, 0, 0) logical=(167630, 245, 26)
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

The first partition was created the XP Pro SP2 installer, and the rest by the XP Pro SP2 GUI disk manager. Here is what the destination partition looks like (created with Knoppix 4.0's fdisk):
Code:

root@1[knoppix]# fdisk /dev/hdb1

The number of cylinders for this disk is set to 8940.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
  (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hdb1: 4614 MB, 4614349824 bytes
16 heads, 63 sectors/track, 8940 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

This doesn't look like a partition table
Probably you selected the wrong device.

    Device Boot      Start        End      Blocks  Id  System
/dev/hdb1p1  ?      216399    1904881  850995205  72  Unknown
Partition 1 does not end on cylinder boundary.
/dev/hdb1p2  ?      723265    1262922  271987362  74  Unknown
Partition 2 does not end on cylinder boundary.
/dev/hdb1p3  ?      167316      167316          0  65  Novell Netware 386
Partition 3 does not end on cylinder boundary.
/dev/hdb1p4        2671568    2671619      25817+  0  Empty
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

Neither of these tables look right, and even worse, they don't appear to match. There should not even be a /dev/hdb1p2, /dev/hdb1p3, or /dev/hdb1p4, so that's also mysterious.

Any clues? Should I expect problems cloning the first NTFS partition, if I use the command "dd if=/dev/hda1 of=/dev/hdb1"?

haertig 10-25-2006 11:37 PM

Your problem is that you are trying to run fdisk on a partition. fdisk works on disks. That's why, for example, fdisk /dev/hda would work, but fdisk /dev/hda1 would not. /dev/hda is a disk, /dev/hda1 is the first partition on that disk.

jgombos 10-26-2006 12:10 AM

Yup, I think you're right on the money. I almost stopped myself from running fdisk /dev/hda1, but then I thought, naw, fdisk will error if it can't operate on a single partition. Well, it didn't. I'm glad to know that I was just chasing a ghost. dd ran fine.


All times are GMT -5. The time now is 07:07 AM.