Bug 20700

Summary: vinum create can cause kernel panic
Product: Base System Reporter: Charlie Root <root>
Component: kernAssignee: Greg Lehey <grog>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1-STABLE   
Hardware: Any   
OS: Any   

Description Charlie Root 2000-08-18 16:00:04 UTC
  The command "vinum create -f /var/tmp/vinum.conf" causes a kernel panic
  when accessing a drive set up using the "disklabel" command, and not
  /stand/sysinstall :

	<root@birch:~> # vinum create -f /var/tmp/vinum.conf 
	Fatal double fault:
	eip = 0xc02f18e9
	esp = 0xd6affd7c
	ebp = 0xd6affd90
	panic: double fault
	Debugger("panic")
	Stopped at      Debugger+0x34:  movb    $0,0xc03b3be0
	db> trace
	Debugger(c03328a3) at Debugger+0x34
	panic(c0360043,c03605f0,d6affd90,c03605e4,d6affd7c) at panic+0x70
	dblfault_handler(0,0,0,0,0) at dblfault_handler+0x47

  vinum.conf:
	drive d1 device /dev/da1s1e
	volume tmpvol
	  plex name tmpvol.p0 org concat
	    sd name tmpvol.p0.s0 length 1g drive d1

Fix: 

1) Use /stand/sysinstall fdisk to label the disk (I selected "Use entire 
	   partition", type 165 ). 
	2) disklabel -e -r daX , create vinum partition 
	3) run "vinum create"
How-To-Repeat: 
	$ ( cd /dev ; ./MAKEDEV da1s1a )
	$ disklabel -w -r da1 auto
	$ disklabel -e -r da1

	  Resulting disklabel:
	    # /dev/da1c:
	    type: SCSI
	    disk: IBM     
	    label: 
	    flags:
	    bytes/sector: 512
	    sectors/track: 63
	    tracks/cylinder: 255
	    sectors/cylinder: 16065
	    cylinders: 4462
	    sectors/unit: 71687340
	    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]
	    c: 71687340        0    unused        0     0         # (Cyl.    0 - 4462*)
	    e: 71687340        0     vinum                        # (Cyl.    0 - 4462*)

	$ vinum create -f /var/tmp/vinum.conf

  One of three things have been observed at this point:

	1) kernel panic
	2) vinum dumps core (I still have the core file)
	3) creation of volume with faulty objects, message "Device da1s1e not configured"

  However, when the disk config is viewed using /stand/sysinstall fdisk, the partition
  is listed as "unused". Apparently, more needs to be done using disklabel, or 
  /stand/sysinstall must be used to set up disks.
Comment 1 Greg Lehey freebsd_committer freebsd_triage 2000-08-19 03:03:33 UTC
Responsible Changed
From-To: freebsd-bugs->grog

grog handles Vinum PRs
Comment 2 Greg Lehey freebsd_committer freebsd_triage 2000-08-19 03:08:59 UTC
State Changed
From-To: open->feedback

Waiting for feedback from submitter
Comment 3 Greg Lehey freebsd_committer freebsd_triage 2000-08-20 05:59:59 UTC
State Changed
From-To: feedback->closed

Problem solved.