liunx系统下iscsi存储设备的挂载方法
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
CentOS配置邦诺存储iscsi卷指导手册
具体步骤如下:
1、查看并安装iscsi程序包;
#mkdir /mnt/cdrom (挂载CentOS系统光盘)
#mount -t auto /dev/cdrom /mnt/cdrom
#cd /mnt/cdrom
#cd .. /RPMS
#rpm -ivh iscsi-initator***.rpm
2、连接iscsi盘;
[root@serverKK ~]#
[root@serverKK ~]# iscsiadm -m discovery -t sendtargets -p 172.18.16.141:3260
//建立linux服务器与存储的iscsi连接, 粗体部分为存储的IP地址
iscsiadm: This command will remove the record [iface: default, target: iqn.2004-05.storos.t-141, portal: 172.18.16.141,3260], but a session is using it. Logout session then rerun command to remove record.
172.18.16.141:3260,1 iqn.2004-05.storos.t-141
172.18.16.141:3260,1 iqn.2004-05.storos.t-142 //正常建立的iscsi连接记录
[root@serverKK ~]# iscsiadm -m node //查看已经建立的iscsi连接
172.18.16.139:3260,1 iqn.2004-05.storos.t-9
172.18.16.139:3260,1 iqn.2004-05.storos.t-139
172.18.16.141:3260,1 iqn.2004-05.storos.t-141
172.18.16.141:3260,1 iqn.2004-05.storos.t-142
[root@serverKK ~]# iscsiadm -m node –T iqn.2004-05.storos.t-142 -p 172.18.16.141:3260 -l //激活已经建立的iscsi连接,如粗体部分和查看到iscsi连接记录相同。
Logging in to [iface: default, target: iqn.2004-05.storos.t-142, portal: 172.18.16.141,3260]
Login to [iface: default, target: iqn.2004-05.storos.t-142, portal: 172.18.16.141,3260]: successful
3、查看已经挂接的iscsi盘并作本地系统格式化;
[root@serverKK ~]# fdisk -l //查看linux系统的物理盘
Disk /dev/sda: 73.4 GB, 73407488000 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 8924 71577607+ 8e Linux LVM
Disk /dev/sdb: 73.4 GB, 73407488000 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 8924 71681998+ 8e Linux LVM
Note: sector size is 4096 (not 512)
Disk /dev/sdc: 5989.9 GB, 5989969428480 bytes
255 heads, 63 sectors/track, 91029 cylinders
Units = cylinders of 16065 * 4096 = 65802240 bytes
Disk /dev/sdc doesn't contain a valid partition table
Note: sector size is 4096 (not 512)
Disk /dev/sdd: 5996.5 GB, 5996512542720 bytes
255 heads, 63 sectors/track, 91129 cylinders
Units = cylinders of 16065 * 4096 = 65802240 bytes
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/sde: 5996.5 GB, 5996512542720 bytes
255 heads, 63 sectors/track, 729034 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sde doesn't contain a valid partition table
#mkfs.ext3 /dev/sde
#mkdir /mnt/iscsi
#mount /dev/sde /mnt/iscsi
4、自动挂载iscsi卷,(挂载多块iscsi盘,写多次就可以了)
#vi /etc/rc.local
在最后一行添加
iscsiadm -m node –T iqn.2004-05.storos.t-142 -p 172.18.16.141:3260 -l sleep 5 (休眠时间)
mount /dev/sde /mnt/iscsi
保存之后重启系统。