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: Windowsserver2008R2 is deployed remotely, I don't know what network storage is like. I asked the customer for a Windowsserver2008iSCSI creation document.
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
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 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.
This article from the "This is my hometown" blog, please be sure to keep this source http://yangrong.blog.51cto.com/6945369/1350343