<linux Storage Separation >

Source: Internet
Author: User

Service side:
First take out a piece of partition/dev/sda5

# Yum Search Target
# yum Install scsi-target-utils.x86_64-y//service-side packages
# vim/etc/tgt/targets.conf//Edit the configuration of the server side

<target redhat:1>//share out the name of this partition is Redhat:1
Backing-store/dev/sda5
</target>

/ETC/INIT.D/TGTD Restart//Restart service

Installation of the client:
# Yum Search iSCSI Find to iSCSI package and install

[Email protected] conf.d]# iscsiadm-m discovery-t st-p 192.168.3.60//First discover this partition on the server
Starting iscsid: [OK]
192.168.3.60:3260,1 redhat:1
[Email protected] conf.d]#

[[email protected] conf.d]# iscsiadm-m node-t redhat:1-P 192.168.3.60-l//use to enter this partition
Logging in to [Iface:default, Target:redhat:1, portal:192.168.3.60,3260] (multiple)
Login to [Iface:default, Target:redhat:1, portal:192.168.3.60,3260] successful.

disk/dev/sda:209 MB, 209715200 bytes
# FDISK-CU/DEV/SDA

[Email protected] conf.d]# partx-d/DEV/SDA
Error deleting partitions 2-256:blkpg:no such device or address
[Email protected] conf.d]# partx-a/DEV/SDA

# MKFS.EXT4/DEV/SDA1
[Email protected] conf.d]# mount/dev/sda1/mnt/
[[email protected] conf.d]# DF
Filesystem 1k-blocks used Available use% mounted on
/dev/mapper/volgroup-lv_root 6926264 1557096 5017324 24%/
Tmpfs 244988 0 244988 0%/dev/shm
/DEV/VDA1 495844 33487 436757 8%/boot
/DEV/SDA1 197338 5646 181504 4%/mnt
# umount/mnt/

# iscsiadm-m node-t redhat:1-P 192.168.3.60-u

# fdisk-l//SDA1 is no more
#/ETC/INIT.D/ISCSI Restart
# Fdisk-l//reboot and find it back again.
disk/dev/sda:209 MB, 209715200 bytes
# iscsiadm-m node-t redhat:1-P 192.168.3.60-u
# iscsiadm-m node-t redhat:1-P 192.168.3.60-o Delete

#/ETC/INIT.D/ISCSI Restart
# fdisk-l
No, it won't come back.

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.