Mount iSCSI network storage in CentOS 6.4

Source: Internet
Author: User

Mount iSCSI configuration on CentOS 6.4

1. Install the iscsi support package and start the service.
Yuminstall binutils iscsi-initiator-utils kmod-xfs xfsprogs

Service iscsi start
2. log on to Network Storage
Iscsiadm-m discovery -- type sendtargets -- portal 192.168.1.100 (storage address)
Results: 192.168.1.100: 3260,1 iqn.1991-05.com. microsoft: data-win-01-ipc-target
Client Logon:
Iscsiadm-m node-T iqn.1991-05.com. microsoft: data-win-01-ipc-target-p192.168.1.100: 3260 -- login
Fdisk/dev/sd * check whether there is an additional disk. If there is more disk, the login is successful.

3. Partition and format
To use a disk, you must first partition and format it (create a file system for the purpose of formatting), and then mount it to a directory before it can be read and written.
Use fdisk for partitioning
Fdisk/dev/sdb
N # create a new partition
1 # create a primary Partition
Press Enter # select the start position, press enter is the default value, the first block
Enter # Press enter, which is the default value and the last block
W # exit and save

Format to ext4 File System:
Mkfs. ext4/dev/sdb1
4. Attach a disk
Create mount point mkdir/data
Mount/dev/sdb1/data # When the file system type and parameters are not specified, the system automatically uses the default value

Df-h view partition information
[Root @ localhost ~] # Df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/mapper/VolGroup-lv_root
50G 918 M 46G 2%/
Tmpfs 48G 0 48G 0%/dev/shm
/Dev/sda1 485 M 52 M 408 M 12%/boot
/Dev/mapper/VolGroup-lv_home
21G 172 M 20G 1%/home
/Dev/sdb1 985G 188 M 984G 1%/data

5. automatically register the scsi client upon startup
Modify the/etc/iscsi/iscsid. conf file:
# Node. startup = the one in front of the automatic line # Remove and change
Node. startup = automatic

Or:
Write the following two lines of commands to/etc/rc. local.
Service iscsi start
Iscsiadm-m node-T iqn.1991-05.com. microsoft: data-win-01-ipc-target-p192.168.1.100: 3260-login

6. automatic mounting upon startup
Modify/etc/fstab as follows:
[Root @ localhost ~] # Tail-1/etc/fstab
/Dev/sdb1/data ext4 defaults 0 0
Disk Partition Mount directory file system type parameter configuration whether to dump whether to enable self-check

Or write the following command into/etc/rc. local.
[Root @ localhost ~] # Tail-1/etc/rc. local
Mount/dev/sdb1/data

7. Summary
Considering the order in which services are started and network disks are attached, if an unknown problem occurs when the program cannot read the disk content, put all the commands in/etc/rc. loal and execute them in sequence.

Web Service shared storage cluster architecture based on RHCS + iSCSI + CLVM

Configure iSCSI storage and multi-path functions in Linux

Build an ip san-based iSCSI Storage System

ISCSI connection failure Solution

Install CentOS 6.0 and configure the iSCSI service in Citrix XenServer

CentOS 5.3 mounts storage cabinets with iSCSI

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.