En este caso usaremos una cabina synology a la que denominaremos NAS01 y con IP 10.10.10.10:
Configuración inicial:
Discovery y login:
# iscsiadm -m discovery -t st -p 10.10.10.10 10.10.10.10:3260,1 iqn.2000-01.com.synology:NAS01.default-target.669579eed99 # iscsiadm -m node --login Logging in to [iface: default, target: iqn.2000-01.com.synology:NAS01.default-target.669579eed99, portal: 10.10.10.10,3260] Login to [iface: default, target: iqn.2000-01.com.synology:NAS01.default-target.669579eed99, portal: 10.10.10.10,3260] successful. # iscsiadm -m session -o show tcp: [2] 10.10.10.10:3260,1 iqn.2000-01.com.synology:NAS01.default-target.669579eed99 (non-flash)
#
Localizamos el disco:
# fdisk -l Disk /dev/sda: xxxxx GiB, xxxx bytes, xxx sectors Disk model: MODELO Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 370... Device Start End Sectors Size Type /dev/sda1 XXX XXX [...] Disk /dev/sdb: [...] [...] Disk /dev/sdc: 10 TiB, 10995116277760 bytes, 21474836480 sectors Disk model: Storage Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes #
Creamos el pool ZFS:
# zpool create -f NAS01LUNBCK01 /dev/sdc # zpool list NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT NAS01LUNBCK01 9.98T 106K 9.98T - - 0% 0% 1.00x ONLINE - #
Configurar el inicio
ISCSI
# iscsiadm --mode session tcp: [2] 10.10.10.10:3260,1 iqn.2000-01.com.synology:NAS01.default-target.669579eed99 (non-flash) # iscsiadm --mode node -T iqn.2000-01.com.synology:NAS01.default-target.669579eed99 -p 10.10.10.10 -o update -n node.startup -v automatic
# iscsiadm --mode node -T iqn.2000-01.com.synology:NAS01.default-target.669579eed99 -p 10.10.10.10 -o update -n node.conn[0].startup -v automatic
ir a /etc/iscsi/iscsid.conf y cambiar manual a automatic:
# To request that the iscsi initd scripts startup a session set to "automatic". node.startup = automatic # # To manually startup the session set to "manual". The default is manual. #node.startup = manual
ZFS
Localizar path
# systemctl list-units --all --full | grep disk | grep 10.10.10.10 | egrep -v "*part*" dev-disk-by\x2dpath-ip\x2d10.10.10.10:3260\x2discsi\x2diqn.2000\x2d01.com.synology:NAS01.default\x2dtarget.669579eed99\x2dlun\x2d1.device loaded active plugged Storage
crear en /etc/systemd/system la unit zpooliscsi.service y añadir al inicio:
# cat zpooliscsi.service [Unit] After=dev-disk-by\x2dpath-ip\x2d10.10.10.10:3260\x2discsi\x2diqn.2000\x2d01.com.synology:NAS01.default\x2dtarget.669579eed99\x2dlun\x2d1.device [Service] ExecStart=/usr/sbin/zpool import NAS01LUNBCK01 ExecStartPost=/usr/bin/logger "Inciaiado el Pool ZFS NAS01LUNBCK01" [Install] WantedBy=dev-disk-by\x2dpath-ip\x2d10.10.10.10:3260\x2discsi\x2diqn.2000\x2d01.com.synology:NAS01.default\x2dtarget.669579eed99\x2dlun\x2d1.device #systemctl daemon-reload # systemctl enable zpooliscsi Created symlink /etc/systemd/system/dev-disk-by\x2dpath-ip\x2d172.16.250.201:3260\x2discsi\x2diqn.2000\x2d01.com.synology:NAS01.default\x2dtarget.669579eed99\x2dlun\x2d1.device.wants/zpooliscsi.service → /etc/systemd/system/zpooliscsi.service. # systemctl restart zpooliscsi
Si queremos podemos probar a reiniciar y comprobar que todo funciona ;)
No hay comentarios:
Publicar un comentario