FreeNAS

From indicium
Revision as of 12:56, 11 January 2018 by Stefan (talk | contribs) (Created page with "== Properly init and add disks to your pool via command line == [https://forums.freenas.org/index.php?threads/building-pools-from-the-cli.17540/ https://forums.freenas.org/in...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Properly init and add disks to your pool via command line

https://forums.freenas.org/index.php?threads/building-pools-from-the-cli.17540/

Essentially:

1) Find out the dev nodes for your new disks

ls -l /dev/ada*
zpool status
glabel list

The ls command will show you all your disks dev-id:s. The zpool command will show you the gpt-id of all disks currently included in your pools. "glabel list" will give you the mapping between gpt-id and dev nodes. With this information you know which /dev/adaX devices that are your new/unused disks.

2) If any partitions currently exists on the disks, clear them out (ada0 and ada1 in my case, but may be different for you)

gpart destroy -F /dev/ada0
gpart destroy -F /dev/ada1

3) Init the disk as a GPT and create one swap partition and one zfs partition on each disk

gpart create -s gpt /dev/ada0
gpart add -a 4096 -i 1 -s 2g -t freebsd-swap /dev/ada0
gpart add -a 4096 -i 2 -t freebsd-zfs /dev/ada0
gpart create -s gpt /dev/ada1
gpart add -a 4096 -i 1 -s 2g -t freebsd-swap /dev/ada1
gpart add -a 4096 -i 2 -t freebsd-zfs /dev/ada1

4) Now run glabel and note down the new gpt-id:s for your disks

# glabel status
                                      Name  Status  Components
gptid/fcb8a69a-eb13-11e7-8eaf-6cf049956cad     N/A  ada2p1
gptid/a37b301e-eb46-11e7-b559-6cf049956cad     N/A  ada3p2
gptid/a35ca845-eb46-11e7-b559-6cf049956cad     N/A  ada3p1
gptid/8d0dbf30-f6ce-11e7-a931-6cf049956cad     N/A  ada0p1
gptid/96286393-f6ce-11e7-a931-6cf049956cad     N/A  ada0p2
gptid/b791e4cb-f6ce-11e7-a931-6cf049956cad     N/A  ada1p1
gptid/bbb96c09-f6ce-11e7-a931-6cf049956cad     N/A  ada1p2


zpool attach BigData gptid/[gptid_of_the_existing_disk] gptid/[gptid_of_the_new_partition]