Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Oct 2010 22:51:36 -0700
From:      perryh@pluto.rain.com
To:        jamesbrandongooch@gmail.com
Cc:        amvandemore@gmail.com, freebsd-questions@freebsd.org
Subject:   partitioning a gmirror (was Re: sysinstall vs gmirror)
Message-ID:  <4ca96b68.fFmxfwUIuD5a2uLJ%perryh@pluto.rain.com>
In-Reply-To: <AANLkTimW64zetEoFi7Or1sP8zggmqWyKunmVEzGJi8%2Bv@mail.gmail.com>
References:  <4c83190a.SG%2BLIhPWaGtmaaeL%perryh@pluto.rain.com> <4C835474.7060707@infracaninophile.co.uk> <4c8487cc.Rh42YL91jTIv09e0%perryh@pluto.rain.com> <4c84ce46.sHyLaI%2BH%2BUzM%2BJ/y%perryh@pluto.rain.com> <4c8c5260.%2BCOCCpHgloxRSY2/%perryh@pluto.rain.com> <4C8CD2A4.3020203@infracaninophile.co.uk> <4c8da53d.pPK/NzHAHPlQPOfh%perryh@pluto.rain.com> <AANLkTimJ-fidbrRPYGynHLQj1-1nqo=-byo9zxXCK049@mail.gmail.com> <4c943b69.bsyYirMmUuB/1m0g%perryh@pluto.rain.com> <AANLkTimK=y-V0sBt-Z3LqOBi9KSEABSATdYdFNC5ZruZ@mail.gmail.com> <4c945a3f.3BNAtV%2BUuZ%2BM1RW2%perryh@pluto.rain.com> <AANLkTimW64zetEoFi7Or1sP8zggmqWyKunmVEzGJi8%2Bv@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Getting back to this after a couple of weeks of $work & $life.

Brandon Gooch <jamesbrandongooch@gmail.com> wrote:
> On Sat, Sep 18, 2010 at 1:20 AM,  <perryh@pluto.rain.com> wrote:
> > Adam Vande More <amvandemore@gmail.com> wrote:
> [SNIP]
> > The question is, how do I go about partitioning gm0 from Fixit?
> > I've seen nothing so far that describes how to go about creating
> > multiple partitions on a gmirror (or on anything else, for that
> > matter) without either using sysinstall or having to understand
> > gpart.
>
> I've used something like this from the Fixit console (using
> /dev/ad0 as an example):
>
> Fixit# kldload /dist/boot/kernel/geom_mirror.ko
> Fixit# gmirror -v -b round-robin gm0 /dev/ad0
> Fixit# fdisk -v -B -I /dev/mirror/gm0
> Fixit# bsdlabel -w -B /dev/mirror/gm0s1
> ...

The fdisk step does not work for me using the 8.1 memstick.

It looks as if I may have reached a dead end, but can
anyone identify where I missed a turn?  History, all in
http://lists.freebsd.org/pipermail/freebsd-questions/2010-September
221253.html, 221275.html, 221283.html, 221501.html, 221672.html

Details of the latest attempt:

I've created the 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.

The following is a script(1) starting when I first boot into Fixit#
from a 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, 199=
4
=09The 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@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 =3D "GenuineIntel"  Id =3D 0x683  Family =3D 6  Model =3D 8  S=
tepping =3D 3
  Features=3D0x383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR=
,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
real memory  =3D 536870912 (512 MB)
avail memory =3D 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 0xf8fffc=
00-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 devi=
ce 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 0x=
fafff000-0xfaffffff irq 18 at device 10.0 on pci3
ahc0: [ITHREAD]
aic7899: Ultra160 Wide Channel A, SCSI Id=3D7, 32/253 SCBs
ahc1: <Adaptec aic7899 Ultra160 SCSI adapter> port 0xe800-0xe8ff mem 0x=
faffe000-0xfaffefff irq 19 at device 10.1 on pci3
ahc1: [ITHREAD]
aic7899: Ultra160 Wide Channel B, SCSI Id=3D7, 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-0x1=
77,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 a=
t device 31.2 on pci0
uhci0: [ITHREAD]
uhci0: LegSup =3D 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 a=
cpi0
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,0xce00=
0-0xcffff pnpid ORM0000 on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=3D0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on is=
a0
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=
=20
ugen0.1: <Intel> at usbus0
uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus=
0
ad1: 32253MB <MAXTOR 6L040L2 A93.0500> at ata0-slave UDMA66=20
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.0=
0, addr 2> on usbus0
umass0:  SCSI over Bulk-Only; quirks =3D 0x0000
acd0: CDROM <Lite-On LTN483S 48x Max/PD02> at ata1-slave PIO4=20
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=
=20
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=20
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=
=20
da1: 1.000MB/s transfers
da1: 960MB (1967616 512 byte sectors: 64H 32S/T 960C)
GEOM: ad0s2: geometry does not match label (255h,63s !=3D 16h,63s).
GEOM: ad8s2: geometry does not match label (255h,63s !=3D 16h,63s).
GEOM: da1: geometry does not match label (255h,63s !=3D 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
Fixit# dmesg | tail -5
GEOM: da1: geometry does not match label (255h,63s !=3D 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=3D17).

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=20
  b:  2097152 619907518      swap                   =20
  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 syst=
em utilities
! evidently gm0 does not contain a _valid_ bsdlabel.

! Just in case the additional info is useful ...
Fixit# bsdlabel -A /dev/mirror/gm0
# /dev/mirror/gm0:
type: ESDI
disk: ad0s2
label:=20
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=09=09# milliseconds
track-to-track seek: 0=09# milliseconds
drivedata: 0=20

8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a: 619907518        0    4.2BSD        0     0     0=20
  b:  2097152 619907518      swap                   =20
  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 syst=
em utilities

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 bsdlab=
el?

! 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=3D38587 heads=3D255 sectors/track=3D63 (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=3D38587 heads=3D255 sectors/track=3D63 (16065 blks/cyl)

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

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=08=08
Script done on Mon Oct  4 03:48:31 2010



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4ca96b68.fFmxfwUIuD5a2uLJ%perryh>