Subject: Re: fdisk from scripts
To: Wolfgang Rupprecht <wolfgang@wsrcc.com>
From: None <rmcm@compsoft.com.au>
List: current-users
Date: 06/18/2001 08:26:09
this works for me from a script;
partition_id=169
disk=sd0
...
eval `fdisk -S $disk`
echo "Writing the sector-0 partition table"
fdisk -f -i -b ${DLCYL}/${DLHEAD}/${DLSEC} ${disk}
echo "Configuring partition-4 of sector-0 partition table"
fdisk -3 -afu -s ${partition_id}/0/${DLSIZE} ${disk}
Wolfgang Rupprecht writes:
>
> The fdisk man page mentions a 'fdisk -b cyl/heads/sects' for writing
> the bios geometry in the MBR. (I hope I've got this weird dos
> terminology right.)
>
> As far as I can tell 'fdisk -f -b 1023/15/63 wd0' does nothing.
> Running a subsequent 'fdisk wd0' give me the same BIOS geometry.
>
> NetBSD disklabel disk geometry:
> cylinders: 13424 heads: 15 sectors/track: 63 (945 sectors/cylinder)
>
> BIOS disk geometry:
> cylinders: 527 heads: 255 sectors/track: 63 (16065 sectors/cylinder)
>
> Partition table:
> 0: <UNUSED>
> 1: <UNUSED>
> 2: <UNUSED>
> 3: <UNUSED>
>
> Am I reading the man page wrong or is fdisk broke?
>
> I'd really like the align the number of heads in the bios and netbsd
> geometries so that I can set the netbsd partition to start on cylinder
> 1 from both netbsd's and the bios's standpoint. Some of my computers
> won't boot from a partition that isn't on a bios cylinder boundary.
> I'd like to write a universal "build this disk" script that clears
> everything and rebuilds from scratch.
>
> -wolfgang
> --
> Wolfgang Rupprecht <wolfgang+gnus@dailyplanet.wsrcc.com>
> http://www.wsrcc.com/wolfgang/
> Coming soon: GPS mapping tools for Open Systems. http://www.gnomad-mapping.com/
--
Rex McMaster