Mount ISCSI in debian 10 64bit

Mount ISCSI in debian 10 64bit

support: https://www.howtoforge.com/using-iscsi-on-debian-squeeze-initiator-and-target

First update system and install open-iscsi

apt update
apt upgrade -y
apt install open-iscsi -y

create connection

iscsiadm -m discovery --type sendtargets -p 10.1.2.11
root@server1:~# iscsiadm -m node
10.1.2.11:3260,1 iqn.2005-10.org.freenas.ctl:disk1
##### save login to /etc/iscsi/nodes/iqn.2005-10.org.freenas.ctl:disk1/10.1.2.11,3260,1/default
iscsiadm -m node --targetname "iqn.2005-10.org.freenas.ctl:disk1" --portal "10.1.2.11:3260" --op=update --name node.session.auth.authmethod --value=CHAP
iscsiadm -m node --targetname "iqn.2005-10.org.freenas.ctl:disk1" --portal "10.1.2.11:3260" --op=update --name node.session.auth.username --value=someuser
iscsiadm -m node --targetname "iqn.2005-10.org.freenas.ctl:disk1" --portal "10.1.2.11:3260" --op=update --name node.session.auth.password --value=secret

Connect to iscsi target

iscsiadm -m node --targetname "iqn.2005-10.org.freenas.ctl:disk1" --portal "10.1.2.11:3260" --login
root@Docker1:/home/docker# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 38G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 2G 0 part [SWAP]
sdb 8:16 0 64G 0 disk ########### iscsi disk, needs to format and mount
sr0 11:0 1 335M 0 rom
fdisk /dev/sdb ## create partition
mkfs.ext4 /dev/sdb1 ## create ext4 file system
mkdir /mnt/iscsi ## create mountpoint
mount /dev/sdb1 /mnt/iscsi ## mount partirion
root@Docker1:/home/docker# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 38G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 2G 0 part [SWAP]
sdb 8:16 0 64G 0 disk
└─sdb1 8:17 0 64G 0 part /mnt/iscsi ## mounted partiotion iscsi
sr0 11:0 1 335M 0 rom

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *