kern/83529: partition table corruption using wdc/wd driver

Francis Gendreau tech at makwa.net
Fri Jul 15 23:10:02 GMT 2005


>Number:         83529
>Category:       kern
>Synopsis:       partition table corruption using wdc/wd driver
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 15 23:10:00 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Francis Gendreau
>Release:        FreeBSD 4.11 STABLE
>Organization:
Makwa
>Environment:
FreeBSD  4.11-STABLE FreeBSD 4.11-STABLE #0: Fri Jul 15 17:56:42 EDT 2005     root@:/usr/obj/usr/src/sys/registette  i386
>Description:
I am building a system with two slice on a single drive, since a single slice does not provides me enough partitions for my filesystem design. In order to optimise the operating system, I've compiled the wdc and wd driver, from which I access my partition.

Using the 'ad' driver, I was able to access every partition created of every slices of every drives. The problem here reside in the two commented partitions of the wd0s2 slice.

N.B. I uses the STABLE release onyl because the Robert Watson's ACL patch is included with it. I do ignore if the 4.11-RELEASE also have the problem.

=====================================================================

# cat /etc/fstab
# See the fstab(5) manual page for important information on automatic 
# mounts of network filesystems before modifying this file.
#
# Device      Mountpoint      FStype  Options         Dump    Pass#
/dev/wd1s1b   none            swap    sw              0       0
/dev/wd0s1b   none            swap    sw              0       0
/dev/wd0s1a   /               ufs     rw              1       1
/dev/wd0s2f   /data           ufs     rw              2       2
/dev/wd0s2h   /data/db        ufs     rw              2       2
/dev/wd0s2g   /data/dev       ufs     rw              2       2
#/dev/wd0s2a  /data/profiles  ufs     rw              2       2
/dev/wd1s1f   /data/shares    ufs     rw              2       2
/dev/wd0s1g   /root           ufs     rw              2       2
/dev/wd0s1f   /tmp            ufs     rw              2       2
/dev/wd0s1e   /usr            ufs     rw              2       2
#/dev/wd0s2b  /usr/home       ufs     rw              2       2
/dev/wd0s2e   /usr/local      ufs     rw              2       2
/dev/wd0s1h   /var            ufs     rw              2       2
/dev/wd1s1e   /var/log        ufs     rw              2       2
/dev/wd0s1d   /var/tmp        ufs     rw              2       2
/dev/acd0c    /cdrom          cd9660  ro,noauto       0       0
proc          /proc           procfs  rw              0       0

=====================================================================

# fdisk /dev/wd0
******* Working on device /dev/wd0 *******
parameters extracted from in-core disklabel are:
cylinders=4112 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=4112 heads=255 sectors/track=63 (16065 blks/cyl)

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,(FreeBSD/NetBSD/386BSD)
    start 63, size 12610962 (6157 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 784/ head 254/ sector 63
The data for partition 2 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 12611025, size 67681845 (33047 Meg), flag 0
        beg: cyl 785/ head 0/ sector 1;
        end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>

=====================================================================

# disklabel -r /dev/wd0s1
# /dev/wd0s1:
type: ESDI
disk: ad0s1
label:
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 784
sectors/unit: 12610962
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0

8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:  2097152        0    4.2BSD     2048 16384    89   # (Cyl.    0 - 130*)
  b:  1048576  2097152      swap                        # (Cyl.  130*- 195*)
  c: 12610962        0    unused        0     0         # (Cyl.    0 - 784*)
  d:  1076626 11534336    4.2BSD     2048 16384    89   # (Cyl.  717*- 784*)
  e:  4194304  3145728    4.2BSD     2048 16384    89   # (Cyl.  195*- 456*)
  f:  1048576  7340032    4.2BSD     2048 16384    89   # (Cyl.  456*- 522*)
  g:  1048576  8388608    4.2BSD     2048 16384    89   # (Cyl.  522*- 587*)
  h:  2097152  9437184    4.2BSD     2048 16384    89   # (Cyl.  587*- 717*)
#

=====================================================================

# /dev/wd0s2:
type: ESDI
disk: ad0s2
label:
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 4213
sectors/unit: 67681845
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0

8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a: 41943040 31485393    4.2BSD     2048 16384    89   # (Cyl. 1959*- 4570*)
  b:  6864437 73428433    4.2BSD     2048 16384    89   # (Cyl. 4570*- 4997*)
  c: 67681845 12611025    unused        0     0         # (Cyl.  785 - 4997)
  e:  4194304 12611025    4.2BSD     2048 16384    89   # (Cyl.  785 - 1046*)
  f:  2097152 16805329    4.2BSD     2048 16384    89   # (Cyl. 1046*- 1176*)
  g:  4194304 18902481    4.2BSD     2048 16384    89   # (Cyl. 1176*- 1437*)
  h:  8388608 23096785    4.2BSD     2048 16384    89   # (Cyl. 1437*- 1959*)
partition a: partition extends past end of unit
partition b: offset past end of unit
partition b: partition extends past end of unit
partition c: partition extends past end of unit
Warning, partition c doesn't start at 0!
Warning, An incorrect partition c may cause problems for standard system utilities
#

=====================================================================



>How-To-Repeat:
To repeat the problem, simply create a second slice using disklabel while installing the operating system. The problem, after 3 re-installations, always reside in the 2 last created partition of the second slice of the drive. The system repports their parameters are invalid.
>Fix:
      
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list