Article : purestoreage_iscsi_linux_multipathing_lvm_xfs

[root@centos7-02 ~]# yum -y install iscsi-initiator-utils device-mapper-multipath [root@centos7-02 ~]# cat /etc/iscsi/initiatorname.iscsi # change to the same IQN you set on the iSCSI target server InitiatorName=InitiatorName=iqn.1994-05.com.redhat:bec5d9b68510 [root@centos7-02 ~]# iscsiadm -m discovery -t sendtargets -p 10.2.4.53 [ 635.510656] iscsi: registered transport (tcp) 10.2.4.53:3260,1 iqn.1994-05.com.redhat:bec5d9b68510 # confirm status after discovery [root@centos7-02 ~]# iscsiadm -m node -o show # BEGIN RECORD 6.2.0.873-21 node.name = iqn.1994-05.com.redhat:bec5d9b68510 node.tpgt = 1 node.startup = automatic node.leading_login = No ... ... ... node.conn[0].iscsi.IFMarker = No node.conn[0].iscsi.OFMarker = No # END RECORD # login to the target [root@centos7-02 ~]# iscsiadm -m node --login Logging in to [iface: default, target: iqn.1994-05.com.redhat:bec5d9b68510, portal: 10.2.4.53,3260] (multiple) [ 708.383308] scsi2 : iSCSI Initiator over TCP/IP [ 709.393277] scsi 2:0:0:0: Direct-Access LIO-ORG disk01 4.0 PQ: 0 ANSI: 5 [ 709.395709] scsi 2:0:0:0: alua: supports implicit and explicit TPGS [ 709.398155] scsi 2:0:0:0: alua: port group 00 rel port 01 [ 709.399762] scsi 2:0:0:0: alua: port group 00 state A non-preferred supports TOlUSNA [ 709.401763] scsi 2:0:0:0: alua: Attached [ 709.402910] scsi 2:0:0:0: Attached scsi generic sg0 type 0 Login to [iface: default, target: iqn.1994-05.com.redhat:bec5d9b68510, portal: 10.2.4.53,3260] successful. # confirm the established session [root@centos7-02 ~]# iscsiadm -m session -o show tcp: [1] 10.0.0.30:3260,1 iqn.1994-05.com.redhat:bec5d9b68510 (non-flash) # confirm the partitions [root@centos7-02 ~]# cat /proc/partitions major minor #blocks name 2 0 4 fd0 8 0 20971520 sda 8 1 512000 sda1 8 2 20458496 sda2 11 0 1048575 sr0 253 0 18317312 dm-0 253 1 2097152 dm-1 8 16 10485760 sdb 8 32 10485760 sdc [root@centos7-02 ~]# [root@centos7-02 ~]# cat /etc/multipath.conf defaults { user_friendly_names yes } blacklist { devnode “sda” } [root@centos7-02 ~]# systemctl start multipathd [root@centos7-02 ~]# systemctl enable multipathd [root@centos7-02 ~]# multipath -ll 3624a9370dc1bc7e034cf4aeb00011010 dm-2 PURE ,FlashArray size=10G features='0' hwhandler='0' wp=rw `-+- policy='queue-length 0' prio=1 status=active |- 3:0:0:10 sdb 8:16 active ready running `- 4:0:0:10 sdc 8:32 active ready running [root@centos7-02 ~]# [root@centos7-02 ~]# fdisk /dev/mapper/3624a9370dc1bc7e034cf4aeb00011010 Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0x21eea4b6. Command (m for help): p Disk /dev/mapper/3624a9370dc1bc7e034cf4aeb00011010: 10.7 GB, 10737418240 bytes, 20971520 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 4194304 bytes Disk label type: dos Disk identifier: 0x21eea4b6 Device Boot Start End Blocks Id System Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): First sector (8192-20971519, default 8192): Using default value 8192 Last sector, +sectors or +size{K,M,G} (8192-20971519, default 20971519): Using default value 20971519 Partition 1 of type Linux and of size 10 GiB is set Command (m for help): t Selected partition 1 Hex code (type L to list all codes): L 0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris 1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT- 2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT- 3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: c6 DRDOS/sec (FAT- 4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx 5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data 6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / . 7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility 8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt 9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi eb BeOS fs e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/ 10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b 11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor 12 Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor 14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f2 DOS secondary 16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS 17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE 18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto 1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep 1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT 1e Hidden W95 FAT1 80 Old Minix Hex code (type L to list all codes): 8e Changed type of partition 'Linux' to 'Linux LVM' Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 22: Invalid argument. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. [root@centos7-02 ~]# [root@centos7-02 ~]# pvcreate /dev/mapper/3624a9370dc1bc7e034cf4aeb00011010 Physical volume "/dev/mapper/3624a9370dc1bc7e034cf4aeb00011010" successfully created. [root@centos7-02 ~]# [root@centos7-02 ~]# vgcreate vg_data /dev/mapper/3624a9370dc1bc7e034cf4aeb00011010 Volume group "vg_data" successfully created [root@centos7-02 ~]# lvcreate -n lvol_data_01 -L 2g vg_data Logical volume "lvol_data_01" created. [root@centos7-02 ~]# mkfs.xfs /dev/vg_data/lvol_data_01 meta-data=/dev/vg_data/lvol_data_01 isize=512 agcount=4, agsize=131072 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0, sparse=0 data = bsize=4096 blocks=524288, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 [root@centos7-02 ~]# [root@centos7-02 ~]# cat /etc/fstab ... /dev/vg_data/lvol_data_01 /data_01 xfs defaults 0 0 ... [root@centos7-02 ~]# [root@centos7-02 ~]# mount -a [root@centos7-02 ~]# df -kh Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos_centos7--02-root 18G 1.5G 17G 9% / devtmpfs 910M 0 910M 0% /dev tmpfs 920M 0 920M 0% /dev/shm tmpfs 920M 17M 904M 2% /run tmpfs 920M 0 920M 0% /sys/fs/cgroup /dev/sda1 497M 215M 282M 44% /boot 10.2.231.120:/ 1.5G 1.3G 163M 89% /data tmpfs 184M 0 184M 0% /run/user/0 /dev/mapper/vg_data-lvol_data_01 2.0G 33M 2.0G 2% /data_01 [root@centos7-02 ~]#