[FreeBSD-users-jp 95602] grub-install (gpart bug?)
丸山直昌
maruyama @ ism.ac.jp
2015年 9月 4日 (金) 01:14:18 UTC
統計数理研究所の丸山です。
https://bugs.pcbsd.org/issues/10904 で問題にしているPCBSD10.2のインストー
ラーのバグですが、一晩考えてみて、やっぱり真犯人は別のような気がしてきま
した。今私が疑っているのは、 grub-install です。そこで grub に詳しい方に
お尋ねします。状況は以下のようになっています。
1. PCBSDがインストールされる領域
% gpart show ada0
=> 63 1000215153 ada0 MBR (477G)
63 1985 - free - (993K)
2048 3069952 1 ntfs [active] (1.5G)
3072000 409600000 2 ntfs (195G)
412672000 550678528 - free - (263G)
963350528 36861952 3 ntfs (18G)
1000212480 2736 - free - (1.3M)
となっている状態のディスクにPCBSD10.2をインストールしようとします。
ada0s1, ada0s2, ada0s3 は Windows 7が占領しています。263Gの空き領域にイ
ンストールしようとすると、インストーラーはここを ada0s4 にして、
% gpart show ada0s4
=> 0 550678464 ada0s4 BSD (263G)
0 546549760 1 freebsd-zfs (261G)
546549760 4096000 2 freebsd-swap (2.0G)
550645760 32704 - free - (16M)
% ls -alg /dev/ada0s4*
crw-r----- 1 root operator 0x65 Aug 7 21:28 /dev/ada0s4
crw-r----- 1 root operator 0x5e Aug 7 21:28 /dev/ada0s4a
crw-r----- 1 root operator 0x6a Aug 7 21:28 /dev/ada0s4b
のような状態にします。
2. インストールの進行
インストーラーは /dev/ada0s4a に zfsファイルシステムを作り、/mnt にマウ
ントして pkg -c /mnt add xxxx.txz で必要なソフトをインストールしてゆきま
す。
3. grub の設定
pkg -c /mnt add が一段落すると、
chroot /mnt grub-install --force /dev/ada0
chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg
として grub の設定を行います。
4. インストール終了後
これで一見インストールは成功したように見えますが、 reboot してみると、
以下のよな状況で、到底正常とは思いえません。
ここで質問です。 3. のgrub の設定はこれで正しいのでしょうか。現象から見
ると、どこかの過程で ada0s4 の BSD label が破壊されているわけですが、そ
の犯人として、私が思い当たるのは gpart, glabel, grub-installの3つしかあ
りません。
なお、この一連の作業では lenovo x230 を使っていますが、機種には無関係な
問題だと思っています。また ada1 には PCI SSD disk を増設していますが、そ
れも関係があるとは思えません。
よろしく。
Thu, 03 Sep 2015 04:03:13 +0900
maruyama at ism.ac.jp (丸山直昌) writes:
>3. しかしインストール後に再起動すると、
>[maruyama at samanta{75}] ~% ls -alg /dev/ada0*
>crw-r----- 1 root operator 0x58 9月 1 19:46 /dev/ada0
>crw-r----- 1 root operator 0x5a 9月 1 19:46 /dev/ada0s1
>crw-r----- 1 root operator 0x5c 9月 1 19:46 /dev/ada0s2
>crw-r----- 1 root operator 0x5e 9月 1 19:46 /dev/ada0s3
>crw-r----- 1 root operator 0x60 9月 1 19:46 /dev/ada0s4
>
>となって ada0s4a, ada0s4b は消えてしまい、RC1, RC2ではインストールシステ
>ムは起動できません。10.2RELEASEでは、インストールを始める前に領域をすべ
>てゼロクリアするようにしたためか、 zfs は曲りなりにもマウントできますが、
>
>[root at samanta{118}] ~# zpool status
> pool: tank
> state: ONLINE
>status: Some supported features are not enabled on the pool. The pool
> can
> still be used, but some features are unavailable.
>action: Enable all features using 'zpool upgrade'. Once this is done,
> the pool may no longer be accessible by software that does not
> support
> the features. See zpool-features(7) for details.
> scan: none requested
>config:
>
> NAME STATE READ WRITE CKSUM
> tank ONLINE 0 0 0
> ada0s4 ONLINE 0 0 0
>
>errors: No known data errors
>
>というのはどうにも納得できません。 zfs は ada0s4a に作ったはずなのに。
>
>気になる点はインストール開始前に
>
>kern.geom.debugflags: 0 -> 16
>
>をやっている点です。kern.geom.debugflags=16 の時にだけ姿を表す特殊なバグ
>かも知れません。
>
>この件について、どなたか心当たりはありませんか?
>
>--------
>丸山直昌@統計数理研究所
freebsd-users-jp メーリングリストの案内