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
Ian Smith
2016-Oct-22 03:36 UTC
boot0cfg on does not set default selection on gmirror device
On Fri, 21 Oct 2016 20:47:20 +0200, Patrick M. Hausen wrote: Again, trouble quoting your message properly, so quotes by hand .. > I set the flag, then tried to change the slice from 1 to 2. > Result: [..] > 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. In my previous message I said that the boot selection would be stored in 0x1b5. That was ASSuming we'd be looking at a version=2.0 boot0, which from the above is not the case. For version=1.0 that byte is at 0x1b9. Discombobulating the dump: 0x1b0: 66 bb 44 72 69 76 65 20 b1 01 80 8f b6 00 80 00 v2 v1 ^active 0x1c0: 01 01 a5 fe ff fe c1 3e 00 00 7e 86 fa 00 00 00 0x1d0: c1 ff a5 fe ff fc 3f c5 fa 00 7e 86 fa 00 00 00 0x1e0: c1 fd a5 fe ff 00 bd 4b f5 01 04 0e 7b 72 00 00 0x1f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa So 0x1b9 = 1, +1 = 2 (for F2). It appears correct in the dump but not in what boot0cfg then reports. I wonder two things: Do 'boot0cfg -v ada0' and 'boot0cfg -v ada1' both report the same? Might it work properly if you upgraded the boot sectors to version 2, which is what you should get if you reinstall from current boot0cfg, presumably without touching the MBR data, but you'll have backups .. Only noticing because I made a memstick with boot0 the other day from FreeBSD 9.3 and it showed version=2.0 with a (dummy) volume serial ID, the same time as finding that setting active with gpart had no effect. cheers, ian