[Nottingham] dd and partitions (Re: Very slow dd if=/dev/random)

Jon Masters nottingham at mailman.lug.org.uk
Tue Jul 29 11:42:01 2003


On Tue, 29 Jul 2003, Martin wrote:

> On my system, the BIOS recognises the disk as being 200G, but then fails 
> to autodetect correctly and fails on one of the SMART commands for it.

This is entirely plausible.

> However, Linux seems happy with it. /sbin(?)/fdisk even read the 
> corrupted partion tables as far as they went.

Not surprising since Linux uses the standard IDE register set directly
rather than making BIOS calls as I am sure has been said many times.
While many just parrot the above two lines it is worth thinking about this
further and realising just now nice this situation really is.

> However, on another system that I flashed the BIOS to support >136GB, 
> Win2k trashed the partitions.

Please provide some more information about what it did precisely.
It might have installed a Windows Logical Disk Manager Dynamic Disk
<whatever term they use for the global table> configuration which your
Linux did not recognise. See http://linux-ntfs.sf.net/ldm/.

Windows is notoriously bad with large disk sizes even with NT.
W2K and XP are better though they like LDM to be used instead.

> Also, dd to transfer a backup image onto the disk took far longer than
> expected, suggesting that it wrote beyond the size of the backup image.

What commands did you use and were you aware that this can have
complications when moving from one device to another?

> So still wondering whether dd is completely immune from disk drive 
> geometries when using /dev/hdg for example...

Utilities go through the block device layer in the kernel and so the
limitiations are only those exposed in the IDE low level Linux support.

> (eg: the source hda1 will be copied over but its link to the next 
> partion will now be wrong for the destination disk...? Does this work ok 
> for primary partions but not logical partitions??)

Try it and be prepared to go in to the advanced mode in fdisk to fix any
breakage in the partition tables. Try not doing this on the system disk.

Jon.