0% found this document useful (0 votes)
3K views

How To Configure ISCSI Initiator On Ubuntu 22.04

This document provides instructions for configuring iSCSI on an Ubuntu system. It describes how to install the open-iscsi package, configure the initiator name and settings, discover iSCSI targets, login to targets, and rescan sessions. It also explains how to create logical volumes (LVs) and file systems on the shared storage, including extending an existing LV. The steps covered include installing packages, editing configuration files, using commands like iscsiadm, lvcreate, and resize2fs.

Uploaded by

thienvugcs
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3K views

How To Configure ISCSI Initiator On Ubuntu 22.04

This document provides instructions for configuring iSCSI on an Ubuntu system. It describes how to install the open-iscsi package, configure the initiator name and settings, discover iSCSI targets, login to targets, and rescan sessions. It also explains how to create logical volumes (LVs) and file systems on the shared storage, including extending an existing LV. The steps covered include installing packages, editing configuration files, using commands like iscsiadm, lvcreate, and resize2fs.

Uploaded by

thienvugcs
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

#1. Install iSCSI initiator on Ubuntu 22.04|20.

04
# apt-get install open-iscsi -y

#2. Configure iSCSI initiator on Ubuntu 22.04|20.04


# vi /etc/iscsi/initiatorname.iscsi

.......
InitiatorName=iqn.2022-08.hidp.controller:node01.initiator01

# vi /etc/iscsi/iscsid.conf

node.startup = automatic

# systemctl restart iscsid open-iscsi

#3. Connect to the iSCSI Target


# iscsiadm -m discovery -t sendtargets -p 192.168.100.103
# iscsiadm -m discovery -t sendtargets -p 192.168.100.105
# iscsiadm -m discovery -t sendtargets -p 192.168.100.107
# iscsiadm -m discovery -t sendtargets -p 192.168.100.101

# iscsiadm -m node -o show

# iscsiadm -m node --login

# iscsiadm -m session -o show

# iscsiadm -m session --rescan

#.4 Create a File System on Shared Backstore


# lsblk
#sudo pvscan

pvcreate /dev/mapper/mptha

vgcreate stack-volumes-lvmdriver-1 /dev/mapper/mptha

lvcreate -l +100%FREE -n stack-volumes-lvmdriver-1-pool stack-volumes-lvmdriver-1

vgrename -v stack-volumes-lvmdriver-1-pool stack-volumes-lvmdriver-1

lvrename /dev/stack-volumes-lvmdriver-1-pool/ stack-volumes-lvmdriver-1 /dev/stack-


volumes-lvmdriver-1/ stack-volumes-lvmdriver-1-pool
-----------------------------------
pvcreate /dev/mapper/mptha-part1
vgcreate stack-volumes /dev/mapper/mptha-part1

lvremove /dev/stack-volumes-lvmdriver-1/ stack-volumes-lvmdriver-1-pool

Extend Volume:
iscsiadm -m session –rescan
lvextend -l +11263 /dev/ubuntu-vg/ubuntu-lv
resize2fs /dev/ubuntu-vg/ubuntu-lv

# sudo pvcreate /dev/sda /dev/sdb


# sudo vgcreate volume_group_name /dev/sda
# sudo vgextend volume_group_name /dev/sdb
# sudo lvcreate -l 100%FREE -n test2 LVMVolGroup
# vgreduce my_volume_group /dev/hda1

# mkfs -t ext3 /dev/vgpool/lvstuff


# df -hT

sudo vim /etc/iscsi/iscsid.conf


#*****************
# Startup settings
#*****************
.......
node.startup = automatic

# *************
# CHAP Settings
# *************
......
node.session.auth.authmethod = CHAP
.....
node.session.auth.username = techviewleo
node.session.auth.password = Passw0rd1
....
sudo systemctl restart iscsid open-iscsi

---------------------

# lvdisplay

# pvdisplay

# lvextend -l +3584 /dev/ubuntu-vg/ubuntu-lv >>> gõ vào bằng tay.

# resize2fs /dev/ubuntu-vg/ubuntu-lv

# lvdisplay

----------------------------------------------------------------------------
$ timedatectl list-timezones | grep -i tokyo
$ sudo unlink /etc/localtime
$ sudo ln -s /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime
$ timedatectl
multipath -ll
echo 1 > /sys/block/sdb/device/rescan
echo 1 > /sys/block/sdc/device/rescan
echo 1 > /sys/block/sdd/device/rescan
echo 1 > /sys/block/sde/device/rescan
multipathd resize map mpathb
pvdisplay
lvdisplay
lvextend -l +3584 /dev/stack-volumes-lvmdriver-1/stack-volumes-lvmdriver-1-pool

You might also like