安装 scst

安装 scst

wget https://ncu.dl.sourceforge.net/project/scst/scst-3.2.0.7058.tar.bz2
yum install bzip2 
bunzip2 scst-3.2.0.7058.tar.bz2 
tar xf scst-3.2.0.7058.tar 

编译安装scst

make 2perf 
make scst 
make scst_install 
make iscsi 
make iscsi_install 
make scstadm 
make scstadm_install

查看是否被加载到内核了

lsmod |grep scst modinfo scst 

启动 scst

modprobe scst 
modprobe scst_vdisk 
modprobe scst_disk 
modprobe scst_user 
modprobe scst_modisk 
modprobe scst_processor 
modprobe scst_raid 
modprobe scst_tape 
modprobe scst_cdrom 
modprobe scst_changer 
modprobe iscsi-scst 
iscsi-scstd

创建流程

创建 target

scstadmin -add_target iqn.1994-05.com.redhat:pv -driver iscsi

创建 block

scstadmin -open_dev pv -handler vdisk_blockio -attributes filename=/dev/zvol/tank/pv

创建 group 做访问控制

scstadmin -add_group pv -driver iscsi -target iqn.1994-05.com.redhat:pv

添加客户端

scstadmin -add_init iqn.1994-05.com.redhat:48d51365d2b -driver iscsi -target iqn.1994-05.com.redhat:pv -group pv

添加 lun

scstadmin -add_lun 0 -driver iscsi -target iqn.1994-05.com.redhat:pv -group pv -device pv

启用 target

scstadmin -enable_target iqn.1994-05.com.redhat:pv

使用 iscsi driver

scstadmin -set_drv_attr iscsi -attributes enabled=1 -noprompt

写入到配置文件

scstadmin -write_config /etc/scst.conf

删除流程

禁用 target

scstadmin -disable_target iqn.1994-05.com.redhat:pv -driver iscsi -noprompt

删除 target

scstadmin -rem_target iqn.1994-05.com.redhat:pv -driver iscsi -noprompt

删除 block

scstadmin -close_dev pv -handler vdisk_blockio -noprompt

xingyys
205 声望5 粉丝

阻碍人进步的并非无知,而是傲慢与偏见。