Update iSCSI doc
This commit is contained in:
parent
38365b1af0
commit
544152bdc6
@ -1,3 +1,11 @@
|
||||
# NOTE: Adding or removing drives
|
||||
> The drive letter of the iSCSI device will change (e.g. from `/dev/sde` to `/dev/sdb`) if drives are added or removed. This will cause the mount to fail.
|
||||
|
||||
To resolve:
|
||||
0. Make sure all Docker stacks relying on the iSCSI drive are shut down.
|
||||
1. Update the `fstab` entry. Edit the `/etc/fstab` file as root, and update the drive letter.
|
||||
2. Re-mount the drive. Run `sudo mount -a`.
|
||||
|
||||
# Creating the Zvol and iSCSI share in TrueNAS Scale
|
||||
|
||||
1. Navigate to the dataset to use. From the TrueNAS Scale dashboard, open the navigation side panel. Navigate to "Datasets". Select the pool to use (`Tank`).
|
||||
@ -16,16 +24,16 @@
|
||||
2. Get the list of available shares from the NAS with `sudo iscsiadm --mode discovery --type sendtargets --portal 192.168.1.10` where the IP for `--portal` is the IP of the NAS hosting the iSCSI share. In my case, this returns `192.168.1.10:3260,1 iqn.2020-03.net.jafner:fighter`.
|
||||
3. Open the iSCSI session. Run `sudo iscsiadm --mode node --targetname "iqn.2020-03.net.jafner:fighter" --portal "192.168.1.10:3260" --login`. Where the name for `--targetname` is the iqn string including the share name. And where the address for `--portal` has both the IP and port used by the NAS hosting the iSCSI share. Verify the session connected with `sudo iscsiadm --mode session --print=1`, which should return the description of any active sessions. [Debian.org](https://wiki.debian.org/SAN/iSCSI/open-iscsi).
|
||||
4. Format the newly-added block device.
|
||||
a. Identify the device name of the new device with `sudo iscsiadm -m session -P 3 | grep "Attached scsi disk"`. In my case, `sde`. [ServerFault](https://serverfault.com/questions/828401/how-can-i-determine-if-an-iscsi-device-is-a-mounted-linux-filesystem).
|
||||
b. Partition and format the device. Run `sudo parted --script /dev/sde "mklabel gpt" && sudo parted --script /dev/sde "mkpart primary 0% 100%" && sudo mkfs.ext4 /dev/sde1` [Server-world.info](https://www.server-world.info/en/note?os=Debian_11&p=iscsi&f=3).
|
||||
c. Mount the new partition to a directory. Run `sudo mkdir /mnt/iscsi && sudo mount /dev/sde1 /mnt/iscsi`. Where the path `/dev/sde1` is the newly-created partition and the path `/mnt/iscsi` is the path to which you want it mounted.
|
||||
a. Identify the device name of the new device with `sudo iscsiadm -m session -P 3 | grep "Attached scsi disk"`. In my case, `sdb`. [ServerFault](https://serverfault.com/questions/828401/how-can-i-determine-if-an-iscsi-device-is-a-mounted-linux-filesystem).
|
||||
b. Partition and format the device. Run `sudo parted --script /dev/sdb "mklabel gpt" && sudo parted --script /dev/sdb "mkpart primary 0% 100%" && sudo mkfs.ext4 /dev/sdb1` [Server-world.info](https://www.server-world.info/en/note?os=Debian_11&p=iscsi&f=3).
|
||||
c. Mount the new partition to a directory. Run `sudo mkdir /mnt/iscsi && sudo mount /dev/sdb1 /mnt/iscsi`. Where the path `/dev/sdb1` is the newly-created partition and the path `/mnt/iscsi` is the path to which you want it mounted.
|
||||
d. Test the disk write speed of the new partition. Run `sudo dd if=/dev/zero of=/mnt/iscsi/temp.tmp bs=1M count=32768` to run a 32GB test write. [Cloudzy.com](https://cloudzy.com/blog/test-disk-speed-in-linux/).
|
||||
|
||||
# Connecting and mounting the iSCSI share on boot
|
||||
|
||||
1. Get the full path of the share's configuration. It should be like `/etc/iscsi/nodes/<share iqn>/<share host address>/default`. In my case it was `/etc/iscsi/nodes/iqn.202-03.net.jafner:fighter/192.168.1.10,3260,1/default`. [Debian.org](https://wiki.debian.org/SAN/iSCSI/open-iscsi).
|
||||
2. Set the `node.startup` parameter to `automatic`. Run `sudo sed -i 's/node.startup = manual/node.startup = automatic/g' /etc/iscsi/nodes/iqn.2020-03.net.jafner:fighter/192.168.1.10,3260,1/default`.
|
||||
3. Add the new mount to `/etc/fstab`. Run `sudo bash -c "echo '/dev/sde1 /mnt/iscsi ext4 _netdev 0 0' >> /etc/fstab"`. [Adamsdesk.com](https://www.adamsdesk.com/posts/sudo-echo-permission-denied/), [StackExchange](https://unix.stackexchange.com/questions/195116/mount-iscsi-drive-at-boot-system-halts).
|
||||
3. Add the new mount to `/etc/fstab`. Run `sudo bash -c "echo '/dev/sdb1 /mnt/iscsi ext4 _netdev 0 0' >> /etc/fstab"`. [Adamsdesk.com](https://www.adamsdesk.com/posts/sudo-echo-permission-denied/), [StackExchange](https://unix.stackexchange.com/questions/195116/mount-iscsi-drive-at-boot-system-halts).
|
||||
|
||||
# How to Gracefully Terminate iSCSI Session
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user