目录
一、添加设备
- 列出设备,可以看到现在有两块硬盘
- 分区
二、安装共享策略管理软件
[root@westosa100 ~]# dnf install targetcli -y
[root@westosa100 ~]# systemctl enable --now target
Created symlink /etc/systemd/system/multi-user.target.wants/target.service → /usr/lib/systemd/system/target.service.
三、使用共享策略管理软件共享设备
[root@westosa100 ~]# targetcli
Warning: Could not load preferences file /root/.targetcli/prefs.bin.
targetcli shell version 2.1.51
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.
/> /backstores/block create westos_storagel1 /dev/vdb1
Created block storage object westos_storagel1 using /dev/vdb1.
/> /iscsi create iqn.2021-08.org.westos:stragel
Created target iqn.2021-08.org.westos:stragel.
Created TPG 1.
Global pref auto_add_default_portal=true
Created default portal listening on all IPs (0.0.0.0), port 3260.
/> /iscsi/iqn.2021-08.org.westos:stragel/tpg1/luns create /backstores/block/westos_storagel1
Created LUN 0.
/> /iscsi/iqn.2021-08.org.westos:stragel/tpg1/acls create iqn.2021-08.org.westos:westoskey
Created Node ACL for iqn.2021-08.org.westos:westoskey
Created mapped LUN 0.
/> exit
Global pref auto_save_on_exit=true
Configuration saved to /etc/target/saveconfig.json