Update Workflows/Linux/Expand iSCSI-Based ZFS Filesystem.md

This commit is contained in:
2025-01-14 18:28:34 -07:00
parent 107c574ea5
commit 76cb496923

View File

@ -7,23 +7,34 @@ The purpose of this workflow is to illustrate the process of expanding storage f
This document also assumes you did not enable Logical Volume Management (LVM) when deploying your server. If you did, you will need to perform additional LVM-specific steps after increasing the space. This document also assumes you did not enable Logical Volume Management (LVM) when deploying your server. If you did, you will need to perform additional LVM-specific steps after increasing the space.
## Increase iSCSI Disk Size ## Increase iSCSI Disk Size
This part should be fairly straight-forward. Using whatever hypervisor/storage appliance hosting the iSCSI target, expand the disk space of the LUN to the desired size. This part should be fairly straight-forward. Using whatever hypervisor / storage appliance hosting the iSCSI target, expand the disk space of the LUN to the desired size.
## Extend ZFS Pool ## Extend ZFS Pool
This step goes over how to increase the usable space of the ZFS pool within the server itself after it was expanded. This step goes over how to increase the usable space of the ZFS pool within the server itself after it was expanded.
``` sh ``` sh
iscsiadm -m session --rescan # (1) iscsiadm -m session --rescan # (1)
parted /dev/sdX # (2) lsblk # (2)
unit TB # (3) parted /dev/sdX # (3)
resizepart X XXTB # (4) unit TB # (4)
zpool online -e <POOL-NAME> /dev/sdX # (5) resizepart X XXTB # (5)
zpool scrub <POOL-NAME> # (6) zpool list # (6)
zpool online -e <POOL-NAME> /dev/sdX # (7)
zpool scrub <POOL-NAME> # (8)
``` ```
1. Re-scan iSCSI targets for changes. 1. Re-scan iSCSI targets for changes.
2. Open partitioning utility on the ZFS volume / LUN / iSCSI disk. Replace `dev/sdX` with the actual device name. 2. Leverage `lsblk` to ensure that the storage size increase from the hypervisor / storage appliance reflects correctly.
3. Self-explanatory storage measurement. 3. Open partitioning utility on the ZFS volume / LUN / iSCSI disk. Replace `dev/sdX` with the actual device name.
4. Resizes whatever partition is given to fit the new storage capacity. Replace `X` with the partition number. Replace `XXTB` with a valid value, such as `10TB`. 4. Self-explanatory storage measurement.
5. Brings the ZFS Pool back online. Replace `<POOL-NAME>` with the actual name of the ZFS pool. 5. Resizes whatever partition is given to fit the new storage capacity. Replace `X` with the partition number. Replace `XXTB` with a valid value, such as `10TB`.
6. This tells the system to scan the ZFS pool for any errors or corruption and correct them. Think of it as a form of housekeeping. 6. This will allow you to list all ZFS pools that are available for the next command.
7. Brings the ZFS Pool back online. Replace `<POOL-NAME>` with the actual name of the ZFS pool.
8. This tells the system to scan the ZFS pool for any errors or corruption and correct them. Think of it as a form of housekeeping.
## Check on Scrubbing Progress
At this point, the ZFS pool has been expanded and a scrub task has been started. The scrubbing task can take several hours / dayas to run, so to keep track of it, you can run the following command to check the status of the ZFS pool / scrubbing task.
```sh
zpool status
```