bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] Restoring HDIO_GETGEO semantics (was: Re: workaround for BIOS


From: Anton Altaparmakov
Subject: Re: [RFC] Restoring HDIO_GETGEO semantics (was: Re: workaround for BIOS / CHS stuff)
Date: Sat, 3 Jul 2004 08:53:39 +0100 (BST)

On Sat, 3 Jul 2004, Andrew Clausen wrote:
> In any case, I don't have any evidence that anything is wrong.  On my
> computer, I can tell the BIOS to use CHS geometry, (as opposed to
> "Auto", "LBA" or "Large") modify the partition table to set the CHS
> start/end of the Windows partition to 0, 1024, or anything I like, and
> Windows STILL works.  I can't get anything to break!

Which version of Windows?  Does it use NTFS as both the boot and system 
drive?

> So, can anyone break Windows?

Easily.  Modify any of the relevant values in the NTFS bootsector and 
windows will no longer boot.  So it clearly cares hugely about the 
geometry.  And at present there is no easy way for us to tell what it is 
so mkntfs and ntfsclone cannot create bootable partitions on 2.6 kernels.  
(Works fine on 2.4 using HDIO_GETGEO.)

The relevant fields are (see linux/fs/ntfs/layout.h or 
ntfsprogs/include/ntfs/layout.h) in the NTFS_BOOT_SECTOR in the 
BIOS_PARAMETER_BLOCK:

u16 sectors_per_track; /* Required to boot Windows. */
u16 heads;             /* Required to boot Windows. */
u32 hidden_sectors;    /* Offset to the start of the partition relative 
to the disk in sectors.  Required to boot Windows. */

Best regards,

        Anton
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]