[Basic] iSCSI client mounting configuration under RHEL6

Source: Internet
Author: User
[Basic] mounting the iSCSI client under RHEL6 I. detection [root @ vhost3 ~] # Iscsiadm-mdiscovery-tsendtargets-pIP: port option and parameter:-mdiscovery: iscsiadmin command using detection method;-tsendtarge... [basic] mounting the iSCSI client under RHEL6 I. detection [root @ vhost3 ~] # Iscsiadm-m discovery-t sendtargets-p IP: port option and parameter:-m discovery: iscsiadmin command using the detection method;-t sendtargets: iscsi protocol, detects the target data of the following devices-p IP: port: The IP address and port of the iscsi device. If no port is written, the default value is 3260. [Root @ vhost3 ~] # Iscsiadm-m discovery-t sendtargets-p 192.168.46.15192.168.46.15: 3260,1 iqn.2004-01.com. storbridge: vdisk2-wt192.168.46.15: 3260,1 iqn.2004-01.com. storbridge: vdisk1-wt in this example, the iSCSI server address is 192.168.46.15, you can see that there are two iSCSI targets under this address. Iqn.2004-01.com. storbridge: the vdisk1-wt is the name of the target. [Root @ vhost3 ~] # Ll-R/var/lib/iscsi/nodes/: total 8drw -------. 3 root 4096 Jul 24 iqn.2004-01.com. storbridge: vdisk1-wtdrw -------. 3 root 4096 Jul 24 iqn.2004-01.com. storbridge: vdisk2-wt View/var/lib/iscsi/nodes/, is the target detected with iscsiadm. 2. connection (Mount) [root @ vhost3 ~] #/Etc/init. d/iscsi restartStopping iscsi: [OK] Starting iscsi: [OK] after detecting the iscsi service, you can connect to the target listed in/var/lib/iscsi/nodes. [Root @ vhost3 ~] # Iscsiadm-m node192.168.46.15: 3260,1 iqn.2004-01.com. storbridge: vdisk1-wt192.168.46.15: 3260,1 iqn.2004-01.com. storbridge: If the vdisk2-wt is not logged on, you need to log on to a target, note that you do not need to restart the iscsi service, just use the login command. [Root @ vhost3 ~] # Iscsiadm-m node-T iqn.2004-01.com. storbridge: vdisk2-wt -- loginLogging in to [iface: default, target: iqn.2004-01.com. storbridge: vdisk2-wt, portal: 192.168.46.15, 3260] (multiple) Login to [iface: default, target: iqn.2004-01.com. storbridge: vdisk2-wt, portal: 192.168.46.15, 3260] successful. the logout command is -- login to -- logout. You can use fdisk-l to view the attached disk. [Root @ vhost3 ~] # Fdisk-l 3. Update, delete, and add Target data [root @ vhost3 ~] # Iscsiadm-m node-T targetname -- logout [root @ vhost3 ~] # Iscsiadm-m node-o [delete | new | update]-T targetname options and parameters: -- logout: logout target, however, data in/var/lib/iscsi/nodes/is not deleted-o delete: delete the following target link information (/var/lib/iscsi/nodes/*)-o update: update related information-o new: add a new target information. [Root @ vhost3 ~] # Iscsiadm-m node check iscsi information IV. disk mounting. create PV [root @ vhost3 home] # [root @ vhost3 home] # pvcreate/dev/sdb <= fdisk-l] # pvscanb. create VG [root @ vhost3 home] # vgcreate iscsi/dev/sdb [root @ vhost3 home] # vgdisplay --- Volume group --- VG Name iscsiSystem IDFormat lvm2Metadata Areas 1 Metadata Sequence No 1VG Access read /writeVG Status resizableMAX LV 0Cur LV 0 Open LV 0Max PV 0Cur PV 1Act PV 1VG Size 500.00 GiBPE Size 4. 00 MiBTotal PE 127999 <= PE number is very important Alloc PE/Size 0/0 Free PE/Size 127999/500 .00 GiBVG UUID e7ZLFr-iVtV-g6Y2-BYEw-yeHv-NzX1-9VeJ2bc. create LV [root @ vhost3 home] # lvcreate-l 127999-n disk iscsi <= 127999 is the number of PES Logical volume "disk" createdd. format [root @ vhost3 home] # mkfs-t ext4/dev/iscsi/disk <= ext4 format e. start [root @ vhost3 home] # mkdir-p/data/iscsi [root @ vhost3 home] # vim/etc/fstab/dev/iscsi/disk/data/ Iscsi ext4 defaults, _ netdev 1 2/* plus _ netdev (bottom line at the top) indicates that, because this partition is on the network, therefore, it is necessary to mount the instance after the network is started. */[Root @ vhost3 home] # mount-a [root @ vhost3 home] # df-h
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.