Настройка iSCSI на Ubuntu Server 14.04
Установка
Установка утилит
sudo apt-get install open-iscsi
Настройка
Для автоматического подключения дисков
/etc/iscsi/iscsid.conf
# To request that the iscsi initd scripts startup a session set to "automatic". node.startup = automatic
Смотрим свой Initiatorname
cat /etc/iscsi/initiatorname.iscsi
Настраиваем SAN, выдаем права. Найти доступные target'ы
sudo iscsiadm -m discovery -t st -p 192.168.0.10
Подключаем доступные ресурсы
$ sudo iscsiadm -m node --login Logging in to [iface: default, target: iqn.2003-10.com.lefthandnetworks:mg-01:28:lun-04, portal: 172.21.20.7,3260] (multiple) Login to [iface: default, target: iqn.2003-10.com.lefthandnetworks:mg-01:28:lun-04, portal: 172.21.20.7,3260] successful.
Проверяем
$ sudo dmesg | grep sd [36936271.698221] sd 3:0:0:0: Attached scsi generic sg3 type 0 [36936271.698950] sd 3:0:0:0: [sdc] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB) [36936271.700933] sd 3:0:0:0: [sdc] Write Protect is off [36936271.700941] sd 3:0:0:0: [sdc] Mode Sense: 77 00 00 08 [36936271.702171] sd 3:0:0:0: [sdc] Write cache: disabled, read cache: disabled, doesn't support DPO or FUA [36936271.710082] sdc: unknown partition table [36936271.715680] sd 3:0:0:0: [sdc] Attached SCSI disk
Разбиваем диск
$ sudo parted /dev/sdc (parted) mklabel gpt (parted) mkpart primary 0% 100% (parted) print Model: LEFTHAND iSCSIDisk (scsi) Disk /dev/sdc: 1.07TB Sector size (logical/physical): 512B/512B Partition Table: gpt (parted) quit Information: You may need to update /etc/fstab.
Форматируем
sudo mkfs.ext4 /dev/sdc1
Добавляем в fstab
$ sudo blkid /dev/sdc1: UUID="416dfa42-26a9-4bd8-a6f3-f5af789cf9a0" TYPE="ext4"
/etc/fstab
... UUID="416dfa42-26a9-4bd8-a6f3-f5af789cf9a0" /mnt/data ext4 defaults,auto,_netdev 0 0
Монтируем
sudo mount /mnt/data
http://help.ubuntu.ru/wiki/%D1%80%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE_%D0%BF%D0%BE_ubuntu_server/%D1%84%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2%D1%8B%D0%B5_%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80%D0%B0/iscsi
https://www.ibm.com/support/knowledgecenter/en/SS42VS_7.3.0/com.ibm.qradar.doc/t_offboard_iscsi_configure_volume.html
https://habrahabr.ru/post/97529/
Обсуждение