EDIT: This is on a Debian 7 sytstem (more accurately Proxmox hypervisor https://www.proxmox.com/en/) 2.6.32-48-pve kernel.
I have a disk partition as an iscsi target on my backend infiniband storage. I've mounted the target locally on the initiator (on /mnt/iscsi
). If I need to reboot the initiator, I need to unmount /mnt/iscsi
and then logout of the portal prior to rebooting (at least it was this way a couple years ago. been a while since I've worked with iscsi).
How can I determine which filesystems are mounted over iscsi? The regular mount
command just displays the block device which was created by the initiator eg: /dev/sdc
.
/dev/sdc on /mnt/iscsi type ext4 (rw,relatime,barrier=1,data=ordered)
I'd like to automate the unmount/logout prior to a reboot but this information is not enough to determine if the filesystem in question needs to be run through iscsiadm ... --logout
after unmounting.
Try
iscsiadm -m session -P 3
and check the last section "Attached SCSI devices"Just FYI: If you set
iscsid
to start on boot you do not need to unmount/logout iSCSI partitions prior to reboot. As long as the partition is in /etc/fstab and has a_netdev
option.Try this command:
The iscsiadm utility is a command-line tool allowing discovery and login to iSCSI targets, as well as access and management of the open-iscsi database.
-m, --mode op
specifies the mode.op
must be one ofdiscoverydb
,node
,fw
,host iface
orsession
. This command will list the sessions targets (and grep within the result).