On Mon, 15 Mar 2004, Anton Altaparmakov wrote:
> As far as I understood from the forum (see
> https://sourceforge.net/forum/forum.php?thread_id=964201&forum_id=44084),
> the hidden sectors entry in the ntfs boot sector means the sector
> location of the start of the partition relative to the beginning of
> the disk. Szaka, is this correct?
Yes.
> Does anyone have any ideas as to how mkntfs (or ntfsclone for that
> matter) could determine the value necessary for the hidden sectors field
> in the ntfs boot sector?
I didn't investigate this yet. Perhaps Linux kernel has (or had before
2.6) some ioctl to query this. It should actually ... Otherwise we must
parse the partition table: duplicated effort.
> E.g. should we parse the output of fdisk
IMHO, no.
> or should we try to do it ourselves?
IMHO we should.
> What about Windows dynamic disks/partition on a file rather than a
> device, etc?
We could leave it 0 as it is now and if one complains, we could
investigate and add support.
> Perhaps as a start we could provide a command line option that allows
> the user to set the value of hidden_sectors?
I'm not sure. I planned ntfsck would fix this for the user.
ntfsclone could have also an option for "system cloning". Problem can
arise if the value is changed without asking the user, if the user doesn't
restore the image by ntfsclone but by some other way (dd, cp, etc). In
these cases they couldn't boot if the partition was boot partition.
Szaka
|