Date: Wed, 20 Aug 2008 16:19:48 +0200 From: "Patrick M. Hausen" <hausen@punkt.de> To: freebsd-stable@freebsd.org Subject: boot0cfg and gmirror ... Message-ID: <20080820141948.GB15673@hugo10.ka.punkt.de>
next in thread | raw e-mail | index | archive | help
Hi, all, I know about the "foot shooting" prevention in geom(4) when trying to update the MBR of a mounted disk. I have a system with ad4 and ad6 mirrored and fdisk partitions residing on the mirror to be booted alterningly: hd30# gmirror status Name Status Components mirror/m0 COMPLETE ad4 ad6 hd30# mount /dev/mirror/m0s1a on / (ufs, local, read-only) devfs on /dev (devfs, local) /dev/mirror/m0s3a on /etc (ufs, local) /dev/mirror/m0s3d on /var (ufs, local, soft-updates) hd30# boot0cfg -v /dev/mirror/m0 # flag start chs type end chs offset size 1 0x80 1: 0: 1 0xa5 1022:254:63 16065 16418430 2 0x00 1023: 0: 1 0xa5 1020:254:63 16434495 16418430 3 0x00 1021: 0: 1 0xa5 704:254:63 32852925 455539140 version=1.0 drive=0x80 mask=0xf ticks=182 options=packet,update,nosetdrv default_selection=F1 (Slice 1) OK, try to switch to slice 2: hd30# boot0cfg -s 2 -v /dev/mirror/m0 boot0cfg: /dev/mirror/m0: Geom not found boot0cfg: /dev/mirror/m0: ioctl DIOCSMBR: Operation not permitted Known one, set debug flags and try again: hd30# sysctl kern.geom.debugflags=0x10 kern.geom.debugflags: 0 -> 16 hd30# boot0cfg -s 2 -v /dev/mirror/m0 boot0cfg: /dev/mirror/m0: Geom not found boot0cfg: /dev/mirror/m0: ioctl DIOCSMBR: Operation not permitted Er ... well, what now? Out of curiosity I tried: hd30# boot0cfg -s 2 -v /dev/ad4 # flag start chs type end chs offset size 1 0x80 1: 0: 1 0xa5 1022:254:63 16065 16418430 2 0x00 1023: 0: 1 0xa5 1020:254:63 16434495 16418430 3 0x00 1021: 0: 1 0xa5 704:254:63 32852925 455539140 version=1.0 drive=0x80 mask=0xf ticks=182 options=packet,update,nosetdrv default_selection=F2 (Slice 2) hd30# boot0cfg -v /dev/ad6 # flag start chs type end chs offset size 1 0x80 1: 0: 1 0xa5 1022:254:63 16065 16418430 2 0x00 1023: 0: 1 0xa5 1020:254:63 16434495 16418430 3 0x00 1021: 0: 1 0xa5 704:254:63 32852925 455539140 version=1.0 drive=0x80 mask=0xf ticks=182 options=packet,update,nosetdrv default_selection=F1 (Slice 1) hd30# boot0cfg -s 2 -v /dev/ad6 # flag start chs type end chs offset size 1 0x80 1: 0: 1 0xa5 1022:254:63 16065 16418430 2 0x00 1023: 0: 1 0xa5 1020:254:63 16434495 16418430 3 0x00 1021: 0: 1 0xa5 704:254:63 32852925 455539140 version=1.0 drive=0x80 mask=0xf ticks=182 options=packet,update,nosetdrv default_selection=F2 (Slice 2) So, with the prevention removed it is possible to write to the single disks, but not to the mirror as a whole. Weird. Any ideas? What bad things can happen if I keep updating the MBRs of both individual disks seperately - besides bad karma and "See? I told you so!" in case I generate an inconsistent state? Thanks, Patrick -- punkt.de GmbH * Kaiserallee 13a * 76133 Karlsruhe Tel. 0721 9109 0 * Fax 0721 9109 100 info@punkt.de http://www.punkt.de Gf: Jürgen Egeling AG Mannheim 108285
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080820141948.GB15673>