Centos6.6 mounts iscsi storage and centos6.6 mounts iscsi

Source: Internet
Author: User

Centos6.6 mounts iscsi storage and centos6.6 mounts iscsi

To solve the company's backup and log problems, we have specially set up a backup server and prepared 8 TB storage space for use. Now we will mount iscsi storage on the client.

1. The client installs the iscsi installation package and starts

Yuminstall binutils iscsi-initiator-utils kmod-xfs xfsprogs

Service iscsi start

Kmod-xfs xfsprogs is the component of the xfs file system.

2. Configure initiatiorname

Add the target name to initiatorname. iscsi.

Vim/etc/iscsi/initiatorname. iscsi

InitiatorName = iqn.1994-05.com. redhat: 677b9f2936f8

3. target found

[root@usvr119 data]# iscsiadm -m discovery -t sendtargets -p 192.168.3.16192.168.3.16:3260,1 iqn.2001-05.com.equallogic:0-af1ff6-dce2985d0-95e004e6a155508d-bak-disk01
4. log on to the target

Iscsiadm-m node-T iqn.2001-05.com. equallogic: 0-af1ff6-dce2985d0-95e004e6a155508d-bak-disk01-p 192.168.3.16: 3260 -- login

5. Check whether the storage is mounted.

[root@usvr119 data]# fdisk -lDisk /dev/sdb: 8796.1 GB, 8796100362240 bytes255 heads, 63 sectors/track, 1069398 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytes

6. Partition with parted

Parted/dev/sdb

Mklabel gpt: Set the partition to gpt.

Mkpart primary 0% 100% divides the space into a partition

Print

Quit

Note: fdisk supports disks smaller than 2 TB. parted is required for disks larger than 2 TB.

7. format the partition

Mkfs. ext4-T largefile/dev/sdb1

Note:-T largefile is much faster to format large files.

View the uuid of a disk

Blkid/dev/sdb1

/Dev/sdb1: UUID = "27f0ec37-d7ab-4c93-b9e3-cd09ddd9e340" TYPE = "ext4"

8. Attach a hard disk

Mount-t ext4/dev/sdb1/data

9. automatic mounting upon startup

Log on to/etc/rc. local first.

Vim/etc/rc. lcoal

Iscsiadm-m node-T iqn.2001-05.com. equallogic: 0-af1ff6-dce2985d0-95e004e6a155508d-bak-disk01-p 192.168.3.16: 3260 -- login

Vim/etc/fstab

UUID = 27f0ec37-d7ab-4c93-b9e3-cd09ddd9e340/data ext4 defaults 0 0

Note: The first 0 is about dump, and the second 0 is about fsck. After the start, fsck/dev/sdb1 is displayed, in this case, the startup fails because no mounting is available.

10. iptables settings

If the firewall is enabled for our server, we need to release iscsi port 3260.

/Sbin/iptables-a input-I eth0-p tcp-s 192.168.3.16-m multiport -- dport 3260-m comment -- comment "iscsi target"-j ACCEPT



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.