On Thu, 10 Apr 2003, Ian Jackson wrote:
> So, perhaps I should have ntfsimage generate an image not containing
> the spare boot sector, but with the `dirty' bit set, so that NT will
> rewrite the spare ?
I don't think so. For imaging that seems to be too intrusive.
If you can access that sector just do it. If not, you can either
a) warn the user, to run chkdsk to recovery it because Linux
kernel couldn't access that sector due to its limitation
or
b) access the sector via the disk, not the partition (could be
quite messy/error-prone considering disk geometry issues)
Anton has/had a kernel patch to fix this years ago but wasn't integrated
into the kernel for whatever reason.
> (I also need to set the image size to one cluster larger, to make sure
> that there will be space for the spare.)
Yes but as I've always seen, it's not one extra cluster. Only 512 bytes. So
the minimum size needed to restore is
<number_of_clusters> * <cluster_size> + 512 bytes.
Anyway, don't waste time with this in the beginning, it's enough if you're
aware of this issue when designing the format.
Szaka
|