unix:linux:iscsi_tricks_and_techniques
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| unix:linux:iscsi_tricks_and_techniques [2022/12/17 14:05] – [Adding new target on target device] rodolico | unix:linux:iscsi_tricks_and_techniques [2025/11/27 17:15] (current) – [Resizing your target] rodolico | ||
|---|---|---|---|
| Line 163: | Line 163: | ||
| Ok, you messed up and the target is too small. If you are using LVM2 partitions for your exports (good idea), simply take it offline on the initiators, then add space on the target. Now (and I'm not sure this is required), restart iscsi on the target. | Ok, you messed up and the target is too small. If you are using LVM2 partitions for your exports (good idea), simply take it offline on the initiators, then add space on the target. Now (and I'm not sure this is required), restart iscsi on the target. | ||
| - | When you modify | + | However, I generally use a FreeBSD |
| + | |||
| + | <WRAP center round alert 60%> | ||
| + | Warning: Do not allow anything | ||
| + | </ | ||
| + | |||
| + | |||
| + | === On FreeBSD target === | ||
| <code bash> | <code bash> | ||
| - | # log out, then back into target | + | # set the new size on the target |
| - | iscsiadm -m node --target='name of target' --portal " | + | zfs set quota=< |
| + | # let ctld know about the change. reload may work instead | ||
| + | service ctld restart | ||
| </ | </ | ||
| - | The size of the target | + | |
| + | === On initiator === | ||
| + | |||
| + | You now need to rescan the target from the initiators. | ||
| + | <code bash> | ||
| + | # probably not the best, since it rescans everything. | ||
| + | # see next code block. | ||
| + | iscsiadm -m session --rescan | ||
| + | </ | ||
| + | |||
| + | Better to only scan the one you actually changed. This assumes the target has the substring //thing1// in it. | ||
| + | |||
| + | <code bash> | ||
| + | # find the Session ID of the target | ||
| + | # NOTE: that you can just do iscsiadm -m session for the whole | ||
| + | # list and manually find the SID (number surrounded by square brackets) | ||
| + | iscsiadm -m session -P 0 | grep thing1 | cut -d' | ||
| + | # now, rescan only that SID (that one target) | ||
| + | iscsiadm --mode session --sid=15 --rescan | ||
| + | # use any tool you like to check the new size. I use fdisk -l, which will | ||
| + | # return the size on the first line | ||
| + | fdisk -l /dev/disk/by-path/ip-..... | ||
| + | </code> | ||
| + | |||
| + | At this point, | ||
| ==== Remove a target ==== | ==== Remove a target ==== | ||
unix/linux/iscsi_tricks_and_techniques.1671307540.txt.gz · Last modified: 2022/12/17 14:05 by rodolico
