Subdividing a gmirror

perryh at pluto.rain.com perryh at pluto.rain.com
Sun Oct 17 03:29:00 UTC 2010


How does one go about subdividing a gmirror?

Using the 8.1 memstick distribution, I've created a gmirror (which
currently contains only one provider -- the other is to be added
later), and Fixit can see /dev/mirror/gm0* once I've executed
"gmirror load", but neither gpart nor fdisk seems to recognize gm0
as something on which it can operate.  bsdlabel sees _something_,
but it appears not to be valid.

The following is a script(1) starting when I first boot into Fixit#
from the memstick.  I've inserted a blank line ahead of each command
to simplify skipping over output that may not be relevant, and I've
inserted some commentary (lines starting with !).  The disk already
contains the gmirror metadata (created during a previous attempt).

Script started on Mon Oct  4 03:42:54 2010

Fixit# dmesg
Copyright (c) 1992-2010 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010
    root at almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel Pentium III (731.47-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x683  Family = 6  Model = 8  Stepping = 3
  Features=0x383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
real memory  = 536870912 (512 MB)
avail memory = 506056704 (482 MB)
ACPI APIC Table: <DELL   WS 420 >
ioapic0: Changing APIC ID to 1
ioapic0 <Version 2.0> irqs 0-23 on motherboard
kbd1 at kbdmux0
acpi0: <DELL WS 420 > on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
acpi0: reservation of 0, a0000 (3) failed
acpi0: reservation of 100000, f00000 (3) failed
acpi0: reservation of 1000000, 1ef9e000 (3) failed
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
cpu0: <ACPI CPU> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
agp0: <Intel 82840 host to AGP bridge> on hostb0
pcib1: <PCI-PCI bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
vgapci0: <VGA-compatible display> mem 0xf4000000-0xf5ffffff,0xfcffc000-0xfcffffff,0xfc000000-0xfc7fffff irq 16 at device 0.0 on pci1
pcib2: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci2: <ACPI PCI bus> on pcib2
xl0: <3Com 3c905C-TX Fast Etherlink XL> port 0xdc80-0xdcff mem 0xf8fffc00-0xf8fffc7f irq 16 at device 4.0 on pci2
miibus0: <MII bus> on xl0
xlphy0: <3c905C 10/100 internal PHY> PHY 24 on miibus0
xlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
xl0: Ethernet address: 00:b0:d0:22:5a:14
xl0: [ITHREAD]
pci2: <multimedia, audio> at device 6.0 (no driver attached)
atapci0: <VIA 6421 SATA150 controller> port 0xdc70-0xdc7f,0xdc50-0xdc5f,0xdc30-0xdc3f,0xdc10-0xdc1f,0xd8e0-0xd8ff,0xd400-0xd4ff irq 19 at device 11.0 on pci2
atapci0: [ITHREAD]
ata2: <ATA channel 0> on atapci0
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci0
ata3: [ITHREAD]
ata4: <ATA channel 2> on atapci0
ata4: [ITHREAD]
pcib3: <PCI-PCI bridge> at device 14.0 on pci2
pci3: <PCI bus> on pcib3
ahc0: <Adaptec aic7899 Ultra160 SCSI adapter> port 0xec00-0xecff mem 0xfafff000-0xfaffffff irq 18 at device 10.0 on pci3
ahc0: [ITHREAD]
aic7899: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
ahc1: <Adaptec aic7899 Ultra160 SCSI adapter> port 0xe800-0xe8ff mem 0xfaffe000-0xfaffefff irq 19 at device 10.1 on pci3
ahc1: [ITHREAD]
aic7899: Ultra160 Wide Channel B, SCSI Id=7, 32/253 SCBs
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci1: <Intel ICH UDMA66 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xffa0-0xffaf at device 31.1 on pci0
ata0: <ATA channel 0> on atapci1
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci1
ata1: [ITHREAD]
uhci0: <Intel 82801AA (ICH) USB controller> port 0xff80-0xff9f irq 19 at device 31.2 on pci0
uhci0: [ITHREAD]
uhci0: LegSup = 0x2f00
usbus0: <Intel 82801AA (ICH) USB controller> on uhci0
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
atrtc0: <AT realtime clock> port 0x70-0x7f irq 8 on acpi0
fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: [FILTER]
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: [ITHREAD]
psm0: model Generic PS/2 mouse, device ID 0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: [FILTER]
uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0
uart1: [FILTER]
ppc0: <Parallel port> port 0x378-0x37f,0x778-0x77f irq 7 on acpi0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/8 bytes threshold
ppc0: [ITHREAD]
ppbus0: <Parallel port bus> on ppc0
plip0: <PLIP network interface> on ppbus0
plip0: [ITHREAD]
lpt0: <Printer> on ppbus0
lpt0: [ITHREAD]
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
pmtimer0 on isa0
orm0: <ISA Option ROMs> at iomem 0xc0000-0xc7fff,0xc8000-0xcdfff,0xce000-0xcffff pnpid ORM0000 on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounter "TSC" frequency 731469967 Hz quality 800
Timecounters tick every 1.000 msec
md0: Preloaded image </boot/mfsroot> 4423680 bytes at 0xc0fb5504
usbus0: 12Mbps Full Speed USB v1.0
ad0: 305245MB <Hitachi HDT725032VLAT80 V54OA4NA> at ata0-master UDMA66 
ugen0.1: <Intel> at usbus0
uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ad1: 32253MB <MAXTOR 6L040L2 A93.0500> at ata0-slave UDMA66 
uhub0: 2 ports with 2 removable, self powered
device_attach: afd0 attach returned 6
ugen0.2: <vendor 0x0457> at usbus0
umass0: <vendor 0x0457 USB Mass Storage Device, class 0/0, rev 2.00/1.00, addr 2> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x0000
acd0: CDROM <Lite-On LTN483S 48x Max/PD02> at ata1-slave PIO4 
ad4: 61136MB <PATRIOT MEMORY 64GB SSD 02.10104> at ata2-master UDMA100 SATA 1.5Gb/s
acd1: DVDR <PIONEER DVD-RW DVR-212D/1.24> at ata3-master UDMA66 SATA 1.5Gb/s
ad8: 305245MB <Hitachi HDT725032VLAT80 V54OA4NA> at ata4-master UDMA133 
umass0:2:0:-1: Attached to scbus2
da0 at ahc0 bus 0 scbus0 target 0 lun 0
da0: <FUJITSU MAG3091MP 5506> Fixed Direct Access SCSI-3 device 
da0: 160.000MB/s transfers (80.000MHz DT, offset 127, 16bit)
da0: Command Queueing enabled
da0: 8683MB (17783249 512 byte sectors: 255H 63S/T 1106C)
da1 at umass-sim0 bus 0 scbus2 target 0 lun 0
da1: <UDISK PDU16_1G 61G2.0 0.00> Removable Direct Access SCSI-2 device 
da1: 1.000MB/s transfers
da1: 960MB (1967616 512 byte sectors: 64H 32S/T 960C)
GEOM: ad0s2: geometry does not match label (255h,63s != 16h,63s).
GEOM: ad8s2: geometry does not match label (255h,63s != 16h,63s).
GEOM: da1: geometry does not match label (255h,63s != 64h,32s).
GEOM: da1: media size does not match label.
Trying to mount root from ufs:/dev/md0

! make *.ko available
Fixit# ln -s /dist/boot/kernel /boot

Fixit# gmirror load

! see what "gmirror load" appended to dmesg.  I know from watching
! the console that it was only 3 lines, so "tail -5" will provide
! 2 lines of overlap with the previous listing.
Fixit# dmesg | tail -5
GEOM: da1: geometry does not match label (255h,63s != 64h,32s).
GEOM: da1: media size does not match label.
Trying to mount root from ufs:/dev/md0
GEOM_MIRROR: Device mirror/gm0 launched (1/1).
GEOM_MIRROR: Cannot add disk ad0s2a to gm0 (error=17).

Fixit# ls -la /dev/mirror
total 1
dr-xr-xr-x  2 root  0              512 Oct  4 03:44 .
dr-xr-xr-x  9 root  0              512 Oct  4 03:42 ..
crw-r-----  1 root  operator    0,  80 Oct  4 03:43 gm0
crw-r-----  1 root  operator    0, 125 Oct  4 03:43 gm0a
crw-r-----  1 root  operator    0, 126 Oct  4 03:43 gm0b
! so the mirror does exist, despite the "Cannot add" message.

Fixit# bsdlabel /dev/mirror/gm0
# /dev/mirror/gm0:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a: 619907518        0    4.2BSD        0     0     0 
  b:  2097152 619907518      swap                    
  c: 622004670        0    unused        0     0         # "raw" part, don't edit
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
bsdlabel: partition c doesn't cover the whole unit!
bsdlabel: An incorrect partition c may cause problems for standard system utilities
! evidently gm0 does not contain a _valid_ bsdlabel.

! Again, with -A, just in case the additional info is useful.
Fixit# bsdlabel -A /dev/mirror/gm0
# /dev/mirror/gm0:
type: ESDI
disk: ad0s2
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 38913
sectors/unit: 625142448
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: 619907518        0    4.2BSD        0     0     0 
  b:  2097152 619907518      swap                    
  c: 622004670        0    unused        0     0         # "raw" part, don't edit
bsdlabel: partition c doesn't cover the whole unit!
bsdlabel: An incorrect partition c may cause problems for standard system utilities
!note that this time there were no complaints about partitions a & b.
!dunno if this is of any significance.

Fixit# gpart show gm0
gpart: No such geom: gm0.

Fixit# gpart show /dev/mirror/gm0
gpart: No such geom: /dev/mirror/gm0.
! So gm0 evidently doesn't have a valid gpart label either.
! What is defining gm0a and gm0b, if it is neither a gpart nor a bsdlabel?

! Try to reslice & label gm0, which "should" appear to be a disk device
Fixit# fdisk -v -B -I /dev/mirror/gm0
******* Working on device /dev/mirror/gm0 *******
parameters extracted from in-core disklabel are:
cylinders=38587 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=38587 heads=255 sectors/track=63 (16065 blks/cyl)

Information from DOS bootblock is:
1: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 619900092 (302685 Meg), flag 80 (active)
	beg: cyl 0/ head 1/ sector 1;
	end: cyl 698/ head 254/ sector 63
2: <UNUSED>
3: <UNUSED>
4: <UNUSED>
fdisk: Class not found
! What does this mean?

Fixit# ls -la /dev/mirror
total 1
dr-xr-xr-x  2 root  0              512 Oct  4 03:44 .
dr-xr-xr-x  9 root  0              512 Oct  4 03:42 ..
crw-r-----  1 root  operator    0,  80 Oct  4 03:46 gm0
crw-r-----  1 root  operator    0, 125 Oct  4 03:46 gm0a
crw-r-----  1 root  operator    0, 126 Oct  4 03:46 gm0b
! The partitioning seems unchanged, but apparently something was
! written (since the timestamps have changed).  No telling what it
! may have been.

Fixit# ^D
Script done on Mon Oct  4 03:48:31 2010


More information about the freebsd-geom mailing list