Warner Losh
2016-Oct-21 18:25 UTC
boot0cfg on does not set default selection on gmirror device
On Fri, Oct 21, 2016 at 11:57 AM, Patrick M. Hausen <hausen at punkt.de> wrote:> Hi, all, > >> Am 21.10.2016 um 16:41 schrieb Warner Losh <imp at bsdimp.com>: >> Any chance you can migrate to using gpart? Is boot0cfg still >> referenced in NanoBSD somewhere? > > Not in NanoBSD but how would you configure boot0's default > slice with gpart? It doesn't pay attention to the "active" flag. > See Miroslav's mails for all the details. > > gpart would only be an option if we did not use the FreeBSD > boot manager.Ah! OK, I thought this was the active flag issue, not the default in boot0 issue.> But we need the "F1 ..., F2 ..." prompt, because > being able to roll back to the last known-good system via the > console is the entire point of using this NanoBSD setup. > There's a presentation on the EuroBSDCon 2010 page about > motivation and setup. Wonder who did that talk ... :-)))I think I sat in the talk :)> BTW: thanks, Miroslav. As for your question: it does work on > the only two systems that use hardware RAID, yet have a > gmirror built of only a single component to get consistent > device names accross all servers. > > I'm not quite sure if it works from time to time, I've come to > accept the "kern.geom.debugflags" dance. > > I had opened a similar discussion years ago for 7.x/8.x and > I was told that geom was to provide an API for fdisk, boot0cfg > and friends to manipulate the MBR. Because back in the days > boot0cfg and fdisk both threw an error message when trying > to work on a whole-disk mirror.It certainly looks like this code has that conversion in it. Looks like it's been there quite a while. I'd have expected it to "JUST WORK" [tm].> I thought that was long solved - at least no error, anymore. > But it's still not working in 10.x.Can you give us the strace output? It looks like it is reading the current blocks, setting the options, and then writing it back to the device. If the write back fails, it opens the device with geom and sends either the bootcode verb to geom (for the PART (aka gpart)) case or the data for the MBR case. strace should show that clearly. There's nothing in dmesg, right? Try this again but set geom.debug_flags to 128 instead of 16. This will give a verbose error in dmesg if there's any errors from the control message. Warner
Patrick M. Hausen
2016-Oct-21 18:47 UTC
boot0cfg on does not set default selection on gmirror device
Hi, Warner,> Am 21.10.2016 um 20:25 schrieb Warner Losh <imp at bsdimp.com>: > Can you give us the strace output?amd64 - no strace. I need a hand here, what precisely do I need to enter?> It looks like it is reading the current blocks, setting the options, > and then writing it back to the device. If the write back fails, it > opens the device with geom and sends either the bootcode verb to geom > (for the PART (aka gpart)) case or the data for the MBR case. strace > should show that clearly. There's nothing in dmesg, right? Try this > again but set geom.debug_flags to 128 instead of 16. This will give a > verbose error in dmesg if there's any errors from the control message.I set the flag, then tried to change the slice from 1 to 2. Result: Dump of gctl request at 0xfffffe02392bd9e0: param: "class" [R5] = "PART" param: "arg0" [R10] = "mirror/m0" param: "verb" [R9] = "bootcode" param: "bootcode" [R512] = fc 31 c0 8e c0 8e d8 8e d0 bc 00 7c 89 e6 bf 00 06 b9 00 01 f3 a5 89 fd b1 08 f3 ab fe 45 f2 e9 00 8a f6 46 bb 20 75 08 84 d2 78 07 80 4e bb 40 8a 56 ba 88 56 00 e8 fc 00 52 bb c2 07 31 d2 88 6f fc 0f a3 56 bb 73 19 8a 07 bf 87 07 b1 03 f2 ae 74 0e b1 0b f2 ae 83 c7 09 8a 0d 01 cf e8 c5 00 42 80 c3 10 73 d8 58 2c 7f 3a 06 75 04 72 05 48 74 0d 30 c0 04 b0 88 46 b8 bf b2 07 e8 a6 00 be 7b 07 e8 b2 00 8a 56 b9 4e e8 8e 00 eb 05 b0 07 e8 b0 00 30 e4 cd 1a 89 d7 03 7e bc b4 01 cd 16 75 0d 30 e4 cd 1a 39 fa 72 f2 8a 46 b9 eb 16 30 e4 cd 16 88 e0 3c 1c 74 f1 2c 3b 3c 04 76 06 2c c7 3c 04 77 c9 98 0f a3 46 0c 73 c2 88 46 b9 be 00 08 8a 14 89 f3 3c 04 9c 74 0a c0 e0 04 05 be 07 93 c6 07 80 53 f6 46 bb 40 75 08 bb 00 06 b4 03 e8 59 00 5e 9d 75 06 8a 56 b8 80 ea 30 bb 00 7c b4 02 e8 47 00 72 86 81 bf fe 01 55 aa 0f 85 7c ff be 85 07 e8 19 00 ff e3 b0 46 e8 24 00 b0 31 00 d0 eb 17 0f ab 56 0c be 78 07 e8 eb ff 89 fe e8 03 00 be 85 07 ac a8 80 75 05 e8 04 00 eb f6 24 7f 53 bb 07 00 b4 0e cd 10 5b c3 8a 74 01 8b 4c 02 b0 01 56 89 e7 f6 46 bb 80 74 13 66 6a 00 66 ff 74 08 06 53 6a 01 6a 10 89 e6 48 80 cc 40 cd 13 89 fc 5e c3 20 20 a0 0a 44 65 66 61 75 6c 74 3a a0 0d 8a 00 05 0f 01 06 07 0b 0c 0e 83 a5 a6 a9 0d 0c 0b 0a 09 08 0a 0e 11 10 01 3f bf 44 4f d3 4c 69 6e 75 f8 46 72 65 65 42 53 c4 66 bb 44 72 69 76 65 20 b1 01 80 8f b6 00 80 00 01 01 a5 fe ff fe c1 3e 00 00 7e 86 fa 00 00 00 c1 ff a5 fe ff fc 3f c5 fa 00 7e 86 fa 00 00 00 c1 fd a5 fe ff 00 bd 4b f5 01 04 0e 7b 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa param: "flags" [R2] = "C" root at hd45:~ # boot0cfg -v 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 768:254:63 32852925 1920667140 version=1.0 drive=0x80 mask=0xf ticks=182 bell= (0x7) options=packet,update,nosetdrv default_selection=F1 (Slice 1) So again, no change. Thanks, Patrick -- punkt.de GmbH * Kaiserallee 13a * 76133 Karlsruhe Tel. 0721 9109 0 * Fax 0721 9109 100 info at punkt.de http://www.punkt.de Gf: J?rgen Egeling AG Mannheim 108285