Subject: Re: fdisk madness in 1.6.1_STABLE
To: David Laight <david@l8s.co.uk>
From: Greg A. Woods <woods@weird.com>
List: port-i386
Date: 10/19/2003 19:35:19
[ On Sunday, October 19, 2003 at 19:34:28 (+0100), David Laight wrote: ]
> Subject: Re: fdisk madness in 1.6.1_STABLE
>
> > So far here's what I've got:
> > 
> > 	# eval $(fdisk -S sd1)
> > 	# fdisk -f -i -b $BCYL/$BHEAD/$BSEC sd1
> > 	# fdisk -f -u -0 -s 169/63/$DLSIZE sd1
> > 	# fdisk -f -a -0 sd1
> > 
> > This seems to work, but it's a bit painful and getting this far took a
> > great deal of experimentation.
> 
> The second line is pointless, the parameters to -b are not saved
> on the disk.

I'll have to try some more experiments but I have the distinct
impression from my previous tests that nothing will "take" properly,
i.e. it seems the MBR boot code is never updated, if I don't include the
"-b" settings.

Without the "-f" and without "-b", i.e. as "fdisk -i sd1", it asks if I
want to change the BIOS' idea of things and the question is worded such
that piping "yes" to the command does the wrong thing (and then all
kinds of non-interactive fun ensues!  :-).

So, in the end it seemed the only way to ensure the "-i" worked properly
was to also give it "-f -b".

I long ago gave up trying to read the spaghetti code that handles all
this so-called logic (it might be a bit more readable if meaninful names
had been given to the boolean variables set by the command-line flags)....

> The third line needs to be:
> # fdisk -f -u -0 -s 169/$DLSEC/$(($DLSIZE-$DLSEC)) sd1

Ah, of course!  Thanks!

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>