Accessing odd last partition sector (was: [Linux-NTFS-Dev] mkntfsdirty volume marking)

From: Szakacsits Szabolcs
Date: Fri Apr 09 2004 - 06:43:21 EST



On Fri, 9 Apr 2004, fledely wrote:

> TODO.ntfsprogs conatins the following TODO item under mkntfs:
> - We don't know what the real last sector is, thus we mark the volume
> dirty and the subsequent chkdsk (which will happen on reboot into
> Windows automatically) recreates the backup boot sector if the Linux
> kernel lied to us about the number of sectors.

ntfsresize, ntfsclone and others have the same problem due to this kernel
limitation.

> Now that we know about the extended/legacy BIOS geometry, and
> assuming kernel version 2.6.5+ Is it possible to finally get fixed, or
> totally unrelated?

I'm afraid unrelated. There are two main issues two consider if you want
to fix this:

1) You must know the exact, _real_ partition size.

2) You must be able to access it.

Firstly, I don't think EDD tells anything about the partitions but maybe
I'm wrong, I didn't have time to check it out.

Secondly the kernel doesn't always allow access to the last sector via the
partition (longstanding kernel bug). We could access it via the full
device (e.g. /dev/hda, etc) but that's quite messy, error-prone and this
should be fixed in the _kernel_.

Other people are also disturbed by this for a long time,

- they can't make a full partition backup (dd)

- just like NTFS, the new partitioning format, GPT, also stores
backup data in the last sectors.

There were attempts to fix this in 2.6 but I don't know if it was
completed. Maybe somebody knows or have the time to investigate it?

Szaka

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/