Re: Use of boot0cfg to set boot slice broke between r209459 and r209502

From: Daniel Braniss <danny_at_cs.huji.ac.il>
Date: Sat, 26 Jun 2010 15:24:10 +0300
> 
> --qZLFzaLf2KECwqmh
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
> 
> On Sat, Jun 26, 2010 at 12:10:57PM +0300, Daniel Braniss wrote:
> > ...
> > what do you see when you type boot0cfg -v ...?
> > gpart show?
> > then try=20
> > 	gpart set -a active -i n aacd0
> > n will probably be 5.
> >=20
> > bottom line, the MBR is NOT being updated by boot0cfg
> 
> OK; here's what I see -- note that the /S1/usr/sbin/boot0cfg executable
> is the one I built yesterday without the 2 lines from r209469:
> 
> freebeast(9.0-C)[2] uname -a
> FreeBSD freebeast.catwhisker.org 9.0-CURRENT FreeBSD 9.0-CURRENT #200 r2095=
> 22: Fri Jun 25 06:11:00 PDT 2010     root_at_freebeast.catwhisker.org:/usr/obj=
> /usr/src/sys/GENERIC  i386
> freebeast(9.0-C)[3] sudo boot0cfg -v aacd0; echo $?
> Password:
> #   flag     start chs   type       end chs       offset         size
> 1   0x00      0:  1: 1   0xa5    651:254:63           63     10474317
> 2   0x00    652:  0: 1   0xa5   1023:254:63     10474380     10474380
> 3   0x00   1023:255:63   0xa5   1023:254:63     20948760     10474380
> 4   0x80   1023:255:63   0xa5   1023:254:63     31423140     40194630
> 
> version=3D1.0  drive=3D0x80  mask=3D0xf  ticks=3D182  bell=3D  (0x7)
> options=3Dpacket,update,nosetdrv
> default_selection=3DF4 (Slice 4)
> 0
> freebeast(9.0-C)[4] sudo boot0cfg -v -s 2 aacd0 ; echo $?
> boot0cfg: write_mbr: /dev/aacd0: Operation not permitted
> 1
> freebeast(9.0-C)[5] sudo boot0cfg -v aacd0 ; echo $?
> #   flag     start chs   type       end chs       offset         size
> 1   0x00      0:  1: 1   0xa5    651:254:63           63     10474317
> 2   0x00    652:  0: 1   0xa5   1023:254:63     10474380     10474380
> 3   0x00   1023:255:63   0xa5   1023:254:63     20948760     10474380
> 4   0x80   1023:255:63   0xa5   1023:254:63     31423140     40194630
> 
> version=3D1.0  drive=3D0x80  mask=3D0xf  ticks=3D182  bell=3D  (0x7)
> options=3Dpacket,update,nosetdrv
> default_selection=3DF4 (Slice 4)
> 0
> freebeast(9.0-C)[6] sudo /S1/usr/sbin/boot0cfg -v -s 2 aacd0 ; echo $?
> #   flag     start chs   type       end chs       offset         size
> 1   0x00      0:  1: 1   0xa5    651:254:63           63     10474317
> 2   0x00    652:  0: 1   0xa5   1023:254:63     10474380     10474380
> 3   0x00   1023:255:63   0xa5   1023:254:63     20948760     10474380
> 4   0x80   1023:255:63   0xa5   1023:254:63     31423140     40194630
> 
> version=3D1.0  drive=3D0x80  mask=3D0xf  ticks=3D182  bell=3D  (0x7)
> options=3Dpacket,update,nosetdrv
> default_selection=3DF2 (Slice 2)
> 0
> freebeast(9.0-C)[7] sudo boot0cfg -v aacd0 ; echo $?
> #   flag     start chs   type       end chs       offset         size
> 1   0x00      0:  1: 1   0xa5    651:254:63           63     10474317
> 2   0x00    652:  0: 1   0xa5   1023:254:63     10474380     10474380
> 3   0x00   1023:255:63   0xa5   1023:254:63     20948760     10474380
> 4   0x80   1023:255:63   0xa5   1023:254:63     31423140     40194630
> 
> version=3D1.0  drive=3D0x80  mask=3D0xf  ticks=3D182  bell=3D  (0x7)
> options=3Dpacket,update,nosetdrv
> default_selection=3DF2 (Slice 2)
> 0
> freebeast(9.0-C)[8] sudo gpart show
> =3D>      63  71619471  aacd0  MBR  (34G)
>         63  10474317      1  freebsd  (5.0G)
>   10474380  10474380      2  freebsd  (5.0G)
>   20948760  10474380      3  freebsd  (5.0G)
>   31423140  40194630      4  freebsd  [active]  (19G)
>   71617770      1764         - free -  (882K)
> 
> =3D>       63  143306919  aacd1  MBR  (68G)
>          63  143299737      1  freebsd  [active]  (68G)
>   143299800       7182         - free -  (3.5M)
> 
> =3D>       0  10474317  aacd0s1  BSD  (5.0G)
>          0   3072000        1  freebsd-ufs  (1.5G)
>    3072000   7402317        4  freebsd-ufs  (3.5G)
> 
> =3D>       0  10474380  aacd0s2  BSD  (5.0G)
>          0   3072000        1  freebsd-ufs  (1.5G)
>    3072000   7402380        4  freebsd-ufs  (3.5G)
> 
> =3D>       0  10474380  aacd0s3  BSD  (5.0G)
>          0   3072000        1  freebsd-ufs  (1.5G)
>    3072000   7402380        4  freebsd-ufs  (3.5G)
> 
> =3D>       0  40194630  aacd0s4  BSD  (19G)
>          0   3072000        1  freebsd-ufs  (1.5G)
>    3072000  20971520        2  freebsd-swap  (10G)
>   24043520   7401472        4  freebsd-ufs  (3.5G)
>   31444992   8749638        6  freebsd-ufs  (4.2G)
> 
> =3D>        0  143299737  aacd1s1  BSD  (68G)
>           0   20971520        2  freebsd-swap  (10G)
>    20971520   67108864        4  freebsd-ufs  (32G)
>    88080384   55219353        5  freebsd-ufs  (26G)
> 
> freebeast(9.0-C)[9]=20

if you look closely, changing the slice via boot0cfg does NOT change
the active flag (0x80), so this is what I do - till the bug gets fixed:
boot0cfg -s 3 ad0
gpart set -a active -i 3 ad0

btw, if you type on the console the selection at boot's prompt, the MBR gets
updated.
	danny
Received on Sat Jun 26 2010 - 10:24:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:05 UTC