Unable to modify sysid with Fdisk

Tim Judd tajudd at gmail.com
Tue Dec 30 01:58:38 UTC 2008


David Scialom wrote:
> Hello Tim,
> 
> Thanks for your suggestion. The probleme after the section 3 does not 
> exist. It is actually a wrong copy paste done by me. Nothing changed 
> after your suggestion :
> 
> Zurich# dd if=/dev/zero bs=512 count=128 of=/dev/da0
> 128+0 records in
> 128+0 records out
> 65536 bytes transferred in 0.095998 secs (682681 bytes/sec)
> 
> Zurich# fdisk -u da0
> ******* Working on device /dev/da0 *******
> parameters extracted from in-core disklabel are:
> cylinders=8 heads=64 sectors/track=32 (2048 blks/cyl)
> 
> parameters to be used for BIOS calculations are:
> cylinders=8 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 16352 (7 Meg), flag 80 (active)
>         beg: cyl 0/ head 1/ sector 1;
>         end: cyl 7/ 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]
> Supply a decimal value for "size" [16352]
> Explicitly specify beg/end address ? [n]
> sysid 12 (0x0c),(DOS or Windows 95 with 32 bit FAT (LBA))
>     start 32, size 16352 (7 Meg), flag 80 (active)
>         beg: cyl 0/ head 1/ sector 1;
>         end: cyl 7/ 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]
> 
> We haven't changed the partition table yet.  This is your last chance.
> parameters extracted from in-core disklabel are:
> cylinders=8 heads=64 sectors/track=32 (2048 blks/cyl)
> 
> parameters to be used for BIOS calculations are:
> cylinders=8 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 16352 (7 Meg), flag 80 (active)
>         beg: cyl 0/ head 1/ sector 1;
>         end: cyl 7/ 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=8 heads=64 sectors/track=32 (2048 blks/cyl)
> 
> parameters to be used for BIOS calculations are:
> cylinders=8 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 16352 (7 Meg), flag 80 (active)
>         beg: cyl 0/ head 1/ sector 1;
>         end: cyl 7/ head 63/ sector 32
> The data for partition 2 is:
> <UNUSED>
> The data for partition 3 is:
> <UNUSED>
> The data for partition 4 is:
> <UNUSED>
> 
> 
> 
> 
> 
> 2008/12/28 Tim <tajudd at gmail.com <mailto:tajudd at gmail.com>>
> 
>     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.
> 
> 

If you're just looking to make a partition id 165 for everything on the 
disk, I think fdisk -i or fdisk -I is a much quicker way to accomplish 
your goal.

from fdisk(8):

      -i      Initialize sector 0 of the disk.  Existing slice entries 
will be cleared (marked as unused) before editing.  (Compare with -u.)

      -I      Initialize sector 0 slice table for one FreeBSD slice 
covering the entire disk.



But I've noticed on your recent posting that somehow fdisk is still 
seeing a partition 1 still after zeroing not only the MBR, but the first 
two tracks of the disk.

Are we sure this disk is in good mechanical condition?  It's behaving 
erratically and I'm challenging that it's in good shape.  See below for 
a (re)quote highlighting what I'm very curious about.

-------- Quote:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
     start 32, size 16352 (7 Meg), flag 80 (active)
-------- /Quote

It saw a FreeBSD partition of 7MB in size.  7MB may be too small to have 
fat12/16/32 even (don't ask me to quote a reference or documentation on 
weather it is too small or whatever).

a zero'd drive should have NOTHING defined, and somehow it's still 
seeing a 7MB partition.

Logistically, it isn't working.  Originally it saw a 1008MB partition. 
How big is this drive we're trying to work with?

Is the drive in a enclosure with some conversion, like a USB<->(E)IDE, 
or a USB<->SATA?

Something's not right, and I'm sure it's something simple -- the fact 
that we're getting erratic results is going to bug me until we solve it.



More information about the freebsd-questions mailing list