Unable to modify sysid with Fdisk

Tim tajudd at gmail.com
Sun Dec 28 20:36:16 UTC 2008


David Scialom wrote:
> Hello,
>
> It seems that it  is impossible to modify the sysid with fdisk since FreeBSD
> 6.2. I am actually using FreeBSD7.0.
> When I want to modify my the sysid from 165(ufs) to 12(Fat32) i get the
> message "Geom not found: da0" and no change is made: da0 is stock with sysid
> = 165. The detail are provided below. I tried also to do the same from the
> install FreeBSD CD without success.
>
> As someone a solution ?
>
> Zurich# fdisk -u da0
> ******* Working on device /dev/da0 *******
> parameters extracted from in-core disklabel are:
> cylinders=1009 heads=64 sectors/track=32 (2048 blks/cyl)
>
> parameters to be used for BIOS calculations are:
> cylinders=1009 heads=64 sectors/track=32 (2048 blks/cyl)
>
> Do you want to change our idea of what BIOS thinks ? [n]
> *fdisk: invalid fdisk partition table found*
> Media sector size is 512
> Warning: BIOS sector numbering starts with sector 1
> Information from DOS bootblock is:
> The data for partition 1 is:
> sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
>     start 32, size 2066400 (1008 Meg), flag 80 (active)
>         beg: cyl 0/ head 1/ sector 1;
>         end: cyl 1008/ head 63/ sector 32
> Do you want to change it? [n] y
> Supply a decimal value for "sysid (165=FreeBSD)" [165] 12
> Supply a decimal value for "start" [32]
> Susysid 12 (0x0c),(DOS or Windows 95 with 32 bit FAT (LBA))
>     start 32, size 2066400 (1008 Meg), flag 80 (active)
>         beg: cyl 0/ head 1/ sector 1;
>         end: cyl 1008/ head 63/ sector 32
> Are we happy with this entry? [n] y
> The data for partition 2 is:
> <UNUSED>
> Do you want to change it? [n]
> The data for partition 3 is:
> <UNUSED>
> Supply a decimal value for "size" [2066400]
> Explicitly specify beg/end address ? [n]
> sysid 12 (0x0c),(DOS or Windows 95 with 32 bit FAT (LBA))
>     start 32, size 2066400 (1008 Meg), flag 80 (active)
>         beg: cyl 0/ head 1/ sector 1;
>         end: cyl 1008/ head 63/ sector 32
> Are we happy with this entry? [n] y
> The data for partition 2 is:
> <UNUSED>
> Do you want to change it? [n]
> The data for partition 3 is:
> <UNUSED>
> Do you want to change it? [n]
> The data for partition 4 is:
> <UNUSED>
> Do you want to change it? [n]
> Partition 1 is marked active
> Do you want to change the active partition? [n] y
> Supply a decimal value for "active partition" [1]
> Are you happy with this choice [n] y
>
> We haven't changed the partition table yet.  This is your last chance.
> parameters extracted from in-core disklabel are:
> cylinders=1009 heads=64 sectors/track=32 (2048 blks/cyl)
>
> parameters to be used for BIOS calculations are:
> cylinders=1009 heads=64 sectors/track=32 (2048 blks/cyl)
>
> Information from DOS bootblock is:
> 1: sysid 12 (0x0c),(DOS or Windows 95 with 32 bit FAT (LBA))
>     start 32, size 2066400 (1008 Meg), flag 80 (active)
>         beg: cyl 0/ head 1/ sector 1;
>         end: cyl 1008/ head 63/ sector 32
> 2: <UNUSED>
> 3: <UNUSED>
> 4: <UNUSED>
> Should we write new partition table? [n] y
> fdisk: Geom not found: "da0"
> Zurich# fdisk da0
> ******* Working on device /dev/da0 *******
> parameters extracted from in-core disklabel are:
> cylinders=1009 heads=64 sectors/track=32 (2048 blks/cyl)
>
> parameters to be used for BIOS calculations are:
> cylinders=1009 heads=64 sectors/track=32 (2048 blks/cyl)
>
> fdisk: invalid fdisk partition table found
> Media sector size is 512
> Warning: BIOS sector numbering starts with sector 1
> Information from DOS bootblock is:
> The data for partition 1 is:
> sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
>     start 32, size 2066400 (1008 Meg), flag 80 (active)
>         beg: cyl 0/ head 1/ sector 1;
>         end: cyl 1008/ head 63/ sector 32
> The data for partition 2 is:
> <UNUSED>
> The data for partition 3 is:
> <UNUSED>
> The data for partition 4 is:
> <UNUSE
>   

The "Warning: Invalid fdisk partition table found" is a red flag to me.  
If the partition boundries don't lie on a cylinder, than it's invalid.

I also see after it prints partition 3, it randomly asks for the size of 
the partition, without asking for anything else.

I think those first 512 sectors are messed up.  If I were you, I'd wipe 
the first 2 tracks of the disk.
dd if=/dev/zero bs=512 count=128 of=/dev/da0

And recreate the partition then.  fdisk isn't seeing a sane layout to 
begin with and it may silently be discarding the changes asked.

Good luck.


More information about the freebsd-questions mailing list