From owner-freebsd-geom@FreeBSD.ORG Sun Nov 14 10:11:12 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87F16106566C for ; Sun, 14 Nov 2010 10:11:12 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [199.26.172.34]) by mx1.freebsd.org (Postfix) with ESMTP id 656CF8FC19 for ; Sun, 14 Nov 2010 10:11:12 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id oAEAB1AN029426 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 14 Nov 2010 02:11:01 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id oAEAB1SG029425 for freebsd-geom@freebsd.org; Sun, 14 Nov 2010 02:11:01 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA07581; Sun, 14 Nov 10 02:01:49 PST Date: Sun, 14 Nov 2010 02:02:01 -0800 From: perryh@pluto.rain.com To: freebsd-geom@freebsd.org Message-Id: <4cdfb399.PJLzZRQlXkRc2sl/%perryh@pluto.rain.com> References: In-Reply-To: User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: gmirror + gjournal = trouble X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Nov 2010 10:11:12 -0000 Is some special magic needed to get gmirror and gjournal to work together? Using Fixit# from the 8.1-RELEASE memstick I have defined a gmirror (currently containing only one provider; the other is to be added later), sliced it using disklabel, added a journal to each of the partitions, run newfs -J on them, and installed FreeBSD using http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror as a guide (with a few differences due to this installation being UFS rather than ZFS). In Fixit the /dev tree contained entries for both the mirror and the journal devices, but when I rebooted the mirror did not show up -- even though geom_mirror.ko was loaded. What would cause this sort of mixup, and how do I fix it? ==== contents of /dev/mirror before creating the journals Fixit# ls -la /dev/mirror total 1 dr-xr-xr-x 2 root 0 512 Nov 14 00:17 . dr-xr-xr-x 9 root 0 512 Nov 14 00:11 .. crw-r----- 1 root operator 0, 80 Nov 14 00:36 gm0 crw-r----- 1 root operator 0, 126 Nov 14 00:36 gm0a crw-r----- 1 root operator 0, 128 Nov 14 00:36 gm0d crw-r----- 1 root operator 0, 129 Nov 14 00:36 gm0e ==== corresponding disklabel report Fixit# disklabel /dev/mirror/gm0 # /dev/mirror/gm0: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 8388608 16 4.2BSD 1024 8192 16 c: 619907517 0 unused 0 0 d: 25165824 8388624 4.2BSD 0 0 0 e: 586353069 33554448 4.2BSD 0 0 0 ==== journal creation, with dmesg reports Fixit# gjournal label -s 2G /dev/mirror/gm0a GEOM_JOURNAL: Journal 1098378706: mirror/gm0a contains data. GEOM_JOURNAL: Journal 1098378706: mirror/gm0a contains journal. GEOM_JOURNAL: Journal mirror/gm0a clean. Fixit# gjournal label -s 2G /dev/mirror/gm0d GEOM_JOURNAL: Journal 3795372090: mirror/gm0d contains data. GEOM_JOURNAL: Journal 3795372090: mirror/gm0d contains journal. GEOM_JOURNAL: Journal mirror/gm0d clean. Fixit# gjournal label -s 2G /dev/mirror/gm0e GEOM_JOURNAL: Journal 2063379813: mirror/gm0e contains data. GEOM_JOURNAL: Journal 2063379813: mirror/gm0e contains journal. GEOM_JOURNAL: Journal mirror/gm0e clean. ==== contents of /dev/mirror after creating the journals Fixit# ls -la /dev/mirror total 1 dr-xr-xr-x 2 root 0 512 Nov 14 00:17 ./ dr-xr-xr-x 9 root 0 512 Nov 14 00:11 ../ crw-r----- 1 root operator 0, 80 Nov 14 02:01 gm0 crw-r----- 1 root operator 0, 78 Nov 14 02:06 gm0a crw-r----- 1 root operator 0, 126 Nov 14 02:06 gm0a.journal crw-r----- 1 root operator 0, 125 Nov 14 02:07 gm0d crw-r----- 1 root operator 0, 128 Nov 14 02:07 gm0d.journal crw-r----- 1 root operator 0, 130 Nov 14 02:07 gm0e crw-r----- 1 root operator 0, 129 Nov 14 02:07 gm0e.journal ==== newfs commands Fixit# newfs -J /dev/mirror/gm0a.journal Fixit# newfs -J /dev/mirror/gm0d.journal Fixit# newfs -J /dev/mirror/gm0e.journal ==== FS configuration after mounting, before installing Fixit# mount /dev/md0 on / (ufs, local) devfs on /dev (devfs, local, multilabel) /dev/da1a on /dist (ufs, local, read-only) /dev/mirror/gm0a.journal on /mnt (ufs, local, gjournal) /dev/ad8s2d on /mnt/tmp (ufs, local) /dev/mirror/gm0d.journal on /mnt/var (ufs, local, gjournal) /dev/mirror/gm0e.journal on /mnt/usr (ufs, local, gjournal) ==== install per http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror, ==== no detailed log kept ==== manually-created config files, still in chroot after install Fixit# cat /boot/loader.conf geom_mirror_load="YES" geom_journal_load="YES" vfs.root.mountfrom="ufs:/dev/mirror/gm0a.journal" vfs.root.mountfrom.options="rw" Fixit# cat /etc/fstab /dev/mirror/gm0a.journal / ufs rw 0 1 /dev/ad0s2b none swap sw 0 0 /dev/ad8s2b none swap sw 0 0 /dev/ad8s2d /tmp ufs rw 0 2 /dev/mirror/gm0d.journal /var ufs rw 0 3 /dev/mirror/gm0e.journal /usr ufs rw 0 4 /dev/da1a /dist ufs ro 0 0 devfs /dev devfs multilabel 0 0 ==== dmesg from booting the newly-installed system (long) 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@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 real memory = 536870912 (512 MB) avail memory = 510218240 (486 MB) ACPI APIC Table: ioapic0: Changing APIC ID to 1 ioapic0 irqs 0-23 on motherboard kbd1 at kbdmux0 acpi0: 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: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 agp0: on hostb0 pcib1: at device 1.0 on pci0 pci1: on pcib1 vgapci0: mem 0xf4000000-0xf5ffffff,0xfcffc000-0xfcffffff,0xfc000000-0xfc7fffff irq 16 at device 0.0 on pci1 pcib2: at device 30.0 on pci0 pci2: on pcib2 xl0: <3Com 3c905C-TX Fast Etherlink XL> port 0xdc80-0xdcff mem 0xf8fffc00-0xf8fffc7f irq 16 at device 4.0 on pci2 miibus0: 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: at device 6.0 (no driver attached) atapci0: port 0xdc70-0xdc7f,0xdc50-0xdc5f,0xdc30-0xdc3f,0xdc10-0xdc1f,0xd8e0-0xd8ff,0xd400-0xd4ff irq 19 at device 11.0 on pci2 atapci0: [ITHREAD] ata2: on atapci0 ata2: [ITHREAD] ata3: on atapci0 ata3: [ITHREAD] ata4: on atapci0 ata4: [ITHREAD] pcib3: at device 14.0 on pci2 pci3: on pcib3 ahc0: 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: 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: at device 31.0 on pci0 isa0: on isab0 atapci1: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xffa0-0xffaf at device 31.1 on pci0 ata0: on atapci1 ata0: [ITHREAD] ata1: on atapci1 ata1: [ITHREAD] uhci0: port 0xff80-0xff9f irq 19 at device 31.2 on pci0 uhci0: [ITHREAD] uhci0: LegSup = 0x2f00 usbus0: on uhci0 pci0: at device 31.3 (no driver attached) atrtc0: port 0x70-0x7f irq 8 on acpi0 fdc0: port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0 fdc0: [FILTER] fd0: <1440-KB 3.5" drive> on fdc0 drive 0 atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] psm0: 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: 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: on ppc0 plip0: on ppbus0 plip0: [ITHREAD] lpt0: on ppbus0 lpt0: [ITHREAD] lpt0: Interrupt-driven port ppi0: on ppbus0 pmtimer0 on isa0 orm0: at iomem 0xc0000-0xc7fff,0xc8000-0xcdfff,0xce000-0xcffff pnpid ORM0000 on isa0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 Timecounter "TSC" frequency 731470456 Hz quality 800 Timecounters tick every 1.000 msec usbus0: 12Mbps Full Speed USB v1.0 ad0: 305245MB at ata0-master UDMA66 ugen0.1: at usbus0 uhub0: on usbus0 ad1: 32253MB at ata0-slave UDMA66 uhub0: 2 ports with 2 removable, self powered GEOM: ad0s2: geometry does not match label (255h,63s != 16h,63s). GEOM: ad0s2: media size does not match label. GEOM_JOURNAL: Journal 1098378706: ad0s2a contains data. GEOM_JOURNAL: Journal 1098378706: ad0s2a contains journal. GEOM_JOURNAL: Journal ad0s2a clean. GEOM_JOURNAL: Journal 3795372090: ad0s2d contains data. GEOM_JOURNAL: Journal 3795372090: ad0s2d contains journal. GEOM_JOURNAL: Journal ad0s2d clean. GEOM_JOURNAL: Journal 2063379813: ad0s2e contains data. GEOM_JOURNAL: Journal 2063379813: ad0s2e contains journal. GEOM_JOURNAL: Journal ad0s2e clean. device_attach: afd0 attach returned 6 ugen0.2: at usbus0 umass0: on usbus0 umass0: SCSI over Bulk-Only; quirks = 0x0000 acd0: CDROM at ata1-slave PIO4 ad4: 61136MB at ata2-master UDMA100 SATA 1.5Gb/s acd1: DVDR at ata3-master UDMA66 SATA 1.5Gb/s ad8: 305245MB at ata4-master UDMA133 umass0:2:0:-1: Attached to scbus2 GEOM: ad8s2: geometry does not match label (255h,63s != 16h,63s). da0 at ahc0 bus 0 scbus0 target 0 lun 0 da0: 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: Removable Direct Access SCSI-2 device da1: 1.000MB/s transfers da1: 960MB (1967616 512 byte sectors: 64H 32S/T 960C) 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/mirror/gm0a.journal ROOT MOUNT ERROR: If you have invalid mount options, reboot, and first try the following from the loader prompt: set vfs.root.mountfrom.options=rw and then remove invalid mount options from /etc/fstab. Loader variables: vfs.root.mountfrom=ufs:/dev/mirror/gm0a.journal vfs.root.mountfrom.options=rw Manual root filesystem specification: : Mount using filesystem eg. ufs:/dev/da0s1a eg. cd9660:/dev/acd0 This is equivalent to: mount -t cd9660 /dev/acd0 / ? List valid disk boot devices Abort manual input mountroot> ? List of GEOM managed disk devices: da1a ext2fs// ext2fs//boot da1 da0s3 da0s2 da0s1 da0 ufsid/4cdf4dff8de0837d ufsid/4c830a972b034290 ad8s2d ad8s2b ad8s2a ad8s2 ad8s1 ad8 iso9660/FreeBSD_Packages acd1t01 acd1 ad4 acd0 ufsid/4cdf45a2759357b0 ufsid/4cdf4594fac31a50 ufsid/4cdf4582119b5b07 ad0s2e.journal ad0s2d.journal ad0s2a.journal ad0s2e ad0s2d ad0s2a ad0s2 ad0s1 ad1 ad0 fd0 Loader variables: vfs.root.mountfrom=ufs:/dev/mirror/gm0a.journal vfs.root.mountfrom.options=rw Manual root filesystem specification: : Mount using filesystem eg. ufs:/dev/da0s1a eg. cd9660:/dev/acd0 This is equivalent to: mount -t cd9660 /dev/acd0 / ? List valid disk boot devices Abort manual input mountroot> ufs:ad0s2a.journal Trying to mount root from ufs:ad0s2a.journal ==== Why are the journals now reported on the ad0s2*? ==== output from kldstat Id Refs Address Size Name 1 6 0xc0400000 bb5504 kernel 2 1 0xc0fb6000 14540 geom_journal.ko 3 1 0xc0fcb000 16ed4 geom_mirror.ko ==== geom_mirror.ko _is_ loaded, but what happened to the gmirror? ==== output from df, after manually mounting /usr & /var read-only ==== -- I don't want to try writing to them until the mirror mess ==== is cleaned up -- and /tmp read-write (so I have someplace to ==== save stuff) Filesystem 512-blocks Used Avail Capacity Mounted on ad0s2a.journal 4052056 345948 3381944 9% / devfs 2 2 0 100% /dev /dev/ad0s2e.journal 563842072 2371628 516363080 0% /usr /dev/ad0s2d.journal 20308312 392 18683256 0% /var /dev/ad8s2d 2001180 36 1841052 0% /tmp ==== result of "ls -alR /dev" -- incl a mysterious line on stderr ls: : No such file or directory total 10 dr-xr-xr-x 7 root wheel 512 Nov 13 20:21 . drwxr-xr-x 18 root wheel 512 Jul 18 19:57 .. crw-r----- 1 root operator 0, 98 Nov 13 20:21 acd0 crw-r----- 1 root operator 0, 100 Nov 13 20:21 acd1 crw-r----- 1 root operator 0, 101 Nov 13 20:21 acd1t01 crw-r--r-- 1 root wheel 0, 34 Nov 13 20:21 acpi crw-r----- 1 root operator 0, 80 Nov 13 20:21 ad0 crw-r----- 1 root operator 0, 82 Nov 13 20:21 ad0s1 crw-r----- 1 root operator 0, 83 Nov 13 20:21 ad0s2 crw-r----- 1 root operator 0, 84 Nov 13 20:21 ad0s2a crw-r----- 1 root operator 0, 87 Nov 13 20:21 ad0s2a.journal crw-r----- 1 root operator 0, 85 Nov 13 20:21 ad0s2d crw-r----- 1 root operator 0, 88 Nov 13 20:21 ad0s2d.journal crw-r----- 1 root operator 0, 86 Nov 13 20:21 ad0s2e crw-r----- 1 root operator 0, 89 Nov 13 20:21 ad0s2e.journal crw-r----- 1 root operator 0, 81 Nov 13 20:21 ad1 crw-r----- 1 root operator 0, 99 Nov 13 20:21 ad4 crw-r----- 1 root operator 0, 103 Nov 13 20:21 ad8 crw-r----- 1 root operator 0, 104 Nov 13 20:21 ad8s1 crw-r----- 1 root operator 0, 105 Nov 13 20:21 ad8s2 crw-r----- 1 root operator 0, 106 Nov 13 20:21 ad8s2a crw-r----- 1 root operator 0, 107 Nov 13 20:21 ad8s2b crw-r----- 1 root operator 0, 108 Nov 13 20:21 ad8s2d crw------- 1 root wheel 0, 35 Nov 13 20:21 agpgart crw------- 1 root operator 0, 33 Nov 13 20:21 ata crw------- 1 root wheel 0, 36 Nov 13 20:21 atkbd0 crw------- 1 root kmem 0, 21 Nov 13 20:21 audit crw------- 1 root wheel 0, 14 Nov 13 20:21 bpf lrwxr-xr-x 1 root wheel 3 Nov 13 20:21 bpf0 -> bpf crw-rw-rw- 1 root wheel 0, 39 Nov 13 20:21 bpsm0 crw------- 1 root wheel 0, 5 Nov 13 20:55 console crw------- 1 root wheel 0, 71 Nov 13 20:21 consolectl crw-rw-rw- 1 root wheel 0, 11 Nov 13 20:21 ctty crw-rw---- 1 uucp dialer 0, 43 Nov 13 20:21 cuau0 crw-rw---- 1 uucp dialer 0, 44 Nov 13 20:21 cuau0.init crw-rw---- 1 uucp dialer 0, 45 Nov 13 20:21 cuau0.lock crw-rw---- 1 uucp dialer 0, 49 Nov 13 20:21 cuau1 crw-rw---- 1 uucp dialer 0, 50 Nov 13 20:21 cuau1.init crw-rw---- 1 uucp dialer 0, 51 Nov 13 20:21 cuau1.lock crw-r----- 1 root operator 0, 113 Nov 13 20:21 da0 crw-r----- 1 root operator 0, 114 Nov 13 20:21 da0s1 crw-r----- 1 root operator 0, 115 Nov 13 20:21 da0s2 crw-r----- 1 root operator 0, 116 Nov 13 20:21 da0s3 crw-r----- 1 root operator 0, 117 Nov 13 20:21 da1 crw-r----- 1 root operator 0, 120 Nov 13 20:21 da1a crw------- 1 root wheel 0, 17 Nov 13 20:21 dcons crw------- 1 root wheel 0, 4 Nov 13 20:21 devctl cr-------- 1 root wheel 0, 75 Nov 13 20:21 devstat crw------- 1 root wheel 0, 18 Nov 13 20:21 dgdb dr-xr-xr-x 3 root wheel 512 Nov 13 20:21 ext2fs dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 fd crw-r----- 1 root operator 0, 79 Nov 13 20:21 fd0 crw------- 1 root wheel 0, 19 Nov 13 20:21 fido crw-r----- 1 root operator 0, 3 Nov 13 20:21 geom.ctl crw------- 1 root wheel 0, 28 Nov 13 20:21 io dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 iso9660 lrwxr-xr-x 1 root wheel 6 Nov 13 20:21 kbd0 -> atkbd0 lrwxr-xr-x 1 root wheel 7 Nov 13 20:21 kbd1 -> kbdmux0 crw------- 1 root wheel 0, 29 Nov 13 20:21 kbdmux0 crw------- 1 root wheel 0, 8 Nov 13 20:21 klog crw-r----- 1 root kmem 0, 32 Nov 13 20:21 kmem crw------- 1 root wheel 0, 52 Nov 13 20:21 lpt0 crw------- 1 root wheel 0, 53 Nov 13 20:21 lpt0.ctl crw------- 1 root wheel 0, 74 Nov 13 20:21 mdctl crw-r----- 1 root kmem 0, 31 Nov 13 20:21 mem crw------- 1 root kmem 0, 20 Nov 13 20:21 nfslock crw-rw-rw- 1 root wheel 0, 6 Nov 13 20:23 null crw------- 1 root operator 0, 111 Nov 13 20:21 pass0 crw------- 1 root operator 0, 112 Nov 13 20:21 pass1 crw-r--r-- 1 root wheel 0, 9 Nov 13 20:21 pci crw------- 1 root wheel 0, 54 Nov 13 20:21 ppi0 crw-rw-rw- 1 root wheel 0, 38 Nov 13 20:21 psm0 crw-rw-rw- 1 root wheel 0, 10 Nov 13 20:21 ptmx crw-rw-rw- 1 root wheel 0, 12 Nov 13 20:23 random lrwxr-xr-x 1 root wheel 4 Nov 13 20:21 stderr -> fd/2 lrwxr-xr-x 1 root wheel 4 Nov 13 20:21 stdin -> fd/0 lrwxr-xr-x 1 root wheel 4 Nov 13 20:21 stdout -> fd/1 crw------- 1 root wheel 0, 16 Nov 13 20:21 sysmouse crw------- 1 root wheel 0, 40 Nov 13 20:21 ttyu0 crw------- 1 root wheel 0, 41 Nov 13 20:21 ttyu0.init crw------- 1 root wheel 0, 42 Nov 13 20:21 ttyu0.lock crw------- 1 root wheel 0, 46 Nov 13 20:21 ttyu1 crw------- 1 root wheel 0, 47 Nov 13 20:21 ttyu1.init crw------- 1 root wheel 0, 48 Nov 13 20:21 ttyu1.lock crw------- 1 root wheel 0, 55 Nov 13 20:21 ttyv0 crw------- 1 root wheel 0, 56 Nov 13 20:21 ttyv1 crw------- 1 root wheel 0, 57 Nov 13 20:21 ttyv2 crw------- 1 root wheel 0, 58 Nov 13 20:21 ttyv3 crw------- 1 root wheel 0, 59 Nov 13 20:21 ttyv4 crw------- 1 root wheel 0, 60 Nov 13 20:21 ttyv5 crw------- 1 root wheel 0, 61 Nov 13 20:21 ttyv6 crw------- 1 root wheel 0, 62 Nov 13 20:21 ttyv7 crw------- 1 root wheel 0, 63 Nov 13 20:21 ttyv8 crw------- 1 root wheel 0, 64 Nov 13 20:21 ttyv9 crw------- 1 root wheel 0, 65 Nov 13 20:21 ttyva crw------- 1 root wheel 0, 66 Nov 13 20:21 ttyvb crw------- 1 root wheel 0, 67 Nov 13 20:21 ttyvc crw------- 1 root wheel 0, 68 Nov 13 20:21 ttyvd crw------- 1 root wheel 0, 69 Nov 13 20:21 ttyve crw------- 1 root wheel 0, 70 Nov 13 20:21 ttyvf dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 ufsid lrwxr-xr-x 1 root wheel 9 Nov 13 20:21 ugen0.1 -> usb/0.1.0 lrwxr-xr-x 1 root wheel 9 Nov 13 20:21 ugen0.2 -> usb/0.2.0 lrwxr-xr-x 1 root wheel 6 Nov 13 20:21 urandom -> random dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 usb crw-r--r-- 1 root operator 0, 72 Nov 13 20:21 usbctl crw------- 1 root operator 0, 73 Nov 13 20:21 xpt0 crw-rw-rw- 1 root wheel 0, 7 Nov 13 20:21 zero /dev/ext2fs: total 2 dr-xr-xr-x 3 root wheel 512 Nov 13 20:21 . dr-xr-xr-x 7 root wheel 512 Nov 13 20:21 .. /dev/fd: total 2 dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 . dr-xr-xr-x 7 root wheel 512 Nov 13 20:21 .. crw-rw-rw- 1 root wheel 0, 22 Nov 13 20:21 0 crw-rw-rw- 1 root wheel 0, 24 Nov 13 20:21 1 crw-rw-rw- 1 root wheel 0, 26 Nov 13 20:21 2 /dev/iso9660: total 2 dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 . dr-xr-xr-x 7 root wheel 512 Nov 13 20:21 .. crw-r----- 1 root operator 0, 102 Nov 13 20:21 FreeBSD_Packages /dev/ufsid: total 2 dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 . dr-xr-xr-x 7 root wheel 512 Nov 13 20:21 .. crw-r----- 1 root operator 0, 109 Nov 13 20:21 4c830a972b034290 crw-r----- 1 root operator 0, 90 Nov 13 20:21 4cdf4582119b5b07 crw-r----- 1 root operator 0, 91 Nov 13 20:21 4cdf4594fac31a50 crw-r----- 1 root operator 0, 92 Nov 13 20:21 4cdf45a2759357b0 /dev/usb: total 2 dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 . dr-xr-xr-x 7 root wheel 512 Nov 13 20:21 .. crw------- 1 root operator 0, 76 Nov 13 20:21 0.1.0 crw------- 1 root operator 0, 78 Nov 13 20:21 0.1.1 crw------- 1 root operator 0, 93 Nov 13 20:21 0.2.0 crw------- 1 root operator 0, 95 Nov 13 20:21 0.2.1 crw------- 1 root operator 0, 96 Nov 13 20:21 0.2.2 crw------- 1 root operator 0, 97 Nov 13 20:21 0.2.3 ==== end From owner-freebsd-geom@FreeBSD.ORG Mon Nov 15 09:27:40 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 533C7106566C for ; Mon, 15 Nov 2010 09:27:40 +0000 (UTC) (envelope-from bsemene@cyanide-studio.com) Received: from relay.cyanide-studio.com (relay.cyanide-studio.com [91.121.7.6]) by mx1.freebsd.org (Postfix) with ESMTP id E0A958FC13 for ; Mon, 15 Nov 2010 09:27:39 +0000 (UTC) Received: from mail.cyanide-studio.com (unknown [62.73.7.64]) by relay.cyanide-studio.com (Postfix) with ESMTP id 8C4F0965AE4 for ; Mon, 15 Nov 2010 09:27:38 +0000 (UTC) Received: from localhost (unknown [10.1.8.14]) by mail.cyanide-studio.com (Postfix) with ESMTP id E698717BF442 for ; Mon, 15 Nov 2010 10:27:16 +0100 (CET) Received: from mail.cyanide-studio.com ([10.1.8.3]) by localhost (mailguard.cyanide-studio.com [10.1.8.14]) (amavisd-maia, port 10024) with ESMTP id 03094-08 for ; Mon, 15 Nov 2010 10:27:16 +0100 (CET) Received: from [10.1.8.96] (unknown [10.1.8.96]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: bsemene@cyanide-studio.com) by mail.cyanide-studio.com (Postfix) with ESMTP id B9EE817BF43C for ; Mon, 15 Nov 2010 10:27:16 +0100 (CET) Message-ID: <4CE0FD0B.2010700@cyanide-studio.com> Date: Mon, 15 Nov 2010 10:27:39 +0100 From: Bastien Semene User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: freebsd-geom@FreeBSD.ORG References: <201011101839.oAAIdTpo062692@lurza.secnetix.de> In-Reply-To: <201011101839.oAAIdTpo062692@lurza.secnetix.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: Subject: Re: Newbie RAID 0 question X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2010 09:27:40 -0000 Thank you both for the fast answer. If I'm understanding well, I can add space with gconcat (8) but there will be two separate stripings, in your example datas will be stripped between ad0/ad1 and when space is full between ad2/ad3 ? I'm using RAID-1+0 structure, so I think I can do the work with 2 arrays (old one with datas, new one with datas and more space). Do you see some advantage/disadvantage using the gconcat model instead of a true striping ? There will maybe have some performances differences, but I don't care that much as the server is far to be (and should never be) overloaded. Is it planned that geom will add an insert command, or is gconcat the definitive solution ? Le 10/11/2010 19:39, Oliver Fromme a écrit : > Bastien Semene wrote: > > Is there a way to add a component to an existing RAID 0 array ? > > There are several ways in FreeBSD to create a RAID-0 array. > Since you're posting to freebsd-geom, I assume that you are > talking about gstripe(8). If you mean something else, then > please be more specific. > > As far as I know, you cannot directly add a new provider to > an existing gstripe volume. This would be technically > difficult, because the stripes are spread evenly across the > existing providers. Adding a new provider would require > changing the stripe distribution, which means rewriting > large parts of the existing providers. > > However, you can add a new provider to a gconcat(8) volume > (there's even an example for that in the manual page). > gconcat simply concatenates its providers without striping > (thus it's not RAID-0). > > So, basically you can add space to an existing gstripe by > creating another gstripe containing the new disks, and then > combine the two gstripes with gconcat. For example: > > gstripe1<-- /dev/ad0 + /dev/ad1 (old) > gstripe2<-- /dev/ad2 + /dev/ad3 (new) > gconcat<-- gstripe1 + gstripe2 > > Depending on your partition layout, you will have to modify > the partition table (BSD label, GPT) to increase the size > of the partition, and then use growfs(8) to resize the > file system contained in the partition. > > Of course, you could also dump(8) your data (or copy it > elsewhere), then recreate everything from scratch, and > finally restore(8) your data (or copy it back). > > And of course you should have a good backup in either case, > no matter which approach you choose. > > Best regards > Oliver > -- Bastien Semene Administrateur Réseau& Système Cyanide Studio - FRANCE From owner-freebsd-geom@FreeBSD.ORG Mon Nov 15 11:06:56 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78CA91065694 for ; Mon, 15 Nov 2010 11:06:56 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 65C878FC14 for ; Mon, 15 Nov 2010 11:06:56 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oAFB6uCl086289 for ; Mon, 15 Nov 2010 11:06:56 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oAFB6tls086287 for freebsd-geom@FreeBSD.org; Mon, 15 Nov 2010 11:06:55 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 15 Nov 2010 11:06:55 GMT Message-Id: <201011151106.oAFB6tls086287@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-geom@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-geom@FreeBSD.org X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2010 11:06:56 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o bin/151252 geom [geom] libgeom(3) manual page contains broken link in o kern/150858 geom [geom] [geom_label] [patch] glabel(8) is not compatibl o kern/150626 geom [geom] [gjournal] gjournal(8) destroys label o kern/150555 geom [geom] gjournal unusable on GPT partitions o kern/150334 geom [geom] [udf] [patch] geom label does not support UDF o kern/149762 geom volume labels with rogue characters o bin/149215 geom [panic] [geom_part] gpart(8): Delete linux's slice via o kern/147852 geom [geom] [panic] graid3 panic: wrong offset 16384 for se o kern/147851 geom [geom] [panic] graid3 panic: g_read_data: invalid leng o kern/147667 geom [gmirror] Booting with one component of a gmirror, the o kern/147664 geom [geom] [patch] Add the ability to create linux and fat o kern/145818 geom [geom] geom_stat_open showing cached information for n o kern/145042 geom [geom] System stops booting after printing message "GE o kern/144962 geom [geom] panic when accessing GPT disk with a large numb o kern/144905 geom [geom][geom_part] panic in gpart_ctlreq when unpluggin o kern/143455 geom gstripe(8) in RELENG_8 (31st Jan 2010) broken o kern/142563 geom [geom] [hang] ioctl freeze in zpool f kern/142365 geom [geom] FreeBSD RAID1 (gmirror) is much slower than Lin o kern/141740 geom [geom] gjournal(8): g_journal_destroy concurrent error s kern/141235 geom [geom_part] 8.0 no longer provides /dev entries for al o kern/140352 geom [geom] gjournal + glabel not working o kern/135898 geom [geom] Severe filesystem corruption - large files or l o kern/134922 geom [gmirror] [panic] kernel panic when use fdisk on disk o kern/134113 geom [geli] Problem setting secondary GELI key o kern/134044 geom [geom] gmirror(8) overwrites fs with stale data from r o kern/133931 geom [geli] [request] intentionally wrong password to destr o bin/132845 geom [geom] [patch] ggated(8) does not close files opened a o kern/132273 geom glabel(8): [patch] failing on journaled partition f kern/132242 geom [gmirror] gmirror.ko fails to fully initialize o kern/131353 geom [geom] gjournal(8) kernel lock p docs/130548 geom [patch] gjournal(8) man page is missing sysctls o kern/129674 geom [geom] gjournal root did not mount on boot o kern/129645 geom gjournal(8): GEOM_JOURNAL causes system to fail to boo o kern/129245 geom [geom] gcache is more suitable for suffix based provid f kern/128276 geom [gmirror] machine lock up when gmirror module is used o kern/127420 geom [geom] [gjournal] [panic] Journal overflow on gmirrore o kern/124973 geom [gjournal] [patch] boot order affects geom_journal con o kern/124969 geom gvinum(8): gvinum raid5 plex does not detect missing s o kern/123962 geom [panic] [gjournal] gjournal (455Gb data, 8Gb journal), o kern/123122 geom [geom] GEOM / gjournal kernel lock o kern/122738 geom [geom] gmirror list "losts consumers" after gmirror de f kern/122415 geom [geom] UFS labels are being constantly created and rem o kern/122067 geom [geom] [panic] Geom crashed during boot o kern/121364 geom [gmirror] Removing all providers create a "zombie" mir o bin/120990 geom [patch] support "BIOS Boot" partition type in gpt(8) o kern/120091 geom [geom] [geli] [gjournal] geli does not prompt for pass o kern/115856 geom [geli] ZFS thought it was degraded when it should have o kern/115547 geom [geom] [patch] [request] let GEOM Eli get password fro o kern/114532 geom [geom] GEOM_MIRROR shows up in kldstat even if compile f kern/113957 geom [gmirror] gmirror is intermittently reporting a degrad o kern/113837 geom [geom] unable to access 1024 sector size storage o kern/113419 geom [geom] geom fox multipathing not failing back o kern/107707 geom [geom] [patch] [request] add new class geom_xbox360 to o kern/94632 geom [geom] Kernel output resets input while GELI asks for o kern/90582 geom [geom] [panic] Restore cause panic string (ffs_blkfree o bin/90093 geom fdisk(8) incapable of altering in-core geometry o kern/88601 geom [geli] geli cause kernel panic under heavy disk usage o kern/87544 geom [gbde] mmaping large files on a gbde filesystem deadlo o kern/84556 geom [geom] [panic] GBDE-encrypted swap causes panic at shu o kern/79251 geom [2TB] newfs fails on 2.6TB gbde device o kern/79035 geom [vinum] gvinum unable to create a striped set of mirro o bin/78131 geom gbde(8) "destroy" not working. s kern/73177 geom kldload geom_* causes panic due to memory exhaustion 63 problems total. From owner-freebsd-geom@FreeBSD.ORG Mon Nov 15 14:00:18 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7AC9106566C for ; Mon, 15 Nov 2010 14:00:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7D8C68FC08 for ; Mon, 15 Nov 2010 14:00:18 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oAFE0I29065897 for ; Mon, 15 Nov 2010 14:00:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oAFE0IEi065882; Mon, 15 Nov 2010 14:00:18 GMT (envelope-from gnats) Date: Mon, 15 Nov 2010 14:00:18 GMT Message-Id: <201011151400.oAFE0IEi065882@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: Andriy Gapon Cc: Subject: Re: bin/120990: [patch] support "BIOS Boot" partition type in gpt(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andriy Gapon List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2010 14:00:18 -0000 The following reply was made to PR bin/120990; it has been noted by GNATS. From: Andriy Gapon To: bug-followup@freebsd.org, rmh@winomega.com Cc: ae@freebsd.org Subject: Re: bin/120990: [patch] support "BIOS Boot" partition type in gpt(8) Date: Mon, 15 Nov 2010 15:57:23 +0200 I think there is no reason not add support for this kind of partition. Robert, BTW, just in case, you can create any type of partition using its GUID with gpart. Andrey, what do you think? -- Andriy Gapon From owner-freebsd-geom@FreeBSD.ORG Mon Nov 15 15:30:15 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6617B106566C for ; Mon, 15 Nov 2010 15:30:15 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 393128FC1A for ; Mon, 15 Nov 2010 15:30:15 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oAFFUERI060416 for ; Mon, 15 Nov 2010 15:30:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oAFFUEcG060413; Mon, 15 Nov 2010 15:30:14 GMT (envelope-from gnats) Date: Mon, 15 Nov 2010 15:30:14 GMT Message-Id: <201011151530.oAFFUEcG060413@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: "Andrey V. Elsukov" Cc: Subject: Re: bin/120990: [patch] support "BIOS Boot" partition type in gpt(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Andrey V. Elsukov" List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2010 15:30:15 -0000 The following reply was made to PR bin/120990; it has been noted by GNATS. From: "Andrey V. Elsukov" To: Andriy Gapon Cc: bug-followup@freebsd.org, rmh@winomega.com, ae@freebsd.org Subject: Re: bin/120990: [patch] support "BIOS Boot" partition type in gpt(8) Date: Mon, 15 Nov 2010 18:11:29 +0300 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB7084245445E8DD2E3EA198D Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 15.11.2010 16:57, Andriy Gapon wrote: >=20 > I think there is no reason not add support for this kind of partition. >=20 > Robert, > BTW, just in case, you can create any type of partition using its GUID = with gpart. >=20 > Andrey, > what do you think? 1. This patch is for deprecated now gpt(8). 2. Without corresponding support in pmbr and boot code it will be only cosmetic change. --=20 WBR, Andrey V. Elsukov --------------enigB7084245445E8DD2E3EA198D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iQEcBAEBAgAGBQJM4U2mAAoJEAHF6gQQyKF6s0QH/RyCpAXcvvDTWKZvuR0bSO4X eYw8ejxYwMmJZ2CuRA7+UNQj2PMHouyX+UYzY5pLQHjZjRIPXvITF3wpkhoiD1aU mWwiFQyW3kYaATG9J7hmT8hHE602F05LGoMRgCiTeuw7nZzawDBnmn/DRuiMg9vi wRS8a0fRamcgNipHl46uKyT4S0ESOcWmWzQB52evY25MeozDzRCrZCA0JO0UCuat MRQLxS+cwzVK6vy7+vMwDbQhfzn8juN+q+RFlyvmr67Yfg0vsG8Crs8EJH7Hw6FY t15YY2u8hh/sxgDx5iqk1bP7EY4ycCYO/1bkNVj96gFeyUKV5Xo8UZFzzwAwGI4= =1jJL -----END PGP SIGNATURE----- --------------enigB7084245445E8DD2E3EA198D-- From owner-freebsd-geom@FreeBSD.ORG Mon Nov 15 15:50:14 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0BFB1065670 for ; Mon, 15 Nov 2010 15:50:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8F3CE8FC14 for ; Mon, 15 Nov 2010 15:50:14 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oAFFoE4x080505 for ; Mon, 15 Nov 2010 15:50:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oAFFoEfh080497; Mon, 15 Nov 2010 15:50:14 GMT (envelope-from gnats) Date: Mon, 15 Nov 2010 15:50:14 GMT Message-Id: <201011151550.oAFFoEfh080497@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: Andriy Gapon Cc: Subject: Re: bin/120990: [patch] support "BIOS Boot" partition type in gpt(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andriy Gapon List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2010 15:50:14 -0000 The following reply was made to PR bin/120990; it has been noted by GNATS. From: Andriy Gapon To: "Andrey V. Elsukov" Cc: bug-followup@freebsd.org, rmh@winomega.com, ae@freebsd.org Subject: Re: bin/120990: [patch] support "BIOS Boot" partition type in gpt(8) Date: Mon, 15 Nov 2010 17:46:47 +0200 on 15/11/2010 17:11 Andrey V. Elsukov said the following: > On 15.11.2010 16:57, Andriy Gapon wrote: >> >> I think there is no reason not add support for this kind of partition. >> >> Robert, >> BTW, just in case, you can create any type of partition using its GUID with gpart. >> >> Andrey, >> what do you think? > > 1. This patch is for deprecated now gpt(8). Oh, I didn't notice that, sorry. > 2. Without corresponding support in pmbr and boot code it > will be only cosmetic change. I think that it would still be useful when using an alternative boot-chain. I think that this request comes from Debian GNU/kFreeBSD project, which does use different boot blocks. -- Andriy Gapon From owner-freebsd-geom@FreeBSD.ORG Mon Nov 15 16:12:27 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 822121065675 for ; Mon, 15 Nov 2010 16:12:27 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id F3A908FC13 for ; Mon, 15 Nov 2010 16:12:26 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id oAFGBqC0011223; Mon, 15 Nov 2010 17:12:08 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id oAFGBqUo011222; Mon, 15 Nov 2010 17:11:52 +0100 (CET) (envelope-from olli) Date: Mon, 15 Nov 2010 17:11:52 +0100 (CET) Message-Id: <201011151611.oAFGBqUo011222@lurza.secnetix.de> From: Oliver Fromme To: freebsd-geom@FreeBSD.ORG, bsemene@cyanide-studio.com In-Reply-To: <4CE0FD0B.2010700@cyanide-studio.com> X-Newsgroups: list.freebsd-geom User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.5 (lurza.secnetix.de [127.0.0.1]); Mon, 15 Nov 2010 17:12:08 +0100 (CET) Cc: Subject: Re: Newbie RAID 0 question X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-geom@FreeBSD.ORG, bsemene@cyanide-studio.com List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2010 16:12:27 -0000 Bastien Semene wrote: > If I'm understanding well, I can add space with gconcat (8) but there > will be two separate stripings, in your example datas will be stripped > between ad0/ad1 and when space is full between ad2/ad3 ? Yes. > I'm using RAID-1+0 structure, so I think I can do the work with 2 arrays > (old one with datas, new one with datas and more space). You didn't mention RAID-1+0 in your first posting, only RAID-0. That's quite a difference. If you expect to receive good advice, you should describe your existing setup as precisely as possible. > Do you see some advantage/disadvantage using the gconcat model instead > of a true striping ? Both is "true" striping, there's only a difference in how the data is organized, which can have an impact on performance. When four disks are organized in a single RAID-0, this means that stripes are distributed equally across all four disks. In theory this can improve performance, especially for sequential access. When two pairs of disks are organized in two RAID-0 volumes which are then concatenated, the stripes for each of the sub-volumes are distributed only across two disks. Therefore there's a lower limit on the maximum performance that can be achieved (in theory). In other words: Adding two new disks using a concat container will not make the whole thing faster (but not slower either). It will be just bigger. It should also be noted that the new volume will be less reliable. Every time you add another disk to an array without redundancy (no matter whether RAID-0 or concat), you reduce reliability, because the whole array will go down when any one of the disks fails. The more disks, the higher the probability that one of the disks fails. Of course, if you have RAID-1+0, then things are a lot different. > Is it planned that geom will add an insert command, or is gconcat the > definitive solution ? I'm not a geom developer, so I'm not authoritative, but I don't think that such a feature is planned. As I wrote previously, adding another disk to an existing RAID-0 is technically expensive and time- consuming. I don't think it's worth the effort. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "The ITU has offered the IETF formal alignment with its corresponding technology, Penguins, but that won't fly." -- RFC 2549 From owner-freebsd-geom@FreeBSD.ORG Wed Nov 17 18:14:11 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A09C1065670 for ; Wed, 17 Nov 2010 18:14:11 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id 2B2B48FC26 for ; Wed, 17 Nov 2010 18:14:11 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id oAHIEAij038874 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 17 Nov 2010 10:14:10 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id oAHIEAKK038873 for freebsd-geom@freebsd.org; Wed, 17 Nov 2010 10:14:10 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA21242; Wed, 17 Nov 10 10:07:05 PST Date: Wed, 17 Nov 2010 10:07:10 -0800 From: perryh@pluto.rain.com To: freebsd-geom@freebsd.org Message-Id: <4ce419ce.MAx2JQZ2GUG+8D6W%perryh@pluto.rain.com> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: gmirror disappears after adding gjournal X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2010 18:14:11 -0000 What's wrong with this sequence: * create a mirror * partition it with disklabel * create journals on the slices * install * reboot? After the reboot, the mirror had disappeared and the journals seemed to exist directly on partitions of the mirror's provider rather than on the mirror itself. Details: Using Fixit# from the 8.1-RELEASE memstick I defined a gmirror (initially containing only one provider; the other to be added later), partitioned it using disklabel, added a journal to each of the partitions, ran newfs -J on them, and installed FreeBSD using http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror as a guide (with a few differences due to this installation being UFS rather than ZFS). In Fixit the /dev tree contained entries for both the mirror and the journal devices, but when I rebooted the mirror did not show up -- even though geom_mirror.ko was loaded. What would cause this sort of mixup, and how do I fix it? ==== contents of /dev/mirror before creating the journals Fixit# ls -la /dev/mirror total 1 dr-xr-xr-x 2 root 0 512 Nov 14 00:17 . dr-xr-xr-x 9 root 0 512 Nov 14 00:11 .. crw-r----- 1 root operator 0, 80 Nov 14 00:36 gm0 crw-r----- 1 root operator 0, 126 Nov 14 00:36 gm0a crw-r----- 1 root operator 0, 128 Nov 14 00:36 gm0d crw-r----- 1 root operator 0, 129 Nov 14 00:36 gm0e ==== corresponding disklabel report Fixit# disklabel /dev/mirror/gm0 # /dev/mirror/gm0: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 8388608 16 4.2BSD 1024 8192 16 c: 619907517 0 unused 0 0 d: 25165824 8388624 4.2BSD 0 0 0 e: 586353069 33554448 4.2BSD 0 0 0 ==== journal creation, with dmesg reports Fixit# gjournal label -s 2G /dev/mirror/gm0a GEOM_JOURNAL: Journal 1098378706: mirror/gm0a contains data. GEOM_JOURNAL: Journal 1098378706: mirror/gm0a contains journal. GEOM_JOURNAL: Journal mirror/gm0a clean. Fixit# gjournal label -s 2G /dev/mirror/gm0d GEOM_JOURNAL: Journal 3795372090: mirror/gm0d contains data. GEOM_JOURNAL: Journal 3795372090: mirror/gm0d contains journal. GEOM_JOURNAL: Journal mirror/gm0d clean. Fixit# gjournal label -s 2G /dev/mirror/gm0e GEOM_JOURNAL: Journal 2063379813: mirror/gm0e contains data. GEOM_JOURNAL: Journal 2063379813: mirror/gm0e contains journal. GEOM_JOURNAL: Journal mirror/gm0e clean. ==== contents of /dev/mirror after creating the journals Fixit# ls -la /dev/mirror total 1 dr-xr-xr-x 2 root 0 512 Nov 14 00:17 ./ dr-xr-xr-x 9 root 0 512 Nov 14 00:11 ../ crw-r----- 1 root operator 0, 80 Nov 14 02:01 gm0 crw-r----- 1 root operator 0, 78 Nov 14 02:06 gm0a crw-r----- 1 root operator 0, 126 Nov 14 02:06 gm0a.journal crw-r----- 1 root operator 0, 125 Nov 14 02:07 gm0d crw-r----- 1 root operator 0, 128 Nov 14 02:07 gm0d.journal crw-r----- 1 root operator 0, 130 Nov 14 02:07 gm0e crw-r----- 1 root operator 0, 129 Nov 14 02:07 gm0e.journal ==== newfs commands Fixit# newfs -J /dev/mirror/gm0a.journal Fixit# newfs -J /dev/mirror/gm0d.journal Fixit# newfs -J /dev/mirror/gm0e.journal ==== FS configuration after mounting, before installing Fixit# mount /dev/md0 on / (ufs, local) devfs on /dev (devfs, local, multilabel) /dev/da1a on /dist (ufs, local, read-only) /dev/mirror/gm0a.journal on /mnt (ufs, local, gjournal) /dev/ad8s2d on /mnt/tmp (ufs, local) /dev/mirror/gm0d.journal on /mnt/var (ufs, local, gjournal) /dev/mirror/gm0e.journal on /mnt/usr (ufs, local, gjournal) ==== install per http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror, ==== no detailed log kept ==== manually-created config files, while still in chroot after install Fixit# cat /boot/loader.conf geom_mirror_load="YES" geom_journal_load="YES" vfs.root.mountfrom="ufs:/dev/mirror/gm0a.journal" vfs.root.mountfrom.options="rw" Fixit# cat /etc/fstab /dev/mirror/gm0a.journal / ufs rw 0 1 /dev/ad0s2b none swap sw 0 0 /dev/ad8s2b none swap sw 0 0 /dev/ad8s2d /tmp ufs rw 0 2 /dev/mirror/gm0d.journal /var ufs rw 0 3 /dev/mirror/gm0e.journal /usr ufs rw 0 4 /dev/da1a /dist ufs ro 0 0 devfs /dev devfs multilabel 0 0 ==== dmesg from booting the newly-installed system (long) ==== kldstat shows that geom_mirror.ko _is_ loaded, but /dev/mirror ==== does not exist and the journals are now found on the ad0s2* 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@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 real memory = 536870912 (512 MB) avail memory = 510218240 (486 MB) ACPI APIC Table: ioapic0: Changing APIC ID to 1 ioapic0 irqs 0-23 on motherboard kbd1 at kbdmux0 acpi0: 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: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 agp0: on hostb0 pcib1: at device 1.0 on pci0 pci1: on pcib1 vgapci0: mem 0xf4000000-0xf5ffffff,0xfcffc000-0xfcffffff,0xfc000000-0xfc7fffff irq 16 at device 0.0 on pci1 pcib2: at device 30.0 on pci0 pci2: on pcib2 xl0: <3Com 3c905C-TX Fast Etherlink XL> port 0xdc80-0xdcff mem 0xf8fffc00-0xf8fffc7f irq 16 at device 4.0 on pci2 miibus0: 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: at device 6.0 (no driver attached) atapci0: port 0xdc70-0xdc7f,0xdc50-0xdc5f,0xdc30-0xdc3f,0xdc10-0xdc1f,0xd8e0-0xd8ff,0xd400-0xd4ff irq 19 at device 11.0 on pci2 atapci0: [ITHREAD] ata2: on atapci0 ata2: [ITHREAD] ata3: on atapci0 ata3: [ITHREAD] ata4: on atapci0 ata4: [ITHREAD] pcib3: at device 14.0 on pci2 pci3: on pcib3 ahc0: 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: 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: at device 31.0 on pci0 isa0: on isab0 atapci1: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xffa0-0xffaf at device 31.1 on pci0 ata0: on atapci1 ata0: [ITHREAD] ata1: on atapci1 ata1: [ITHREAD] uhci0: port 0xff80-0xff9f irq 19 at device 31.2 on pci0 uhci0: [ITHREAD] uhci0: LegSup = 0x2f00 usbus0: on uhci0 pci0: at device 31.3 (no driver attached) atrtc0: port 0x70-0x7f irq 8 on acpi0 fdc0: port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0 fdc0: [FILTER] fd0: <1440-KB 3.5" drive> on fdc0 drive 0 atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] psm0: 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: 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: on ppc0 plip0: on ppbus0 plip0: [ITHREAD] lpt0: on ppbus0 lpt0: [ITHREAD] lpt0: Interrupt-driven port ppi0: on ppbus0 pmtimer0 on isa0 orm0: at iomem 0xc0000-0xc7fff,0xc8000-0xcdfff,0xce000-0xcffff pnpid ORM0000 on isa0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 Timecounter "TSC" frequency 731470456 Hz quality 800 Timecounters tick every 1.000 msec usbus0: 12Mbps Full Speed USB v1.0 ad0: 305245MB at ata0-master UDMA66 ugen0.1: at usbus0 uhub0: on usbus0 ad1: 32253MB at ata0-slave UDMA66 uhub0: 2 ports with 2 removable, self powered GEOM: ad0s2: geometry does not match label (255h,63s != 16h,63s). GEOM: ad0s2: media size does not match label. GEOM_JOURNAL: Journal 1098378706: ad0s2a contains data. GEOM_JOURNAL: Journal 1098378706: ad0s2a contains journal. GEOM_JOURNAL: Journal ad0s2a clean. GEOM_JOURNAL: Journal 3795372090: ad0s2d contains data. GEOM_JOURNAL: Journal 3795372090: ad0s2d contains journal. GEOM_JOURNAL: Journal ad0s2d clean. GEOM_JOURNAL: Journal 2063379813: ad0s2e contains data. GEOM_JOURNAL: Journal 2063379813: ad0s2e contains journal. GEOM_JOURNAL: Journal ad0s2e clean. device_attach: afd0 attach returned 6 ugen0.2: at usbus0 umass0: on usbus0 umass0: SCSI over Bulk-Only; quirks = 0x0000 acd0: CDROM at ata1-slave PIO4 ad4: 61136MB at ata2-master UDMA100 SATA 1.5Gb/s acd1: DVDR at ata3-master UDMA66 SATA 1.5Gb/s ad8: 305245MB at ata4-master UDMA133 umass0:2:0:-1: Attached to scbus2 GEOM: ad8s2: geometry does not match label (255h,63s != 16h,63s). da0 at ahc0 bus 0 scbus0 target 0 lun 0 da0: 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: Removable Direct Access SCSI-2 device da1: 1.000MB/s transfers da1: 960MB (1967616 512 byte sectors: 64H 32S/T 960C) 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/mirror/gm0a.journal ROOT MOUNT ERROR: If you have invalid mount options, reboot, and first try the following from the loader prompt: set vfs.root.mountfrom.options=rw and then remove invalid mount options from /etc/fstab. Loader variables: vfs.root.mountfrom=ufs:/dev/mirror/gm0a.journal vfs.root.mountfrom.options=rw Manual root filesystem specification: : Mount using filesystem eg. ufs:/dev/da0s1a eg. cd9660:/dev/acd0 This is equivalent to: mount -t cd9660 /dev/acd0 / ? List valid disk boot devices Abort manual input mountroot> ? List of GEOM managed disk devices: da1a ext2fs// ext2fs//boot da1 da0s3 da0s2 da0s1 da0 ufsid/4cdf4dff8de0837d ufsid/4c830a972b034290 ad8s2d ad8s2b ad8s2a ad8s2 ad8s1 ad8 iso9660/FreeBSD_Packages acd1t01 acd1 ad4 acd0 ufsid/4cdf45a2759357b0 ufsid/4cdf4594fac31a50 ufsid/4cdf4582119b5b07 ad0s2e.journal ad0s2d.journal ad0s2a.journal ad0s2e ad0s2d ad0s2a ad0s2 ad0s1 ad1 ad0 fd0 Loader variables: vfs.root.mountfrom=ufs:/dev/mirror/gm0a.journal vfs.root.mountfrom.options=rw Manual root filesystem specification: : Mount using filesystem eg. ufs:/dev/da0s1a eg. cd9660:/dev/acd0 This is equivalent to: mount -t cd9660 /dev/acd0 / ? List valid disk boot devices Abort manual input mountroot> ufs:ad0s2a.journal Trying to mount root from ufs:ad0s2a.journal ==== output from kldstat Id Refs Address Size Name 1 6 0xc0400000 bb5504 kernel 2 1 0xc0fb6000 14540 geom_journal.ko 3 1 0xc0fcb000 16ed4 geom_mirror.ko ==== output from df, after manually mounting /usr & /var read-only ==== -- I don't want to try writing to them until the mirror mess ==== is cleaned up -- and /tmp read-write (so I have someplace to ==== save stuff) Filesystem 512-blocks Used Avail Capacity Mounted on ad0s2a.journal 4052056 345948 3381944 9% / devfs 2 2 0 100% /dev /dev/ad0s2e.journal 563842072 2371628 516363080 0% /usr /dev/ad0s2d.journal 20308312 392 18683256 0% /var /dev/ad8s2d 2001180 36 1841052 0% /tmp ==== result of "ls -alR /dev" -- incl a mysterious line on stderr ls: : No such file or directory total 10 dr-xr-xr-x 7 root wheel 512 Nov 13 20:21 . drwxr-xr-x 18 root wheel 512 Jul 18 19:57 .. crw-r----- 1 root operator 0, 98 Nov 13 20:21 acd0 crw-r----- 1 root operator 0, 100 Nov 13 20:21 acd1 crw-r----- 1 root operator 0, 101 Nov 13 20:21 acd1t01 crw-r--r-- 1 root wheel 0, 34 Nov 13 20:21 acpi crw-r----- 1 root operator 0, 80 Nov 13 20:21 ad0 crw-r----- 1 root operator 0, 82 Nov 13 20:21 ad0s1 crw-r----- 1 root operator 0, 83 Nov 13 20:21 ad0s2 crw-r----- 1 root operator 0, 84 Nov 13 20:21 ad0s2a crw-r----- 1 root operator 0, 87 Nov 13 20:21 ad0s2a.journal crw-r----- 1 root operator 0, 85 Nov 13 20:21 ad0s2d crw-r----- 1 root operator 0, 88 Nov 13 20:21 ad0s2d.journal crw-r----- 1 root operator 0, 86 Nov 13 20:21 ad0s2e crw-r----- 1 root operator 0, 89 Nov 13 20:21 ad0s2e.journal crw-r----- 1 root operator 0, 81 Nov 13 20:21 ad1 crw-r----- 1 root operator 0, 99 Nov 13 20:21 ad4 crw-r----- 1 root operator 0, 103 Nov 13 20:21 ad8 crw-r----- 1 root operator 0, 104 Nov 13 20:21 ad8s1 crw-r----- 1 root operator 0, 105 Nov 13 20:21 ad8s2 crw-r----- 1 root operator 0, 106 Nov 13 20:21 ad8s2a crw-r----- 1 root operator 0, 107 Nov 13 20:21 ad8s2b crw-r----- 1 root operator 0, 108 Nov 13 20:21 ad8s2d crw------- 1 root wheel 0, 35 Nov 13 20:21 agpgart crw------- 1 root operator 0, 33 Nov 13 20:21 ata crw------- 1 root wheel 0, 36 Nov 13 20:21 atkbd0 crw------- 1 root kmem 0, 21 Nov 13 20:21 audit crw------- 1 root wheel 0, 14 Nov 13 20:21 bpf lrwxr-xr-x 1 root wheel 3 Nov 13 20:21 bpf0 -> bpf crw-rw-rw- 1 root wheel 0, 39 Nov 13 20:21 bpsm0 crw------- 1 root wheel 0, 5 Nov 13 20:55 console crw------- 1 root wheel 0, 71 Nov 13 20:21 consolectl crw-rw-rw- 1 root wheel 0, 11 Nov 13 20:21 ctty crw-rw---- 1 uucp dialer 0, 43 Nov 13 20:21 cuau0 crw-rw---- 1 uucp dialer 0, 44 Nov 13 20:21 cuau0.init crw-rw---- 1 uucp dialer 0, 45 Nov 13 20:21 cuau0.lock crw-rw---- 1 uucp dialer 0, 49 Nov 13 20:21 cuau1 crw-rw---- 1 uucp dialer 0, 50 Nov 13 20:21 cuau1.init crw-rw---- 1 uucp dialer 0, 51 Nov 13 20:21 cuau1.lock crw-r----- 1 root operator 0, 113 Nov 13 20:21 da0 crw-r----- 1 root operator 0, 114 Nov 13 20:21 da0s1 crw-r----- 1 root operator 0, 115 Nov 13 20:21 da0s2 crw-r----- 1 root operator 0, 116 Nov 13 20:21 da0s3 crw-r----- 1 root operator 0, 117 Nov 13 20:21 da1 crw-r----- 1 root operator 0, 120 Nov 13 20:21 da1a crw------- 1 root wheel 0, 17 Nov 13 20:21 dcons crw------- 1 root wheel 0, 4 Nov 13 20:21 devctl cr-------- 1 root wheel 0, 75 Nov 13 20:21 devstat crw------- 1 root wheel 0, 18 Nov 13 20:21 dgdb dr-xr-xr-x 3 root wheel 512 Nov 13 20:21 ext2fs dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 fd crw-r----- 1 root operator 0, 79 Nov 13 20:21 fd0 crw------- 1 root wheel 0, 19 Nov 13 20:21 fido crw-r----- 1 root operator 0, 3 Nov 13 20:21 geom.ctl crw------- 1 root wheel 0, 28 Nov 13 20:21 io dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 iso9660 lrwxr-xr-x 1 root wheel 6 Nov 13 20:21 kbd0 -> atkbd0 lrwxr-xr-x 1 root wheel 7 Nov 13 20:21 kbd1 -> kbdmux0 crw------- 1 root wheel 0, 29 Nov 13 20:21 kbdmux0 crw------- 1 root wheel 0, 8 Nov 13 20:21 klog crw-r----- 1 root kmem 0, 32 Nov 13 20:21 kmem crw------- 1 root wheel 0, 52 Nov 13 20:21 lpt0 crw------- 1 root wheel 0, 53 Nov 13 20:21 lpt0.ctl crw------- 1 root wheel 0, 74 Nov 13 20:21 mdctl crw-r----- 1 root kmem 0, 31 Nov 13 20:21 mem crw------- 1 root kmem 0, 20 Nov 13 20:21 nfslock crw-rw-rw- 1 root wheel 0, 6 Nov 13 20:23 null crw------- 1 root operator 0, 111 Nov 13 20:21 pass0 crw------- 1 root operator 0, 112 Nov 13 20:21 pass1 crw-r--r-- 1 root wheel 0, 9 Nov 13 20:21 pci crw------- 1 root wheel 0, 54 Nov 13 20:21 ppi0 crw-rw-rw- 1 root wheel 0, 38 Nov 13 20:21 psm0 crw-rw-rw- 1 root wheel 0, 10 Nov 13 20:21 ptmx crw-rw-rw- 1 root wheel 0, 12 Nov 13 20:23 random lrwxr-xr-x 1 root wheel 4 Nov 13 20:21 stderr -> fd/2 lrwxr-xr-x 1 root wheel 4 Nov 13 20:21 stdin -> fd/0 lrwxr-xr-x 1 root wheel 4 Nov 13 20:21 stdout -> fd/1 crw------- 1 root wheel 0, 16 Nov 13 20:21 sysmouse crw------- 1 root wheel 0, 40 Nov 13 20:21 ttyu0 crw------- 1 root wheel 0, 41 Nov 13 20:21 ttyu0.init crw------- 1 root wheel 0, 42 Nov 13 20:21 ttyu0.lock crw------- 1 root wheel 0, 46 Nov 13 20:21 ttyu1 crw------- 1 root wheel 0, 47 Nov 13 20:21 ttyu1.init crw------- 1 root wheel 0, 48 Nov 13 20:21 ttyu1.lock crw------- 1 root wheel 0, 55 Nov 13 20:21 ttyv0 crw------- 1 root wheel 0, 56 Nov 13 20:21 ttyv1 crw------- 1 root wheel 0, 57 Nov 13 20:21 ttyv2 crw------- 1 root wheel 0, 58 Nov 13 20:21 ttyv3 crw------- 1 root wheel 0, 59 Nov 13 20:21 ttyv4 crw------- 1 root wheel 0, 60 Nov 13 20:21 ttyv5 crw------- 1 root wheel 0, 61 Nov 13 20:21 ttyv6 crw------- 1 root wheel 0, 62 Nov 13 20:21 ttyv7 crw------- 1 root wheel 0, 63 Nov 13 20:21 ttyv8 crw------- 1 root wheel 0, 64 Nov 13 20:21 ttyv9 crw------- 1 root wheel 0, 65 Nov 13 20:21 ttyva crw------- 1 root wheel 0, 66 Nov 13 20:21 ttyvb crw------- 1 root wheel 0, 67 Nov 13 20:21 ttyvc crw------- 1 root wheel 0, 68 Nov 13 20:21 ttyvd crw------- 1 root wheel 0, 69 Nov 13 20:21 ttyve crw------- 1 root wheel 0, 70 Nov 13 20:21 ttyvf dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 ufsid lrwxr-xr-x 1 root wheel 9 Nov 13 20:21 ugen0.1 -> usb/0.1.0 lrwxr-xr-x 1 root wheel 9 Nov 13 20:21 ugen0.2 -> usb/0.2.0 lrwxr-xr-x 1 root wheel 6 Nov 13 20:21 urandom -> random dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 usb crw-r--r-- 1 root operator 0, 72 Nov 13 20:21 usbctl crw------- 1 root operator 0, 73 Nov 13 20:21 xpt0 crw-rw-rw- 1 root wheel 0, 7 Nov 13 20:21 zero /dev/ext2fs: total 2 dr-xr-xr-x 3 root wheel 512 Nov 13 20:21 . dr-xr-xr-x 7 root wheel 512 Nov 13 20:21 .. /dev/fd: total 2 dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 . dr-xr-xr-x 7 root wheel 512 Nov 13 20:21 .. crw-rw-rw- 1 root wheel 0, 22 Nov 13 20:21 0 crw-rw-rw- 1 root wheel 0, 24 Nov 13 20:21 1 crw-rw-rw- 1 root wheel 0, 26 Nov 13 20:21 2 /dev/iso9660: total 2 dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 . dr-xr-xr-x 7 root wheel 512 Nov 13 20:21 .. crw-r----- 1 root operator 0, 102 Nov 13 20:21 FreeBSD_Packages /dev/ufsid: total 2 dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 . dr-xr-xr-x 7 root wheel 512 Nov 13 20:21 .. crw-r----- 1 root operator 0, 109 Nov 13 20:21 4c830a972b034290 crw-r----- 1 root operator 0, 90 Nov 13 20:21 4cdf4582119b5b07 crw-r----- 1 root operator 0, 91 Nov 13 20:21 4cdf4594fac31a50 crw-r----- 1 root operator 0, 92 Nov 13 20:21 4cdf45a2759357b0 /dev/usb: total 2 dr-xr-xr-x 2 root wheel 512 Nov 13 20:21 . dr-xr-xr-x 7 root wheel 512 Nov 13 20:21 .. crw------- 1 root operator 0, 76 Nov 13 20:21 0.1.0 crw------- 1 root operator 0, 78 Nov 13 20:21 0.1.1 crw------- 1 root operator 0, 93 Nov 13 20:21 0.2.0 crw------- 1 root operator 0, 95 Nov 13 20:21 0.2.1 crw------- 1 root operator 0, 96 Nov 13 20:21 0.2.2 crw------- 1 root operator 0, 97 Nov 13 20:21 0.2.3 ==== end From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 08:26:30 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F724106566B; Thu, 18 Nov 2010 08:26:30 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 10EF78FC13; Thu, 18 Nov 2010 08:25:47 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 639F7A6B110; Thu, 18 Nov 2010 16:25:28 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id ETcrHbMC3UAv; Thu, 18 Nov 2010 16:25:20 +0800 (CST) Received: from delta.delphij.net (unknown [IPv6:2001:470:83bf:0:221:5cff:fe6a:37bb]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 1D02FA6B0B7; Thu, 18 Nov 2010 16:24:51 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=a9L3rD6x2qoELxmQsVrC2ePHRHzBoigl/D5ndcpMzTWk0sZBzpHcq1XY005SUyigk EN9VAe6jUt4zuhpf9yz/A== Message-ID: <4CE4E2B2.7070702@delphij.net> Date: Thu, 18 Nov 2010 00:24:18 -0800 From: Xin LI Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.15) Gecko/20101028 Thunderbird/3.0.10 ThunderBrowse/3.3.2 MIME-Version: 1.0 To: Ivan Voras References: In-Reply-To: X-Enigmail-Version: 1.0.1 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org, freebsd-geom@freebsd.org Subject: Re: ZFS stripesize patch (in the context of 4k sector drives) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 08:26:30 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 11/12/10 10:09, Ivan Voras wrote: > On 11/12/10 16:00, Ivan Voras wrote: >> Hello, >> >> Any objections to me committing the following patch? >> >> The intention is to use stripesize info from GEOM in creating vdevs, in >> the hope that the 4 KiB sector magic will work. > > Or maybe not. I've grepped and other tools use stripesize in the way its > name suggests - as RAID stripe size, not as logical sector size. > > New idea on the menu: make the logical sector size a separate concept > and a separate variable from stripe size. Would that be a better approach? Have you tested this booting from existing ZFS file system? Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iQEcBAEBCAAGBQJM5OKyAAoJEATO+BI/yjfBby4IAISFkInYkAa0OWUKtvWZbmdk VUmQHN/e8tToB+Yb6+IRlk0e+Wu2Cqc2TACrdNRgq2f9BNUIjrfkJo1Flz0SlQlU jtkutNVPjyh2aC3dBucWNSGAoadC5qq2VdQgDtzgK0OcNN/EKKUIHadZHWsCqyuD RT37u9FZcBXMytRwB7DFWVLdfTfpTMyyYSBmWRliUFnIg7XgR1YD6Lu3ne2Nzj9/ 7DaF0E308m3VSWyQRgB1l6EszWoIaGVbbY6TObp9zlNvug4wYSuBGvvuT+gojV/J FHSaZDLNg/EhXR0T7IRaqOppvzYz5r2bnaqJr70JuT+9nZJZvV8ePuSuDdFx520= =pB0h -----END PGP SIGNATURE----- From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 10:53:45 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B14A106564A; Thu, 18 Nov 2010 10:53:45 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward5.mail.yandex.net (forward5.mail.yandex.net [77.88.46.21]) by mx1.freebsd.org (Postfix) with ESMTP id AABAF8FC08; Thu, 18 Nov 2010 10:53:44 +0000 (UTC) Received: from smtp2.mail.yandex.net (smtp2.mail.yandex.net [77.88.46.102]) by forward5.mail.yandex.net (Yandex) with ESMTP id 112C814D155D; Thu, 18 Nov 2010 13:53:43 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1290077623; bh=u0Ed9fm5gyLoiSL1pg9gnjtsUyagudqD9yCn3TDfsdo=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:Content-Type; b=OEYxjdZKjOpbZWXaFPQltW91udEpCw2uxMX+vN5gGpVXAhz9Dh5knKTq3ujC9Ax45 tyim4jTLBXdi7yDPMMstGQ58r/ZvZYnDymWDXimVebQ54dr+jQ2O7L/Nj4OqBYjXFZ Qog8HM02/hoSU92ImPM/dQzDtTW3kTqBs3I8VUt4= Received: from [127.0.0.1] (mail.kirov.so-cdu.ru [77.72.136.145]) by smtp2.mail.yandex.net (Yandex) with ESMTPSA id BA7875280A9; Thu, 18 Nov 2010 13:53:42 +0300 (MSK) Message-ID: <4CE505B2.6010601@yandex.ru> Date: Thu, 18 Nov 2010 13:53:38 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: freebsd-geom@FreeBSD.org X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig1C5A01DA13858C5591855CB2" Cc: Marcel Moolenaar Subject: backup a partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 10:53:45 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1C5A01DA13858C5591855CB2 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Hi, Marcel and All. I'm thinking about such feature like ability to dump partition table into file from which it can be recovered in the future. Also it can be used to copy partition table to another device. At the moment i think that just print out a list of commands that should be done to create the same table it is the easiest way. For example: > gpart show ada1 =3D> 34 320172989 ada1 GPT (153G) 34 512 1 freebsd-boot (256K) 546 8388608 2 freebsd-swap (4.0G) 8389154 311783869 3 freebsd-zfs (149G) > gpart dump -f x ada1 geom part create -s gpt -f x ada1 geom part add -b 34 -s 512 -i 1 -t freebsd-boot -f x ada1 geom part add -b 546 -s 8388608 -i 2 -t freebsd-swap -f x ada1 geom part add -b 8389154 -s 311783869 -i 3 -t freebsd-zfs -f x ada1 Any comments and ideas are welcome. --=20 WBR, Andrey V. Elsukov --------------enig1C5A01DA13858C5591855CB2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJM5QW1AAoJEAHF6gQQyKF6MQwIAJp0guFiqVSv2eP+YHk0PsuP v+fx9ejObYlZcuVmsdGjXf5+JF1WmuDpj3BXkQb6qDFxMq4ry3RgSdHaNgy5503R QyWQkrZpKf7E2IFXln3/Drv/Lkewdy+L+ljGPAHFDmwVpu2rZ3G9/1KlSKQ8epKr sMPQHJAJ0LkEtz7hjwhyhn+Y/hO0K4NyMAevhZ2jMxLO5sj2wxZVOp3zjUgs617J KWsIJOlcgZLice5n/Npks/AQ3A6o0pnkxncdHwg9NnIQgPe57EOualVRBiMromFZ 38gFLB2KzTnhan+OcYacFFRLBzCdGOYH92XafGxpWjZbfe5rePQN2j1XZ2JjNr0= =587N -----END PGP SIGNATURE----- --------------enig1C5A01DA13858C5591855CB2-- From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 11:33:14 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 455AF1065673; Thu, 18 Nov 2010 11:33:14 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id B9F518FC14; Thu, 18 Nov 2010 11:33:13 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id oAIBWu5d051625; Thu, 18 Nov 2010 12:33:11 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id oAIBWucC051624; Thu, 18 Nov 2010 12:32:56 +0100 (CET) (envelope-from olli) Date: Thu, 18 Nov 2010 12:32:56 +0100 (CET) Message-Id: <201011181132.oAIBWucC051624@lurza.secnetix.de> From: Oliver Fromme To: freebsd-geom@FreeBSD.ORG, bu7cher@yandex.ru, marcel@FreeBSD.ORG In-Reply-To: <4CE505B2.6010601@yandex.ru> X-Newsgroups: list.freebsd-geom User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.5 (lurza.secnetix.de [127.0.0.1]); Thu, 18 Nov 2010 12:33:11 +0100 (CET) Cc: Subject: Re: backup a partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-geom@FreeBSD.ORG, bu7cher@yandex.ru, marcel@FreeBSD.ORG List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 11:33:14 -0000 Andrey V. Elsukov wrote: > I'm thinking about such feature like ability to dump partition > table into file from which it can be recovered in the future. > Also it can be used to copy partition table to another device. > > At the moment i think that just print out a list of commands that > should be done to create the same table it is the easiest way. > [...] > Any comments and ideas are welcome. How about an option to dump the table in XML format, and another option that creates a table from an XML structure? (I'm not a huge fan of XML, but in this particular case it might be useful.) Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "People still program in C. People keep writing shell scripts. *Most* people don't realize the shortcomings of the tools they are using because they a) don't reflect on their workflows and they are b) too lazy to check out alternatives to realize there is help." -- Simon 'corecode' Schubert From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 12:56:52 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85F9C106564A for ; Thu, 18 Nov 2010 12:56:52 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id AEA4E8FC1D for ; Thu, 18 Nov 2010 12:56:51 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA22966; Thu, 18 Nov 2010 14:44:19 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <4CE51FA3.60907@freebsd.org> Date: Thu, 18 Nov 2010 14:44:19 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: "Andrey V. Elsukov" References: <4CE505B2.6010601@yandex.ru> In-Reply-To: <4CE505B2.6010601@yandex.ru> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: freebsd-geom@freebsd.org Subject: Re: backup a partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 12:56:52 -0000 on 18/11/2010 12:53 Andrey V. Elsukov said the following: > Hi, Marcel and All. > > I'm thinking about such feature like ability to dump partition > table into file from which it can be recovered in the future. > Also it can be used to copy partition table to another device. I think that we ought to have such a feature. -- Andriy Gapon From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 15:51:49 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 976E5106564A; Thu, 18 Nov 2010 15:51:49 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward1.mail.yandex.net (forward1.mail.yandex.net [77.88.46.6]) by mx1.freebsd.org (Postfix) with ESMTP id 41FCE8FC12; Thu, 18 Nov 2010 15:51:49 +0000 (UTC) Received: from smtp2.mail.yandex.net (smtp2.mail.yandex.net [77.88.46.102]) by forward1.mail.yandex.net (Yandex) with ESMTP id 5E8E169E832D; Thu, 18 Nov 2010 18:51:46 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1290095506; bh=Y/McwnTUVwHXafid9f3jGaEVrVyzilv2X7621eEXK8Y=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=I2D21KDmyLnxsodvTbIEiWI89JSt12C2z0LE4ERJ1Yrr21D+crRpRZKrH9auMDFNc zK2/mCHNuX49Z9LdefM9gZvymtmHnKZWGYY/scgkkKhtbfvT9l7RAyHJ97oNDyH1wB Ua5rzs9uIgnqbLqLp8cjJ7RTtfgxo91sKACc/rGg= Received: from [10.43.163.197] (nat-77-56.kirovnet.ru [92.39.77.56]) by smtp2.mail.yandex.net (Yandex) with ESMTPSA id D76A952809C; Thu, 18 Nov 2010 18:51:45 +0300 (MSK) Message-ID: <4CE54B88.9070006@yandex.ru> Date: Thu, 18 Nov 2010 18:51:36 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101030 Thunderbird/3.1.6 MIME-Version: 1.0 To: freebsd-geom@FreeBSD.ORG References: <201011181132.oAIBWucC051624@lurza.secnetix.de> In-Reply-To: <201011181132.oAIBWucC051624@lurza.secnetix.de> X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigD4B23E9D764068C12E07B36E" Cc: Oliver Fromme , marcel@FreeBSD.ORG, Pawel Jakub Dawidek Subject: Re: backup a partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 15:51:49 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD4B23E9D764068C12E07B36E Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 18.11.2010 14:32, Oliver Fromme wrote: > How about an option to dump the table in XML format, and > another option that creates a table from an XML structure? >=20 > (I'm not a huge fan of XML, but in this particular case > it might be useful.) I do not think it is very useful, nor in implementation, nor in usability. What about add a new standard command to geom(8) to execute batch of commands? > cat geom_class_cmd | geom execute [arg0] where geom_class_cmd is a list of commands for specific class. This can get advantage for some geom classes, e.g.: > gpart dump ada0 | gpart execute ada1 this command will make a copy of partition table ada0 to ada1. Currently to implement this geom(8) and gpart(8) should be significantly changed particularly in the errors handling. So my question is to Marcel and Pawel - Do you have something against these changes? Or maybe you can suggest something else? --=20 WBR, Andrey V. Elsukov --------------enigD4B23E9D764068C12E07B36E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iQEcBAEBAgAGBQJM5UuNAAoJEAHF6gQQyKF6+nwH/3oqPwChRAhQ+0gDykkXv5c2 9Mi7xqvFEDiPMMIwlmBxWX48+FGR+o8AWB8fJiUyS6uBjeGseoQo93XHtDikAay/ zYHoVL5uEfHytueLO6PJ0/RsYB56WRMmUWuKowt1CxwNwUviKskjctSiNjIqmPei iSspZdL4ZIb76U+rluC5+dL9ooB0PthGsL/SLlUbf3TZj/hur1P5MuEAUAJHtFNv Rt0K4ys4XjKKOA3pFuxY8lW/25mFcu5zIg6b6MNROeWZHqzRhYTE+ssXlCeEgjYZ eXGpSAhRLPp6fpLiD/jgtoRSGyJvdrbAJNMlhB5umYRlh4bsO36HjzISFMFjDwY= =jDbZ -----END PGP SIGNATURE----- --------------enigD4B23E9D764068C12E07B36E-- From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 16:51:19 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 125421065674 for ; Thu, 18 Nov 2010 16:51:19 +0000 (UTC) (envelope-from guido@gvr.org) Received: from gvr.gvr.org (gvr-gw.gvr.org [82.95.154.195]) by mx1.freebsd.org (Postfix) with ESMTP id 824BD8FC12 for ; Thu, 18 Nov 2010 16:51:18 +0000 (UTC) Received: by gvr.gvr.org (Postfix, from userid 657) id 002896D419; Thu, 18 Nov 2010 17:33:23 +0100 (CET) Date: Thu, 18 Nov 2010 17:33:23 +0100 From: Guido van Rooij To: freebsd-geom@freebsd.org Message-ID: <20101118163323.GA2524@gvr.gvr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: Booting from a gmirror always leads to a broken gmirror X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 16:51:19 -0000 Hi, I am running 8.1-RELEASE with the folloing mirror setup: Geom name: gm0 State: DEGRADED Components: 2 Balance: round-robin Slice: 4096 Flags: NONE GenID: 3 SyncID: 2 ID: 2610005691 Providers: 1. Name: mirror/gm0 Mediasize: 500107861504 (466G) Sectorsize: 512 Mode: r3w2e5 Consumers: 1. Name: da1 Mediasize: 500107862016 (466G) Sectorsize: 512 Mode: r1w1e1 State: ACTIVE Priority: 0 Flags: DIRTY GenID: 3 SyncID: 2 ID: 3263791510 2. Name: da0 Mediasize: 500107862016 (466G) Sectorsize: 512 Mode: r1w1e1 State: SYNCHRONIZING Priority: 0 Flags: DIRTY, SYNCHRONIZING GenID: 3 SyncID: 2 Synchronized: 15% ID: 4162979509 I have a dedicated slice to boot from and one GELI slice, both on the mirror. Now when I reboot this system (at a time when the mirror is 100% fine, unlike above), the following happens: Nov 18 15:36:01 gvr kernel: Root mount waiting for: usbus4 Nov 18 15:36:01 gvr kernel: ugen4.2: at usbus4 Nov 18 15:36:01 gvr kernel: umass0: on usbus4 Nov 18 15:36:01 gvr kernel: ugen1.2: at usbus1 Nov 18 15:36:01 gvr kernel: uhub6: on usbus1 Nov 18 15:36:01 gvr kernel: uhub5: 4 ports with 1 removable, self powered Nov 18 15:36:01 gvr kernel: Root mount waiting for: usbus4 Nov 18 15:36:01 gvr kernel: uhub6: 3 ports with 2 removable, bus powered Nov 18 15:36:01 gvr kernel: da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 Nov 18 15:36:01 gvr kernel: da0: Fixed Direct Access SCSI-4 device Nov 18 15:36:01 gvr kernel: da0: 40.000MB/s transfers Nov 18 15:36:01 gvr kernel: da0: 476940MB (976773168 512 byte sectors: 255H 63S/ T 60801C) Nov 18 15:36:01 gvr kernel: ugen1.3: at usbus1 Nov 18 15:36:01 gvr kernel: ugen4.3: at usbus4 Nov 18 15:36:01 gvr kernel: umass1: on usbus4 Nov 18 15:36:01 gvr kernel: da1 at umass-sim1 bus 1 scbus1 target 0 lun 0 Nov 18 15:36:01 gvr kernel: da1: Fixed Direct Access SCSI-4 device Nov 18 15:36:01 gvr kernel: da1: 40.000MB/s transfers Nov 18 15:36:01 gvr kernel: da1: 476940MB (976773168 512 byte sectors: 255H 63S/ T 60801C) Nov 18 15:36:01 gvr kernel: GEOM_MIRROR: Component da0 (device gm0) broken, skipping. Nov 18 15:36:01 gvr kernel: GEOM_MIRROR: Device mirror/gm0 launched (1/2). Nov 18 15:36:01 gvr kernel: Enter passphrase for da0s2: Now, the passphrase the geli asks, is for the so-called broken disk. But it is not broken. I can always rebuild it fine when I rebooted and re-insert da0. My question: why does gmirror mark da0 as broken? -Guido From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 17:50:25 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0EFE106564A; Thu, 18 Nov 2010 17:50:25 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout025.mac.com (asmtpout025.mac.com [17.148.16.100]) by mx1.freebsd.org (Postfix) with ESMTP id 8A12D8FC29; Thu, 18 Nov 2010 17:50:25 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp025.mac.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 64bit)) with ESMTPSA id <0LC3001MLDJRLK60@asmtp025.mac.com>; Thu, 18 Nov 2010 09:50:17 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1010190000 definitions=main-1011180135 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2010-11-18_08:2010-11-18, 2010-11-18, 1970-01-01 signatures=0 From: Marcel Moolenaar In-reply-to: <4CE505B2.6010601@yandex.ru> Date: Thu, 18 Nov 2010 09:50:16 -0800 Message-id: <8F0B61E9-D84C-4C3F-92CA-C24BC53B9C27@mac.com> References: <4CE505B2.6010601@yandex.ru> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1082) Cc: Marcel Moolenaar , freebsd-geom@FreeBSD.org Subject: Re: backup a partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 17:50:25 -0000 On Nov 18, 2010, at 2:53 AM, Andrey V. Elsukov wrote: > Hi, Marcel and All. > > I'm thinking about such feature like ability to dump partition > table into file from which it can be recovered in the future. > Also it can be used to copy partition table to another device. > > At the moment i think that just print out a list of commands that > should be done to create the same table it is the easiest way. > For example: >> gpart show ada1 > => 34 320172989 ada1 GPT (153G) > 34 512 1 freebsd-boot (256K) > 546 8388608 2 freebsd-swap (4.0G) > 8389154 311783869 3 freebsd-zfs (149G) > >> gpart dump -f x ada1 > geom part create -s gpt -f x ada1 > geom part add -b 34 -s 512 -i 1 -t freebsd-boot -f x ada1 > geom part add -b 546 -s 8388608 -i 2 -t freebsd-swap -f x ada1 > geom part add -b 8389154 -s 311783869 -i 3 -t freebsd-zfs -f x ada1 > > Any comments and ideas are welcome. I think you're on the right track. A binary dump is definitely not useful. Dumping in a replayable form definitely has its advantages. I have no strong opinions yet as to the exact form and/or shape (i.e. script vs. XML). -- Marcel Moolenaar xcllnt@mac.com From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 18:10:33 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB3F6106566C; Thu, 18 Nov 2010 18:10:33 +0000 (UTC) (envelope-from gcr+freebsd-geom@tharned.org) Received: from roadkill.tharned.org (roadkill.tharned.org [75.145.12.185]) by mx1.freebsd.org (Postfix) with ESMTP id 619958FC17; Thu, 18 Nov 2010 18:10:33 +0000 (UTC) Received: from roadkill.tharned.org (11008@roadkill.tharned.org [75.145.12.185]) (authenticated bits=0) by roadkill.tharned.org (8.14.4/8.14.4) with ESMTP id oAII0NFJ069742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Nov 2010 12:00:23 -0600 (CST) (envelope-from gcr+freebsd-geom@tharned.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tharned.org; s=2010; t=1290103223; bh=BlIIr0WcYknh8k/FYeAe5oconZgYBqJuPRoW7uF6aNg=; l=1750; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=a5FNiCAm27/eY7fXpOQsfazCyoXKS/8+JTUrr5qfIM+5EbbLADZBJxBf5ZH7D8T16 Kp+enKfJu/HZ7KopL7NekjVf7oKrndO0RAdrGNykJINJ+PDeliH5JX9AgrhosUyLpd fkROqJGNBCU9d/v7gk0WR4X5/n40cm8QfAPKCrmU= Date: Thu, 18 Nov 2010 12:00:23 -0600 (CST) From: Greg Rivers To: "Andrey V. Elsukov" In-Reply-To: <4CE505B2.6010601@yandex.ru> Message-ID: References: <4CE505B2.6010601@yandex.ru> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (roadkill.tharned.org [75.145.12.185]); Thu, 18 Nov 2010 12:00:23 -0600 (CST) Cc: Marcel Moolenaar , freebsd-geom@freebsd.org Subject: Re: backup a partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 18:10:34 -0000 On Thu, 18 Nov 2010, Andrey V. Elsukov wrote: > Hi, Marcel and All. > > I'm thinking about such feature like ability to dump partition table > into file from which it can be recovered in the future. Also it can be > used to copy partition table to another device. > > At the moment i think that just print out a list of commands that should > be done to create the same table it is the easiest way. > For example: >> gpart show ada1 > => 34 320172989 ada1 GPT (153G) > 34 512 1 freebsd-boot (256K) > 546 8388608 2 freebsd-swap (4.0G) > 8389154 311783869 3 freebsd-zfs (149G) > >> gpart dump -f x ada1 > geom part create -s gpt -f x ada1 > geom part add -b 34 -s 512 -i 1 -t freebsd-boot -f x ada1 > geom part add -b 546 -s 8388608 -i 2 -t freebsd-swap -f x ada1 > geom part add -b 8389154 -s 311783869 -i 3 -t freebsd-zfs -f x ada1 > > Any comments and ideas are welcome. > I think this is a great idea. But why not make gpart eat it's own dog food like bsdlabel(8) does? The output of bsdlabel is a simple text file that's easy for humans to read and edit. bsdlabel takes this very same output as input (-R). bsdlabel also supports wildcards on input, so it will compute starts/offsets for you. And bsdlabel makes it easy to change an existing label by opening the editor on it (-e). So instead of a special dump command or complicated XML formatting, just make "gpart show" output suitable for input (it's probably already close), and add the verb to read that input ("gpart read" or "gpart apply" or such). Add the ability to handle wildcards and run the editor, and gpart could be as friendly to use as bsdlabel is. -- Greg From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 18:48:33 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 658321065695; Thu, 18 Nov 2010 18:48:33 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id 4CE3A8FC14; Thu, 18 Nov 2010 18:48:33 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 64bit)) with ESMTPSA id <0LC30023RG8FGL20@asmtp029.mac.com>; Thu, 18 Nov 2010 10:48:16 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1010190000 definitions=main-1011180153 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2010-11-18_08:2010-11-18, 2010-11-18, 1970-01-01 signatures=0 From: Marcel Moolenaar In-reply-to: Date: Thu, 18 Nov 2010 10:48:15 -0800 Message-id: <77B931B5-8A25-46AC-B14F-9D5F13A964EB@mac.com> References: <4CE505B2.6010601@yandex.ru> To: Greg Rivers X-Mailer: Apple Mail (2.1082) Cc: "Andrey V. Elsukov" , Marcel Moolenaar , freebsd-geom@freebsd.org Subject: Re: backup a partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 18:48:33 -0000 On Nov 18, 2010, at 10:00 AM, Greg Rivers wrote: > > So instead of a special dump command or complicated XML formatting, just make "gpart show" output suitable for input (it's probably already close), and add the verb to read that input ("gpart read" or "gpart apply" or such). Add the ability to handle wildcards and run the editor, and gpart could be as friendly to use as bsdlabel is. BTW: I don't think bsdlabel is friendly to use at all, so I certainly hope not that gpart will become as friendly as bsdlabel. It would be a regression :-) I would not try and mix functionality in a single command. Output suitable for humans is ipso facto unsuitable for machines (and vice versa). I'm sure there are exceptions, but I do not think gpart is one of them. It's better to introduce gpart backup and gpart restore and have them optimized for the purpose than it is to try and solve two independent problems with gpart show, which already has its own problems of providing user-friendly output. -- Marcel Moolenaar xcllnt@mac.com From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 19:58:51 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D998106564A for ; Thu, 18 Nov 2010 19:58:51 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 26F838FC0C for ; Thu, 18 Nov 2010 19:58:49 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id C397C45CAC; Thu, 18 Nov 2010 20:58:46 +0100 (CET) Received: from localhost (chello089073192049.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 11EDC45C89; Thu, 18 Nov 2010 20:58:40 +0100 (CET) Date: Thu, 18 Nov 2010 20:57:57 +0100 From: Pawel Jakub Dawidek To: "Andrey V. Elsukov" Message-ID: <20101118195757.GA2416@garage.freebsd.pl> References: <201011181132.oAIBWucC051624@lurza.secnetix.de> <4CE54B88.9070006@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a8Wt8u1KmwUX3Y2C" Content-Disposition: inline In-Reply-To: <4CE54B88.9070006@yandex.ru> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: marcel@FreeBSD.ORG, Oliver Fromme , freebsd-geom@FreeBSD.ORG Subject: Re: backup a partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 19:58:51 -0000 --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 18, 2010 at 06:51:36PM +0300, Andrey V. Elsukov wrote: > On 18.11.2010 14:32, Oliver Fromme wrote: > > How about an option to dump the table in XML format, and > > another option that creates a table from an XML structure? > >=20 > > (I'm not a huge fan of XML, but in this particular case > > it might be useful.) >=20 > I do not think it is very useful, nor in implementation, nor > in usability. What about add a new standard command to geom(8) > to execute batch of commands? >=20 > > cat geom_class_cmd | geom execute [arg0] > where geom_class_cmd is a list of commands for specific class. > This can get advantage for some geom classes, e.g.: >=20 > > gpart dump ada0 | gpart execute ada1 > this command will make a copy of partition table ada0 to ada1. >=20 > Currently to implement this geom(8) and gpart(8) should be significantly > changed particularly in the errors handling. >=20 > So my question is to Marcel and Pawel - Do you have something > against these changes? Or maybe you can suggest something else? I'd prefer simple text dump of gpart configuration, but not as commands. I find myself often configure systems with more than one disk and would really like to just do the following: # gpart backup ada0 | gpart restore ada1 ada2 ada3 This also means we either not dump labels or not restore them or we have additional option which will/won't restore them. BTW. I noticed that configuring label with 'gpart modify' for existing partition doesn't trigger taste, so new label doesn't appear in /dev/gpt/. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --a8Wt8u1KmwUX3Y2C Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkzlhUUACgkQForvXbEpPzT6hACfcqiE7wx484Z7x8uaQbQ5z5Ul jcoAn2Cnj7Rkv/1gJ0XjiPgLMM7mA7WD =pgN6 -----END PGP SIGNATURE----- --a8Wt8u1KmwUX3Y2C-- From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 20:03:19 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37A94106566C for ; Thu, 18 Nov 2010 20:03:19 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id DBB4B8FC12 for ; Thu, 18 Nov 2010 20:03:18 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id E06B945CA0; Thu, 18 Nov 2010 21:03:17 +0100 (CET) Received: from localhost (chello089073192049.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 6E57145C89; Thu, 18 Nov 2010 21:03:12 +0100 (CET) Date: Thu, 18 Nov 2010 21:02:28 +0100 From: Pawel Jakub Dawidek To: Guido van Rooij Message-ID: <20101118200228.GB2416@garage.freebsd.pl> References: <20101118163323.GA2524@gvr.gvr.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="v9Ux+11Zm5mwPlX6" Content-Disposition: inline In-Reply-To: <20101118163323.GA2524@gvr.gvr.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-geom@freebsd.org Subject: Re: Booting from a gmirror always leads to a broken gmirror X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 20:03:19 -0000 --v9Ux+11Zm5mwPlX6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 18, 2010 at 05:33:23PM +0100, Guido van Rooij wrote: > Hi, >=20 > I am running 8.1-RELEASE with the folloing mirror setup: [...] > Nov 18 15:36:01 gvr kernel: GEOM_MIRROR: Component da0 (device gm0) broke= n, skipping. > Nov 18 15:36:01 gvr kernel: GEOM_MIRROR: Device mirror/gm0 launched (1/2). > Nov 18 15:36:01 gvr kernel: Enter passphrase for da0s2:=20 >=20 > Now, the passphrase the geli asks, is for the so-called broken disk. But = it is not broken. > I can always rebuild it fine when I rebooted and re-insert da0.=20 > My question: why does gmirror mark da0 as broken? I can't answer it just yet, but can you set kern.geom.mirror.debug=3D2 from the loader prompt and send the debug output here? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --v9Ux+11Zm5mwPlX6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkzlhlMACgkQForvXbEpPzQXkwCdHkorwOcaqZ1WnAAoKVlFPwUf z+MAn0fWz5dStRcPqsM6saE/zYSqQOTA =HuWu -----END PGP SIGNATURE----- --v9Ux+11Zm5mwPlX6-- From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 20:20:20 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6444A1065670; Thu, 18 Nov 2010 20:20:20 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout027.mac.com (asmtpout027.mac.com [17.148.16.102]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE168FC0A; Thu, 18 Nov 2010 20:20:20 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from sa-nc-common3-115.static.jnpr.net ([66.129.224.36]) by asmtp027.mac.com (Oracle Communications Messaging Exchange Server 7u4-18.01 64bit (built Jul 15 2010)) with ESMTPSA id <0LC3000PUKHSB780@asmtp027.mac.com>; Thu, 18 Nov 2010 12:20:19 -0800 (PST) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2010-11-18_08:2010-11-18, 2010-11-18, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1010190000 definitions=main-1011180168 From: Marcel Moolenaar In-reply-to: <20101118195757.GA2416@garage.freebsd.pl> Date: Thu, 18 Nov 2010 12:20:15 -0800 Message-id: References: <201011181132.oAIBWucC051624@lurza.secnetix.de> <4CE54B88.9070006@yandex.ru> <20101118195757.GA2416@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1082) Cc: marcel@FreeBSD.ORG, "Andrey V. Elsukov" , Oliver Fromme , freebsd-geom@FreeBSD.ORG Subject: Re: backup a partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 20:20:20 -0000 On Nov 18, 2010, at 11:57 AM, Pawel Jakub Dawidek wrote: > BTW. I noticed that configuring label with 'gpart modify' for existing > partition doesn't trigger taste, so new label doesn't appear in /dev/gpt/. This is deliberate. "gpart modify" changes meta-data that does not affect the existing geom and as such allows modification of on-disk meta-data while the geom is open. The label in the partition table is one such piece of information you can change safely. The starting LBA or size are examples of things that cannot be changed while the geom is open and for that we have different verbs. The fact that this kind of information is being interpreted outside of gpart and without the knowledge of gpart is where the problem is. -- Marcel Moolenaar xcllnt@mac.com From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 20:22:05 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 229061065672 for ; Thu, 18 Nov 2010 20:22:05 +0000 (UTC) (envelope-from fb-geom@psconsult.nl) Received: from mx1.psconsult.nl (unknown [IPv6:2001:7b8:30f:e0::5059:ee8a]) by mx1.freebsd.org (Postfix) with ESMTP id A81178FC0A for ; Thu, 18 Nov 2010 20:22:04 +0000 (UTC) Received: from mx1.psconsult.nl (psc11.adsl.iaf.nl [80.89.238.138]) by mx1.psconsult.nl (8.14.4/8.14.4) with ESMTP id oAIKLumF054359 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 18 Nov 2010 21:22:01 +0100 (CET) (envelope-from fb-geom@psconsult.nl) Received: (from paul@localhost) by mx1.psconsult.nl (8.14.4/8.14.4/Submit) id oAIKLuPG054358 for freebsd-geom@freebsd.org; Thu, 18 Nov 2010 21:21:56 +0100 (CET) (envelope-from fb-geom@psconsult.nl) X-Authentication-Warning: mx1.psconsult.nl: paul set sender to fb-geom@psconsult.nl using -f Date: Thu, 18 Nov 2010 21:21:56 +0100 From: Paul Schenkeveld To: freebsd-geom@freebsd.org Message-ID: <20101118202156.GA45692@psconsult.nl> References: <20101118163323.GA2524@gvr.gvr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101118163323.GA2524@gvr.gvr.org> User-Agent: Mutt/1.5.19 (2009-01-05) Subject: Re: Booting from a gmirror always leads to a broken gmirror X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 20:22:05 -0000 Hi Guido, On Thu, Nov 18, 2010 at 05:33:23PM +0100, Guido van Rooij wrote: > Hi, > > I am running 8.1-RELEASE with the folloing mirror setup: > Geom name: gm0 > State: DEGRADED > Components: 2 > Balance: round-robin > Slice: 4096 > Flags: NONE > GenID: 3 > SyncID: 2 > ID: 2610005691 > Providers: > 1. Name: mirror/gm0 > Mediasize: 500107861504 (466G) > Sectorsize: 512 > Mode: r3w2e5 > Consumers: > 1. Name: da1 > Mediasize: 500107862016 (466G) > Sectorsize: 512 > Mode: r1w1e1 > State: ACTIVE > Priority: 0 > Flags: DIRTY > GenID: 3 > SyncID: 2 > ID: 3263791510 > 2. Name: da0 > Mediasize: 500107862016 (466G) > Sectorsize: 512 > Mode: r1w1e1 > State: SYNCHRONIZING > Priority: 0 > Flags: DIRTY, SYNCHRONIZING > GenID: 3 > SyncID: 2 > Synchronized: 15% > ID: 4162979509 > > I have a dedicated slice to boot from and one GELI slice, both on the mirror. > Now when I reboot this system (at a time when the mirror is 100% fine, unlike above), the following happens: > Nov 18 15:36:01 gvr kernel: Root mount waiting for: usbus4 > Nov 18 15:36:01 gvr kernel: ugen4.2: at usbus4 > Nov 18 15:36:01 gvr kernel: umass0: v 2.00/1.75, addr 2> on usbus4 > Nov 18 15:36:01 gvr kernel: ugen1.2: at usbus1 > Nov 18 15:36:01 gvr kernel: uhub6: 1.10/1.10, addr 2> on usbus1 > Nov 18 15:36:01 gvr kernel: uhub5: 4 ports with 1 removable, self powered > Nov 18 15:36:01 gvr kernel: Root mount waiting for: usbus4 > Nov 18 15:36:01 gvr kernel: uhub6: 3 ports with 2 removable, bus powered > Nov 18 15:36:01 gvr kernel: da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 > Nov 18 15:36:01 gvr kernel: da0: Fixed Direct Access > SCSI-4 device > Nov 18 15:36:01 gvr kernel: da0: 40.000MB/s transfers > Nov 18 15:36:01 gvr kernel: da0: 476940MB (976773168 512 byte sectors: 255H 63S/ > T 60801C) > Nov 18 15:36:01 gvr kernel: ugen1.3: at usbus1 > Nov 18 15:36:01 gvr kernel: ugen4.3: at usbus4 > Nov 18 15:36:01 gvr kernel: umass1: v 2.00/1.75, addr 3> on usbus4 > Nov 18 15:36:01 gvr kernel: da1 at umass-sim1 bus 1 scbus1 target 0 lun 0 > Nov 18 15:36:01 gvr kernel: da1: Fixed Direct Access > SCSI-4 device > Nov 18 15:36:01 gvr kernel: da1: 40.000MB/s transfers > Nov 18 15:36:01 gvr kernel: da1: 476940MB (976773168 512 byte sectors: 255H 63S/ > T 60801C) > Nov 18 15:36:01 gvr kernel: GEOM_MIRROR: Component da0 (device gm0) broken, skipping. > Nov 18 15:36:01 gvr kernel: GEOM_MIRROR: Device mirror/gm0 launched (1/2). > Nov 18 15:36:01 gvr kernel: Enter passphrase for da0s2: Your mirror covers the whole drives da0 amd da1. Geli discovers a encrypted provider on da0s2, which sounds odd. Is geli supposed to find gm0s2 instead? GEOM_MIRROR reports component da0 as broken, could it be that its metadata is not updated correctly at shutdown? Your disks are connected thru USB, which is a bit tricky. I've some experience with a machine that once had a three disk graid3 connected through USB. After a normal shutdown (or reboot) graid3 came up fine but I remember that at some occasions graid3 found one of its providers broken and atarted a rebuild. Could you try the following: 1 Shutdown the computer, watch carefully for any errors regarding gm0 or the physical disks. 2 Boot a kernel without geom_mirror and geom_eli classes compiled in (e.g. a GENERIC kernel) from CDROM or USB stick. 3 Look at the gmirror metadata with gmirror dump da0 and gmirror dump da1 to see if they are in sync. Did differs, priority for one disk should be 0 the other 1, the md5 hash differs but all other fields should be equal for both disks. > Now, the passphrase the geli asks, is for the so-called broken disk. But it is not broken. > I can always rebuild it fine when I rebooted and re-insert da0. > My question: why does gmirror mark da0 as broken? > > -Guido > > _______________________________________________ > freebsd-geom@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-geom > To unsubscribe, send any mail to "freebsd-geom-unsubscribe@freebsd.org" From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 20:44:33 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F2F4106566C; Thu, 18 Nov 2010 20:44:33 +0000 (UTC) (envelope-from gcr+freebsd-geom@tharned.org) Received: from roadkill.tharned.org (roadkill.tharned.org [75.145.12.185]) by mx1.freebsd.org (Postfix) with ESMTP id D29918FC0C; Thu, 18 Nov 2010 20:44:32 +0000 (UTC) Received: from roadkill.tharned.org (11008@roadkill.tharned.org [75.145.12.185]) (authenticated bits=0) by roadkill.tharned.org (8.14.4/8.14.4) with ESMTP id oAIKiVd4070971 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Nov 2010 14:44:31 -0600 (CST) (envelope-from gcr+freebsd-geom@tharned.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tharned.org; s=2010; t=1290113072; bh=a9BOW0lBhjyCNmYkkKVKl0GD4tjIIaEM++rEpwvjh5Q=; l=1773; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=JZg6KjdrMIZ/o/QInZsdWK+7eQFJi4nFjPekNJ49nbRSC+LgDb+Ebv/+j5QxQsiBd Rl8ncg+oCHw1RfjXUte2FdEMy3j+LVGduCdrJux3rq+vv8ZaOev+RpmNqkyP10/zhI DzolQAGw97fxwqyOH5NPYQ9q/PiPpXX5Td+7Y87Q= Date: Thu, 18 Nov 2010 14:44:31 -0600 (CST) From: Greg Rivers To: Marcel Moolenaar In-Reply-To: <77B931B5-8A25-46AC-B14F-9D5F13A964EB@mac.com> Message-ID: References: <4CE505B2.6010601@yandex.ru> <77B931B5-8A25-46AC-B14F-9D5F13A964EB@mac.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (roadkill.tharned.org [75.145.12.185]); Thu, 18 Nov 2010 14:44:32 -0600 (CST) Cc: "Andrey V. Elsukov" , Marcel Moolenaar , freebsd-geom@freebsd.org Subject: Re: backup a partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 20:44:33 -0000 On Thu, 18 Nov 2010, Marcel Moolenaar wrote: > On Nov 18, 2010, at 10:00 AM, Greg Rivers wrote: >> >> So instead of a special dump command or complicated XML formatting, >> just make "gpart show" output suitable for input (it's probably already >> close), and add the verb to read that input ("gpart read" or "gpart >> apply" or such). Add the ability to handle wildcards and run the >> editor, and gpart could be as friendly to use as bsdlabel is. > > BTW: I don't think bsdlabel is friendly to use at all, so I certainly > hope not that gpart will become as friendly as bsdlabel. It would be a > regression :-) > > I would not try and mix functionality in a single command. Output > suitable for humans is ipso facto unsuitable for machines (and vice > versa). I'm sure there are exceptions, but I do not think gpart is one > of them. > > It's better to introduce gpart backup and gpart restore and have them > optimized for the purpose than it is to try and solve two independent > problems with gpart show, which already has its own problems of > providing user-friendly output. > I appreciate the humor, but I'd hazard a guess that I'm not the only one who misses bsdlabel's functionality in gpart. :-) I did not intend what I said to be taken as criticism of gpart. But bsdlabel's behavior is consistent with fdisk(8) too (-p, -f), and also with Solaris' prtvtoc(1M) and fmthard(1M). Historically, it's pretty much expected that partition managers work that way or at least have that feature. Maybe "gpart show" shouldn't be overloaded, but having something like "gpart backup" and "gpart restore" working on a format that's easily readable and editable by a person would be a real feature. -- Greg From owner-freebsd-geom@FreeBSD.ORG Thu Nov 18 20:56:04 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D7B110656AA; Thu, 18 Nov 2010 20:56:04 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout023.mac.com (asmtpout023.mac.com [17.148.16.98]) by mx1.freebsd.org (Postfix) with ESMTP id 2408B8FC19; Thu, 18 Nov 2010 20:56:03 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from sa-nc-common3-115.static.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp023.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0LC300C23M4DHUA0@asmtp023.mac.com>; Thu, 18 Nov 2010 12:55:27 -0800 (PST) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1010190000 definitions=main-1011180175 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2010-11-18_08:2010-11-18, 2010-11-18, 1970-01-01 signatures=0 From: Marcel Moolenaar In-reply-to: Date: Thu, 18 Nov 2010 12:55:24 -0800 Message-id: <991E8AA1-1D20-4E4C-BE6F-05ACE42FEF1E@mac.com> References: <4CE505B2.6010601@yandex.ru> <77B931B5-8A25-46AC-B14F-9D5F13A964EB@mac.com> To: Greg Rivers X-Mailer: Apple Mail (2.1082) Cc: "Andrey V. Elsukov" , Marcel Moolenaar , freebsd-geom@freebsd.org Subject: Re: backup a partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 20:56:04 -0000 On Nov 18, 2010, at 12:44 PM, Greg Rivers wrote: > > But bsdlabel's behavior is consistent with fdisk(8) too (-p, -f), and also with Solaris' prtvtoc(1M) and fmthard(1M). Historically, it's pretty much expected that partition managers work that way or at least have that feature. It's a nice feature, but it isn't always possible or easy to implement with the right semantics. > Maybe "gpart show" shouldn't be overloaded, but having something like "gpart backup" and "gpart restore" working on a format that's easily readable and editable by a person would be a real feature. I agree. -- Marcel Moolenaar xcllnt@mac.com From owner-freebsd-geom@FreeBSD.ORG Fri Nov 19 09:41:37 2010 Return-Path: Delivered-To: freebsd-geom@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1C371065672; Fri, 19 Nov 2010 09:41:37 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward3.mail.yandex.net (forward3.mail.yandex.net [77.88.46.8]) by mx1.freebsd.org (Postfix) with ESMTP id 9C6CD8FC13; Fri, 19 Nov 2010 09:41:37 +0000 (UTC) Received: from smtp4.mail.yandex.net (smtp4.mail.yandex.net [77.88.46.104]) by forward3.mail.yandex.net (Yandex) with ESMTP id 7CAB34D88088; Fri, 19 Nov 2010 12:41:35 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1290159695; bh=51Ol4sbFemIf/xylJ04HBGg69ZyaCoQUu/8JSZVWmkY=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=xFt2SPGlpHpqmSc3MPSccgZ5o2sxKLWB2BK2pSUoTkFNGy1HYr34KYo+dZ7Lqn/Gj s1jz2GnqATPqmDajKWCr9/kfHx49qKCl/wW7VprvRXqWUxMa6nMtqXTMVdKCIp3l4K wV4ycrX3rQjZQzdisEIzsESFqermfu2cwYjlfHhc= Received: from [127.0.0.1] (ns.kirov.so-ups.ru [77.72.136.145]) by smtp4.mail.yandex.net (Yandex) with ESMTPSA id 0B4DF128094; Fri, 19 Nov 2010 12:41:31 +0300 (MSK) Message-ID: <4CE64646.1060201@yandex.ru> Date: Fri, 19 Nov 2010 12:41:26 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201011181132.oAIBWucC051624@lurza.secnetix.de> <4CE54B88.9070006@yandex.ru> <20101118195757.GA2416@garage.freebsd.pl> In-Reply-To: <20101118195757.GA2416@garage.freebsd.pl> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig2E58E9FAA86F5AC62C6EF75D" Cc: marcel@FreeBSD.ORG, Oliver Fromme , freebsd-geom@FreeBSD.ORG Subject: Re: backup a partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 09:41:38 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig2E58E9FAA86F5AC62C6EF75D Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 18.11.2010 22:57, Pawel Jakub Dawidek wrote: > I'd prefer simple text dump of gpart configuration, but not as commands= =2E > I find myself often configure systems with more than one disk and would= > really like to just do the following: >=20 > # gpart backup ada0 | gpart restore ada1 ada2 ada3 >=20 > This also means we either not dump labels or not restore them or we hav= e > additional option which will/won't restore them. I do not like this method because it means that gpart(8) duplicates part = of functionality which geom(8) does. But i think it is very handy from user'= s point of view. --=20 WBR, Andrey V. Elsukov --------------enig2E58E9FAA86F5AC62C6EF75D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJM5kZKAAoJEAHF6gQQyKF6UlwH/3VmBJULCsCPe1ALatXaTiiD AMT7QvvcIJ1hrATCn72Lsn73a3d46qa3mqi0isMn7c8GhI+/pr7PYP6JVFS+eK0j ZwMkaVH7qCGnmo+7ufIXm7Qd3vzwOW20RBKbaDHGYF+c0NDTYxC+vw9czSkZFrEk /hgoa8tSg6MIz69wL4FZXxbsKHXpjdszxxjxlCPVe+OJ05GwnyXL/6lLigUg4l24 FneGRXCivPcCdVnfgCRsxdTJgGqxc0ww3hZTHBzf+4mqfgGjcNqBY2HDusbY/4Pu K70s6IbEQII3Al+UujXOD2x3G1W6M0HGZ+YXbcTgD0hwnt35QkiNVir7PDKnUCE= =tLim -----END PGP SIGNATURE----- --------------enig2E58E9FAA86F5AC62C6EF75D-- From owner-freebsd-geom@FreeBSD.ORG Fri Nov 19 18:48:38 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E452C1065674; Fri, 19 Nov 2010 18:48:38 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward19.mail.yandex.net (forward19.mail.yandex.net [95.108.253.144]) by mx1.freebsd.org (Postfix) with ESMTP id 3FE418FC18; Fri, 19 Nov 2010 18:48:37 +0000 (UTC) Received: from smtp18.mail.yandex.net (smtp18.mail.yandex.net [95.108.252.18]) by forward19.mail.yandex.net (Yandex) with ESMTP id EF33D3440411; Fri, 19 Nov 2010 21:48:35 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1290192516; bh=bXktV7yLAHE8VJq0obMTsw097ozXJH7ZjvTBiT97oJ0=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:Content-Type; b=pAMYjVVTWHKml4APmeFNaWHZUvj3QdT4vscgLQi5XiqBxb84+Oou+rl5f0WHMs746 zXv5z6aPmkHb6Z+DQpLOebbEWjW8sxmQNT+pZGWwbVgaX29f7CkBraIkrl0011qiiL GPeQXiECbWOrYq1RoybWwKggZY3xffmlEnjIOIZY= Received: from [10.43.163.197] (nat-92-39-77-34.kirov.comstar-r.ru [92.39.77.34]) by smtp18.mail.yandex.net (Yandex) with ESMTPSA id 645A836780A0; Fri, 19 Nov 2010 21:48:35 +0300 (MSK) Message-ID: <4CE6C67A.2020904@yandex.ru> Date: Fri, 19 Nov 2010 21:48:26 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101030 Thunderbird/3.1.6 MIME-Version: 1.0 To: freebsd-geom@freebsd.org X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig9F551532C9939F52D7371402" Cc: Marcel Moolenaar , Pawel Jakub Dawidek , Andriy Gapon Subject: [RFC][patch] backup/restore partition table with gpart(8) X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 18:48:39 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9F551532C9939F52D7371402 Content-Type: multipart/mixed; boundary="------------050905090402080807000203" This is a multi-part message in MIME format. --------------050905090402080807000203 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Hi, So, first working patch is attached. Two new sub-commands added to gpart(8): gpart backup [-l] geom gpart restore [-F] [-f flags] geom [...] "backup" command does dump partition table in simple text format to standard output. With -l specified it does dump with partition's labels. The format is simple, e.g: # gpart show ada0 =3D> 34 1250263661 ada0 GPT (596G) 34 256 1 freebsd-boot (128K) 290 8388608 2 freebsd-swap (4.0G) 8388898 1241874797 3 freebsd-zfs (592G) # gpart show -l ada0 =3D> 34 1250263661 ada0 GPT (596G) 34 256 1 boot00 (128K) 290 8388608 2 swap00 (4.0G) 8388898 1241874797 3 zfs00 (592G) # gpart backup ada0 GPT 128 1 freebsd-boot 34 256 2 freebsd-swap 290 8388608 3 freebsd-zfs 8388898 1241874797 # gpart backup -l ada0 GPT 128 1 freebsd-boot 34 256 boot00 2 freebsd-swap 290 8388608 swap00 3 freebsd-zfs 8388898 1241874797 zfs00 First line - partition scheme name and number of entries. Next lines - partition table entries in the following format: [label] [attributes] Last two fields are optional. "restore" command reads these commands from standard input. With -F option it destroys partition table on specified geoms before doing restore. gpart does try to done all commands with auto-commit disabled. And it does rollback when error occurs. If all commands successfully done it calls "commit". Small example: # mdconfig -s 100m md0 # mdconfig -s 100m md1 # mdconfig -s 100m md2 # gpart create -s gpt md0 md0 created # gpart add -t freebsd-boot -s 128k md0 md0p1 added # gpart add -t freebsd-zfs md0 md0p2 added # gpart show md0 =3D> 34 204733 md0 GPT (100M) 34 256 1 freebsd-boot (128K) 290 204477 2 freebsd-zfs (100M) # gpart backup md0 | gpart restore md1 md2 # gpart show md0 md1 md2 =3D> 34 204733 md0 GPT (100M) 34 256 1 freebsd-boot (128K) 290 204477 2 freebsd-zfs (100M) =3D> 34 204733 md1 GPT (100M) 34 256 1 freebsd-boot (128K) 290 204477 2 freebsd-zfs (100M) =3D> 34 204733 md2 GPT (100M) 34 256 1 freebsd-boot (128K) 290 204477 2 freebsd-zfs (100M) # gpart restore -F md0 md1 mbr 4 1 freebsd * * [active] ^D # gpart show md0 md1 =3D> 9 204786 md0 MBR (100M) 9 204786 1 freebsd [active] (100M) =3D> 9 204786 md1 MBR (100M) 9 204786 1 freebsd [active] (100M) --=20 WBR, Andrey V. Elsukov --------------050905090402080807000203 Content-Type: text/plain; name="gpart_backup_restore.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="gpart_backup_restore.diff" Index: head/sbin/geom/class/part/geom_part.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head/sbin/geom/class/part/geom_part.c (revision 215454) +++ head/sbin/geom/class/part/geom_part.c (working copy) @@ -85,6 +85,8 @@ static int gpart_show_hasopt(struct gctl_req *, co static void gpart_write_partcode(struct ggeom *, int, void *, ssize_t); static void gpart_write_partcode_vtoc8(struct ggeom *, int, void *); static void gpart_print_error(const char *); +static void gpart_backup(struct gctl_req *, unsigned int); +static void gpart_restore(struct gctl_req *, unsigned int); =20 struct g_command PUBSYM(class_commands)[] =3D { { "add", 0, gpart_issue, { @@ -97,6 +99,11 @@ struct g_command PUBSYM(class_commands)[] =3D { G_OPT_SENTINEL }, "[-b start] [-s size] -t type [-i index] [-l label] [-f flags] geom= " }, + { "backup", 0, gpart_backup, { + { 'l', "backup_labels", NULL, G_TYPE_BOOL}, + G_OPT_SENTINEL }, + "[-l] geom" + }, { "bootcode", 0, gpart_bootcode, { { 'b', GPART_PARAM_BOOTCODE, G_VAL_OPTIONAL, G_TYPE_STRING }, { 'p', GPART_PARAM_PARTCODE, G_VAL_OPTIONAL, G_TYPE_STRING }, @@ -165,6 +172,12 @@ struct g_command PUBSYM(class_commands)[] =3D { G_OPT_SENTINEL }, "[-s size] -i index [-f flags] geom" }, + { "restore", 0, gpart_restore, { + { 'F', "force", NULL, G_TYPE_BOOL }, + { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, + G_OPT_SENTINEL }, + "[-F] [-f flags] geom ..." + }, { "recover", 0, gpart_issue, { { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, @@ -654,6 +667,279 @@ gpart_show(struct gctl_req *req, unsigned int fl _ geom_deletetree(&mesh); } =20 +static void +gpart_backup(struct gctl_req *req, unsigned int fl __unused) +{ + struct gmesh mesh; + struct gclass *classp; + struct gprovider *pp; + struct ggeom *gp; + const char *s, *scheme; + off_t sector, end; + off_t length, secsz; + int error, labels, i, windex, wblocks, wtype; + + if (gctl_get_int(req, "nargs") !=3D 1) + errx(EXIT_FAILURE, "Invalid number of arguments."); + error =3D geom_gettree(&mesh); + if (error !=3D 0) + errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); + s =3D gctl_get_ascii(req, "class"); + if (s =3D=3D NULL) + abort(); + classp =3D find_class(&mesh, s); + if (classp =3D=3D NULL) { + geom_deletetree(&mesh); + errx(EXIT_FAILURE, "Class %s not found.", s); + } + s =3D gctl_get_ascii(req, "arg0"); + if (s =3D=3D NULL) + abort(); + labels =3D gctl_get_int(req, "backup_labels"); + gp =3D find_geom(classp, s); + if (gp =3D=3D NULL) + errx(EXIT_FAILURE, "No such geom: %s.", s); + scheme =3D find_geomcfg(gp, "scheme"); + if (scheme =3D=3D NULL) + abort(); + pp =3D LIST_FIRST(&gp->lg_consumer)->lg_provider; + secsz =3D pp->lg_sectorsize; + s =3D find_geomcfg(gp, "last"); + wblocks =3D strlen(s); + wtype =3D 0; + LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { + s =3D find_provcfg(pp, "type"); + i =3D strlen(s); + if (i > wtype) + wtype =3D i; + } + s =3D find_geomcfg(gp, "entries"); + windex =3D strlen(s); + printf("%s %s\n", scheme, s); + LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { + s =3D find_provcfg(pp, "start"); + if (s =3D=3D NULL) { + s =3D find_provcfg(pp, "offset"); + sector =3D (off_t)strtoimax(s, NULL, 0) / secsz; + } else + sector =3D (off_t)strtoimax(s, NULL, 0); + + s =3D find_provcfg(pp, "end"); + if (s =3D=3D NULL) { + s =3D find_provcfg(pp, "length"); + length =3D (off_t)strtoimax(s, NULL, 0) / secsz; + } else { + end =3D (off_t)strtoimax(s, NULL, 0); + length =3D end - sector + 1; + } + s =3D find_provcfg(pp, "label"); + printf("%-*s %*s %*jd %*jd", + windex, find_provcfg(pp, "index"), + wtype, find_provcfg(pp, "type"), + wblocks, (intmax_t)sector, + wblocks, (intmax_t)length); + if (labels && s !=3D NULL) + printf(" %s", s); + printf(" %s\n", fmtattrib(pp)); + } + geom_deletetree(&mesh); +} + +static void +gpart_restore(struct gctl_req *req, unsigned int fl __unused) +{ + struct gmesh mesh; + struct gclass *classp; + struct gctl_req *r; + struct ggeom *gp; + const char *s, *flags, *errstr, *label; + char **ap, *argv[6], line[BUFSIZ], *pline; + int error, forced, i, l, nargs, created; + intmax_t n; + + nargs =3D gctl_get_int(req, "nargs"); + if (nargs < 1) + errx(EXIT_FAILURE, "Invalid number of arguments."); + + forced =3D gctl_get_int(req, "force"); + flags =3D gctl_get_ascii(req, "flags"); + s =3D gctl_get_ascii(req, "class"); + if (s =3D=3D NULL) + abort(); + error =3D geom_gettree(&mesh); + if (error !=3D 0) + errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); + classp =3D find_class(&mesh, s); + if (classp =3D=3D NULL) { + geom_deletetree(&mesh); + errx(EXIT_FAILURE, "Class %s not found.", s); + } + if (forced) { + /* destroy existent partition table before restore */ + for (i =3D 0; i < nargs; i++) { + s =3D gctl_get_ascii(req, "arg%d", i); + gp =3D find_geom(classp, s); + if (gp !=3D NULL) { + r =3D gctl_get_handle(); + gctl_ro_param(r, "class", -1, + classp->lg_name); + gctl_ro_param(r, "verb", -1, "destroy"); + gctl_ro_param(r, "flags", -1, "restore"); + gctl_ro_param(r, "force", sizeof(forced), + &forced); + gctl_ro_param(r, "arg0", -1, s); + errstr =3D gctl_issue(r); + if (errstr !=3D NULL && errstr[0] !=3D '\0') { + gpart_print_error(errstr); + gctl_free(r); + goto backout; + } + gctl_free(r); + } + } + } + created =3D 0; + while (fgets(line, sizeof(line) - 1, stdin)) { + /* Format of backup entries: + * + * [label] ['['attrib[,attrib]']'] + */ + pline =3D (char *)line; + pline[strlen(line) - 1] =3D 0; + for (ap =3D argv, l =3D 0; + (*ap =3D strsep(&pline, " \t")) !=3D NULL;) + if (**ap !=3D '\0' && ++ap >=3D &argv[6]) + break; + l =3D ap - &argv[0]; + label =3D pline =3D NULL; + if (l =3D=3D 2) { /* create table */ + if (created) + errx(EXIT_FAILURE, "Incorrect backup format."); + n =3D atoi(argv[1]); + for (i =3D 0; i < nargs; i++) { + s =3D gctl_get_ascii(req, "arg%d", i); + r =3D gctl_get_handle(); + n =3D strtoimax(argv[1], NULL, 0); + gctl_ro_param(r, "class", -1, + classp->lg_name); + gctl_ro_param(r, "verb", -1, "create"); + gctl_ro_param(r, "scheme", -1, argv[0]); + gctl_ro_param(r, "entries", sizeof(n), &n); + gctl_ro_param(r, "flags", -1, "restore"); + gctl_ro_param(r, "arg0", -1, s); + errstr =3D gctl_issue(r); + if (errstr !=3D NULL && errstr[0] !=3D '\0') { + gpart_print_error(errstr); + gctl_free(r); + goto backout; + } + gctl_free(r); + } + created =3D 1; + continue; + } else if (l < 4 || created =3D=3D 0) + errx(EXIT_FAILURE, "Incorrect backup format."); + else if (l =3D=3D 5) { + if (strchr(argv[4], '[') =3D=3D NULL) + label =3D argv[4]; + else + pline =3D argv[4]; + } else if (l =3D=3D 6) { + label =3D argv[4]; + pline =3D argv[5]; + } + /* Add partitions to each table */ + for (i =3D 0; i < nargs; i++) { + s =3D gctl_get_ascii(req, "arg%d", i); + r =3D gctl_get_handle(); + n =3D strtoimax(argv[0], NULL, 0); + gctl_ro_param(r, "class", -1, classp->lg_name); + gctl_ro_param(r, "verb", -1, "add"); + gctl_ro_param(r, "flags", -1, "restore"); + gctl_ro_param(r, GPART_PARAM_INDEX, sizeof(n), &n); + gctl_ro_param(r, "type", -1, argv[1]); + gctl_ro_param(r, "start", -1, argv[2]); + gctl_ro_param(r, "size", -1, argv[3]); + if (label !=3D NULL) + gctl_ro_param(r, "label", -1, argv[4]); + gctl_ro_param(r, "arg0", -1, s); + error =3D gpart_autofill(r); + if (error !=3D 0) + errc(EXIT_FAILURE, error, "autofill"); + errstr =3D gctl_issue(r); + if (errstr !=3D NULL && errstr[0] !=3D '\0') { + gpart_print_error(errstr); + gctl_free(r); + goto backout; + } + gctl_free(r); + } + if (pline =3D=3D NULL || *pline !=3D '[') + continue; + /* set attributes */ + pline++; + for (ap =3D argv, l =3D 0; + (*ap =3D strsep(&pline, ",]")) !=3D NULL;) + if (**ap !=3D '\0' && ++ap >=3D &argv[6]) + break; + for (i =3D 0; i < nargs; i++) { + l =3D ap - &argv[0]; + s =3D gctl_get_ascii(req, "arg%d", i); + while (l > 0) { + r =3D gctl_get_handle(); + gctl_ro_param(r, "class", -1, classp->lg_name); + gctl_ro_param(r, "verb", -1, "set"); + gctl_ro_param(r, "flags", -1, "restore"); + gctl_ro_param(r, GPART_PARAM_INDEX, + sizeof(n), &n); + gctl_ro_param(r, "attrib", -1, argv[--l]); + gctl_ro_param(r, "arg0", -1, s); + errstr =3D gctl_issue(r); + if (errstr !=3D NULL && errstr[0] !=3D '\0') { + gpart_print_error(errstr); + gctl_free(r); + goto backout; + } + gctl_free(r); + } + } + } + /* commit changes if needed */ + if (strchr(flags, 'C') !=3D NULL) { + for (i =3D 0; i < nargs; i++) { + s =3D gctl_get_ascii(req, "arg%d", i); + r =3D gctl_get_handle(); + gctl_ro_param(r, "class", -1, classp->lg_name); + gctl_ro_param(r, "verb", -1, "commit"); + gctl_ro_param(r, "arg0", -1, s); + errstr =3D gctl_issue(r); + if (errstr !=3D NULL && errstr[0] !=3D '\0') { + gpart_print_error(errstr); + gctl_free(r); + goto backout; + } + gctl_free(r); + } + } + gctl_free(req); + geom_deletetree(&mesh); + exit(EXIT_SUCCESS); + +backout: + for (i =3D 0; i < nargs; i++) { + s =3D gctl_get_ascii(req, "arg%d", i); + r =3D gctl_get_handle(); + gctl_ro_param(r, "class", -1, classp->lg_name); + gctl_ro_param(r, "verb", -1, "undo"); + gctl_ro_param(r, "arg0", -1, s); + gctl_issue(r); + gctl_free(r); + } + gctl_free(req); + geom_deletetree(&mesh); + exit(EXIT_FAILURE); +} + static void * gpart_bootfile_read(const char *bootfile, ssize_t *size) { --------------050905090402080807000203-- --------------enig9F551532C9939F52D7371402 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iQEcBAEBAgAGBQJM5saBAAoJEAHF6gQQyKF6f34H/3hd9poaKD7p5SfL0A+AdkGt Qw0hYnHyhxdGL4eBeaqUWZrbl2p2ZtpQ5ITbEcTXW5D/hauHPD7PIYTMipsmfUUU RSc2zMPmMKlHiskDv39Ea7cJhUf/5uPBsg1I8vqed73dohU3sl5wboRVhjhso849 uy9HnBSv8/MG/ZMqFwuiCN/VLvOz26Il9tCtp8jAVDRzmCBv11f/5xnZV94Gh6qp RR1C4OV7oJ3xDffBMo6gvUPhCPklV0WRvPoRq6Xr+ZCOO1GlXuUGPYLwN+PCYyvR RXS02fTjy+uT6N/58IjILIDA39fMk1i/lu5WU+pE3f3ssrzwBR6/ztCU/P3N1Yw= =2nYz -----END PGP SIGNATURE----- --------------enig9F551532C9939F52D7371402-- From owner-freebsd-geom@FreeBSD.ORG Fri Nov 19 19:08:33 2010 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8978F106564A for ; Fri, 19 Nov 2010 19:08:33 +0000 (UTC) (envelope-from olavgjerde@yahoo.no) Received: from nm19-vm0.bullet.mail.ukl.yahoo.com (nm19-vm0.bullet.mail.ukl.yahoo.com [217.146.183.113]) by mx1.freebsd.org (Postfix) with SMTP id EE3278FC08 for ; Fri, 19 Nov 2010 19:08:32 +0000 (UTC) Received: from [217.146.183.211] by nm19.bullet.mail.ukl.yahoo.com with NNFMP; 19 Nov 2010 18:56:09 -0000 Received: from [217.146.183.35] by tm4.bullet.mail.ukl.yahoo.com with NNFMP; 19 Nov 2010 18:56:09 -0000 Received: from [127.0.0.1] by omp1024.mail.ukl.yahoo.com with NNFMP; 19 Nov 2010 18:56:09 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 953373.17262.bm@omp1024.mail.ukl.yahoo.com Received: (qmail 75294 invoked by uid 60001); 19 Nov 2010 18:56:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.no; s=s1024; t=1290192969; bh=tiFsNmvm7pTOP64PKfp10O+ufDJgJ8p9AdvQtO5xIWE=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=XmhZBRtgGuG8E+M/8W0WUc0T8udgZ0ABIckWW3XnVrtdy4k2pNYPcWm2KMC0jlO6TiOeLpoKzqLbmYwd7tHeFSD9/FyO44v1dYrGJkWfldqu7wfMqpJCOgxN8rZgCxgEt+aZpw+S5jq6Ztv3gOwKEgN9lGAs+MM9J8YVgkfH+FE= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.no; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=A/kck3/4MzlPMrLiJT5E93+g63EKHT6y/eoRt+UhIu/JNFe6stxnEAM37Nprok5KAqC0K+Vmcks0Sz+aC80lK9r+bPe9hc4lIYYCm3FbZnfbgoi+sNdHJ0TiqysO7aCp1aD53gkWrYT9bGIE1B4MQR6bv9JwaW8nx81V2/Hb4gE=; Message-ID: <837076.74458.qm@web28208.mail.ukl.yahoo.com> X-YMail-OSG: LPm6r.oVM1kGsJXr7pH7KOdYVCGrApWvtK8r8JSnRN90bxD .ghTKZ3PdF_Sw5DJ2TVfVAqXy50K5OEq2LR6c.6bPCjiiWy_b07v8MxDXMwg 4J50Xtrl4lQWK6ZYnQzd1ArV7Au9wOFP6cInU_bVBYDtYBEo3ZpT_bgdausR G79fZOpnEDqF6kH4QCqZYowD0pbwDw.TNXXdtHea2dUihSoqsJX28Fl.m8Fm 6hvebArzXLR9nEqaWAMqA6TnwHHiaPRq4msrt3rm9zICkW2CVjRpZlNLFSt4 gJZCJzvqa91vV6yWuFkuY6PZyfSE_NYYaTjgJzw-- Received: from [79.161.100.157] by web28208.mail.ukl.yahoo.com via HTTP; Fri, 19 Nov 2010 18:56:09 GMT X-Mailer: YahooMailClassic/11.4.9 YahooMailWebService/0.8.107.285259 Date: Fri, 19 Nov 2010 18:56:09 +0000 (GMT) From: Olav Gjerde To: freebsd-geom@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: How to unlock a md0 device with GELI during boot? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 19:08:33 -0000 I'm trying to unlock a geli encrypted file which contains multiple GELI key= s to unlock several hard drives. The reason for this is that I want to unlo= ck all the harddrives without typing the password for each harddrive for ea= ch reboot.=0A=0AI've created a small file with dd, used mdconfig to create = a md0 device, used geli init on the md0 device, attached it and finally I c= reated an ufs filesystem on the /dev/md0.eli device=0ASo far everything wor= ks fine.=0A=0AFor the boot process I added this line in /etc/rc.conf=0Amdco= nfig_md0=3D"-t vnode -f /boot/geli.img"=0AThis successfully created the md0= device.=0A=0AI've also added this below the mdconfig line in rc.conf=0Agel= i_devices=3D"md0"=0Ageli_md0_flags=3D"-k /boot/geli.key"=0A=0AIf I reboot I= get the following error message during the boot:=0ACreating md0 device (vn= ode)=0Afsck: Could not determine filesystem type.=0AFsck failed on /dev/md0= not mounting the filesystem.=0A=0ABut file works fine when I after the boo= t do this:=0Ageli attach -k /boot/geli.key md0=0A=0AIs it possible to geli = to unlock the md0 device during the boot process?=0AAre there any other alt= ernatives for my problem?=0A=0A-- Olav=0A=0A=0A From owner-freebsd-geom@FreeBSD.ORG Sat Nov 20 09:22:22 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BA2D106566B; Sat, 20 Nov 2010 09:22:22 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 42E848FC08; Sat, 20 Nov 2010 09:22:22 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oAK9MMOJ010197; Sat, 20 Nov 2010 09:22:22 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oAK9MMBI010193; Sat, 20 Nov 2010 09:22:22 GMT (envelope-from linimon) Date: Sat, 20 Nov 2010 09:22:22 GMT Message-Id: <201011200922.oAK9MMBI010193@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-geom@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: bin/152087: [geom] 8-STABLE gmultipath(8) error 'Unknown verb add' X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Nov 2010 09:22:22 -0000 Old Synopsis: 8-STABLE gmultipath error 'Unknown verb add' New Synopsis: [geom] 8-STABLE gmultipath(8) error 'Unknown verb add' Responsible-Changed-From-To: freebsd-bugs->freebsd-geom Responsible-Changed-By: linimon Responsible-Changed-When: Sat Nov 20 09:21:12 UTC 2010 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=152087 From owner-freebsd-geom@FreeBSD.ORG Sat Nov 20 17:23:11 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEA75106564A; Sat, 20 Nov 2010 17:23:11 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9666C8FC23; Sat, 20 Nov 2010 17:23:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oAKHNBuQ011692; Sat, 20 Nov 2010 17:23:11 GMT (envelope-from mjacob@freefall.freebsd.org) Received: (from mjacob@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oAKHNBsB011688; Sat, 20 Nov 2010 17:23:11 GMT (envelope-from mjacob) Date: Sat, 20 Nov 2010 17:23:11 GMT Message-Id: <201011201723.oAKHNBsB011688@freefall.freebsd.org> To: mjacob@FreeBSD.org, freebsd-geom@FreeBSD.org, mjacob@FreeBSD.org From: mjacob@FreeBSD.org Cc: Subject: Re: bin/152087: [geom] 8-STABLE gmultipath(8) error 'Unknown verb add' X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Nov 2010 17:23:11 -0000 Synopsis: [geom] 8-STABLE gmultipath(8) error 'Unknown verb add' Responsible-Changed-From-To: freebsd-geom->mjacob Responsible-Changed-By: mjacob Responsible-Changed-When: Sat Nov 20 17:22:51 UTC 2010 Responsible-Changed-Why: my resp http://www.freebsd.org/cgi/query-pr.cgi?pr=152087