FreeBSD 9.0-BETA でデバイスが見えない2011年10月02日 14時14分09秒

9.0-BETA2 を試しているが、FreeBSD 7.2 以来使っているディスクのパーティションが認識されなくなった。既に随分前の事なのでどうやってパーティションを作ったかは覚えていない。gpt で作ったような気がする。

% ls -sld /dev/da1*
0 crw-r-----  1 root  operator    0, 182 Oct  1 22:10 /dev/da1

取り合えず、gpt と gpart で試してみる。


# gpt show /dev/da1
       start        size  index  contents
           0           1         PMBR
           1           1         Pri GPT header
           2          32         Pri GPT table
          34   785149101      1  GPT part - FreeBSD legacy
   785149135   680000000      2  GPT part - FreeBSD ZFS
  1465149135          32         Sec GPT table
  1465149167           1         Sec GPT header
# gpart show /dev/da1
=>        63  1465149105  da1  MBR  (698G)
          63  1465149105       - free -  (698G)

この様に gpt はパーティションを表示してくれるが gpart は何も分らないようだ。そこで、man gpart をすると、options GEOM_PART_GPT というものがあるらしい。

% grep PART /usr/src/sys/i386/conf/*
DEFAULTS:options        GEOM_PART_BSD
DEFAULTS:options        GEOM_PART_EBR
DEFAULTS:options        GEOM_PART_EBR_COMPAT
DEFAULTS:options        GEOM_PART_MBR
MINI:options    GEOM_PART_GPT           # GUID Partition Tables.
XEN:options     GEOM_PART_GPT           # GUID Partition Tables.
debug:options   GEOM_PART_GPT           # GUID Partition Tables.

みると、GENERIC カーネルには含まれない様だ。GEOM_PART_GPT を追加して、カーネルを再構築したら見られるようになった。

% ls -sld /dev/da1*
0 crw-r-----  1 root  operator    0, 182 Oct  1 23:10 /dev/da1
0 crw-r-----  1 root  operator    0, 184 Oct  1 23:10 /dev/da1p2
0 crw-r-----  1 root  operator    0, 183 Oct  1 23:10 /dev/da1s1

ちょっと気になったことがあるのでもう一度調べてみる。


% ls -sld /sbin/gp*t
26 -r-xr-xr-x  17 root  wheel  24764 Oct  1 22:35 /sbin/gpart
36 -r-xr-xr-x   1 root  wheel  36388 Jan  4  2010 /sbin/gpt

gpt のバイナリは古い FreeBSD からの物だった。