Expanding storage is done to increase the available capacity while maintaining redundancy and data protection. By adding new disks, the storage system can handle more data without compromising reliability.
Insert two identical disks into the empty bays of the storage server. Adding disks in pairs keeps redundancy intact and allows the storage to grow as a redundant array. Next, create a partition table on each new disk and check that the storage pool is healthy before proceeding with the expansion.
Before proceeding, verify the status of the current storage pool.
# zpool status
pool: NETSTOR
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
NETSTOR ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
NETSTOR1 ONLINE 0 0 0
NETSTOR2 ONLINE 0 0 0
errors: No known data errors
In the example above, the NETSTOR mirror pool contains two disks (mirror-0), and the next step is to identify the device names assigned to the new disks using the following command:
# ls -lah /dev/disk/by-id
total 0
drwxr-xr-x 2 root root 520 Srp 25 07:12 .
drwxr-xr-x 7 root root 140 Srp 25 07:03 ..
lrwxrwxrwx 1 root root 9 Srp 25 07:03 ata-INTEL_SSDSC2CW060A3_CVCV308402M3060AGN -> ../../sdc
lrwxrwxrwx 1 root root 10 Srp 25 07:03 ata-INTEL_SSDSC2CW060A3_CVCV308402M3060AGN-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Srp 25 07:03 ata-INTEL_SSDSC2CW060A3_CVCV308402M3060AGN-part2 -> ../../sdc2
lrwxrwxrwx 1 root root 10 Srp 25 07:03 ata-INTEL_SSDSC2CW060A3_CVCV308402M3060AGN-part9 -> ../../sdc9
lrwxrwxrwx 1 root root 9 Srp 25 07:12 ata-ST31000520AS_5VX0BZN0 -> ../../sde
lrwxrwxrwx 1 root root 9 Srp 25 07:03 ata-WDC_WD10JFCX-68N6GN0_WD-WX61A465TH1Y -> ../../sda
lrwxrwxrwx 1 root root 10 Srp 25 07:03 ata-WDC_WD10JFCX-68N6GN0_WD-WX61A465TH1Y-part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 Srp 25 07:03 ata-WDC_WD10JFCX-68N6GN0_WD-WX81EC512Y4H -> ../../sdb
lrwxrwxrwx 1 root root 10 Srp 25 07:03 ata-WDC_WD10JFCX-68N6GN0_WD-WX81EC512Y4H-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 9 Srp 25 07:12 ata-WDC_WD10JFCX-68N6GN0_WD-WXK1E6458WKX -> ../../sdd
lrwxrwxrwx 1 root root 9 Srp 25 07:03 wwn-0x10076999618641940481x -> ../../sdb
lrwxrwxrwx 1 root root 10 Srp 25 07:03 wwn-0x10076999618641940481x-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 9 Srp 25 07:03 wwn-0x11689569317835657217x -> ../../sda
lrwxrwxrwx 1 root root 10 Srp 25 07:03 wwn-0x11689569317835657217x-part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 Srp 25 07:12 wwn-0x11769037186453098497x -> ../../sdd
lrwxrwxrwx 1 root root 10 Srp 25 07:12 wwn-0x11769037186453098497x-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 9 Srp 25 07:03 wwn-0x12757853320186451405x -> ../../sdc
lrwxrwxrwx 1 root root 10 Srp 25 07:03 wwn-0x12757853320186451405x-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Srp 25 07:03 wwn-0x12757853320186451405x-part2 -> ../../sdc2
lrwxrwxrwx 1 root root 10 Srp 25 07:03 wwn-0x12757853320186451405x-part9 -> ../../sdc9
lrwxrwxrwx 1 root root 9 Srp 25 07:12 wwn-0x7847552951345238016x -> ../../sde
lrwxrwxrwx 1 root root 10 Srp 25 07:12 wwn-0x7847552951345238016x-part1 -> ../../sde1
Once the device names for the new disks are identified, create a partition table and prepare the drives for use. Use parted to set up the partition table on the new logical drives.
# parted /dev/sde --script -- mktable gpt
# parted /dev/sdd --script -- mktable gpt
Create a new label for the drives using the format NETSTORx, where NETSTOR is the storage pool name and x is the disk number. NETSTOR3 indicates disk 3 in the NETSTOR storage pool.
So, in our example (NETSTOR3):
Add a label to the new drives, applying the same naming convention to each drive.
# parted /dev/sde --script -- mkpart "NETSTOR3" 1 -1
# parted /dev/sdd --script -- mkpart "NETSTOR4" 1 -1
Next, expand the storage pool with the new logical drives. Be careful with this command and double-check the drive names to ensure the correct ones are used.
# zpool add NETSTOR mirror /dev/disk/by-partlabel/NETSTOR3 /dev/disk/by-partlabel/NETSTOR4 -f
The newly added logical volume should now appear in the zpool.
# zpool status
pool: NETSTOR
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
NETSTOR ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
NETSTOR1 ONLINE 0 0 0
NETSTOR2 ONLINE 0 0 0
mirror-1 ONLINE 0 0 0
NETSTOR3 ONLINE 0 0 0
NETSTOR4 ONLINE 0 0 0
errors: No known data errors
Finally, restart the swhspared daemon to update the GUI — this completes the storage expansion procedure.
~# /etc/init.d/swhspared restart