Solved Gpart does not recognize newly added disks

Hi
I installed FreeBSD (in virtualbox) in ada0 with ZFS scheme. Now, I have added ada1, ada2 and ada3, so that I can experiment with ZFS pools and datasets. However, now after adding these drives (ada1, ada2 and ada3), when I issue command (gpart show adaX), it says "No such geom".
There is a work around to resolve this problem, i.e run "sade" and create partitions. After that, "gpart" starts to recognize ada1, ada2 and ada3. However, I believe that this work around (of using sade) may not be the proper way to make "gpart" recognize adaX. So, kindly tell me the proper way to make "gpart" recognize newly added disks.
Thanks
 
After you add a new disk check if it's recognized using
dmesg | less
or
camcontrol devlist

Then you need to create the desire partition scheme
To add a GPT scheme you can use (For ada1)
gpart add -s GPT ada1
Then the disk will be visible under
gpart show
After that you can add ZFS partition on the disk.

Please read the manual of gpart(8)

Note:
Also there's option to use the whole disk for ZFS pool instead of creating freebsd-zfs partitions. Make some research what are pros and cons for that.
 
from gpart(8)
Code:
show          Show current partition information for the specified geoms,
                   or all geoms if none are specified.  The default output
                   includes the logical starting block of each partition, the
                   partition size in blocks, the partition index number, the
                   partition type, and a human readable partition size.  Block
                   sizes and locations are based on the device's Sectorsize as
                   shown by gpart list.

If there is no partitioning information (i.e. no partition scheme/table created), gpart has nothing to show as there is no geom class.
To list all available ("physical") block devices (regardless of partitioning schemes) you need to leverage the CAM subsystem via camcontrol; e.g. camcontrol devlist as already mentioned.
 
Back
Top