[Gllug] ntfsresize is lying to me!

general_email at technicalbloke.com general_email at technicalbloke.com
Tue May 11 05:14:05 UTC 2010


Richard Jones wrote:
> On Sun, May 09, 2010 at 12:46:46AM +0100, general_email at technicalbloke.com wrote:
>   
>> "fdisk is a buggy program that does fuzzy things - usually it happens to
>> produce reasonable results. Its single  advantage is  that it has some
>> support for BSD disk labels and other non-DOS partition tables.
>>     
>
> All of the above could equally apply to parted, with the added
> disadvantage that parted *seems* like it's easy to use from scripts
> but in fact has all sorts of subtle gotchas.
>
> I'm still waiting for a partitioning tool which doesn't suck.
>
> Rich.
>
>   


After checking the lie of the land I agree completely. If this is the
best the 21st century has to offer in the way of partition editing tools
then it's a sorry show, I mean we're only talking about editing 64 bytes
here and half of those have been depracated for a decade! It's a good
job the old DOS MBR is nearing the end of its life, maybe in another 10
years it will have gone the way of 8" floppies and MFM drives.

In the interim I couldn't bring myself to use fdisk so I wrote a little
script to recalculate my MBR and dd it into place, then I was able to
run ntfsresize with the --bad-sectors option set and surprise surprise
it worked just fine.

Luckily it turns out all modern operating systems ignore all that
anachronistic Heads/Tracks/Cylinders nonsense so it's simply a case of
editing the bytes that represent the size of the partition in LBA blocks
( bytes 458 thru 462 as a little endian 32bit int for the first
partition if anyone's interested). You don't even need to ensure the
partition ends on a cylinder boundary any more, happy days!

It's worth pointing out that none of that would have been necessary if
gparted (an otherwise pleasing and capable tool) would have offered the
option to ignore these supposedly bad blocks in the first place. There
is a bug open for this but it's been open for 4 years now and sadly I
don't know C++ well enough to try and make a patch :(

Roger.





-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list