Centos6.4 Mount iscsi Network Storage

Source: Internet
Author: User

Yesterday, a linux system was deployed for a customer. The server itself had only GB disks as the system disk. All data is stored in network storage, and network storage (iSCSI) needs to be mounted to the local device. The configuration process is summarized as follows:


Create iSCSI on Windows server 2008 R2

Due to remote deployment, I don't know what network storage is like. I asked the customer for a Windows server 2008 iSCSI Creation Document, these figures are extracted from the iSCSI usage document that the customer gave me. Learn how the storage server is managed.

Web: http://blog.sina.com.cn/s/blog_43f638db0101bill.html


650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/091144K19-0.jpg "title =" w%01%c'y684fh@fk6%lc90%jpg "style =" float: none; "alt =" wKioL1LPddPDkaJrAAGo-lCmK2U620.jpg "/>

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/091144N55-1.jpg "title =" NX ~ Ao2jggrln7yljzn1y20171s.jpg "style =" float: none; "alt =" wKiom1LPdeCQhDUEAAEIHryJ5Eg246.jpg "/>

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0911443P4-2.jpg "style =" float: none; "title =" 8z@20.93k6flept.pdf (dv1z5the.jpg "alt =" ↓ "/>

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/140114/0911445928-3.jpg "style =" float: none; "title =" mkgw.'uvr_w4tp@iq1_6m8u.jpg "alt =" ↓ "/>



Click "Check IQN" and "LUN.

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 the disk and then format and format the object to create a file system), and then mount it to the directory to 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.




This article from the "this is my hometown" blog, please be sure to keep this source http://yangrong.blog.51cto.com/6945369/1350343

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.