[FreeBSD-users-jp 95600] gpart bug?

丸山直昌 maruyama @ ism.ac.jp
2015年 9月 2日 (水) 19:20:56 UTC


統計数理研究所の丸山です。

PCBSD10.2 のインストーラーで変なバグに出会って

https://bugs.pcbsd.org/issues/10904

にレポートしたのですが、どうにもバグが取れないで困惑しています。PCBSDのイ
ンストーラーの問題というよりも、領域確保に使っているgpart そのものに問題
があるような気がしています。PCBSD teamのKris Mooreも gpart を疑い始めた
ようです。状況は上記 bug report を読んで頂ければわかりますが、要約すると、

1. Windows 7マシン(つまりは MBRスキームのディスク)で Windowsの領域を縮小
して空きを作る

% 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)
のようにディスクの中程に空きができる。

2. PCBSD10.2(RC1、RC2 or RELEASE)を起動してこの空き領域を選択してインストールをする。
すると、
Running: gpart create -s BSD /dev/ada0s4
ada0s4 created
Running: sync
Running: gpart add -s 260871M -t freebsd-zfs /dev/ada0s4
ada0s4a added
Running: gpart add -s 8000M -t freebsd-swap /dev/ada0s4
ada0s4b added
NEWFS: /dev/ada0s4a - ZFS
Creating zpool tank on /dev/ada0s4a
Running: zpool create -d -o feature at async_destroy=enabled -o
feature at empty_bpobj=enabled -o feature at filesystem_limits=enabled -o
feature at lz4_compress=enabled -o feature at multi_vdev_crash_dump=enabled -o
feature at spacemap_histogram=enabled -o feature at extensible_dataset=enabled
-o feature at bookmarks=enabled -o feature at enabled_txg=enabled -m none -f
tank /dev/ada0s4a
Running: sync
Running: glabel label swap0 /dev/ada0s4b
Running: sync
zfs create  -p tank/ROOT
Running: zfs create  -p tank/ROOT
のように、空き領域に ada0s4を確保して、 ada0s4a を zfs ファイルシステム
とし、 ada0s4b を swap とするようにインストールが進行し、一見インストー
ルは無事終了するように見える。

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 メーリングリストの案内