Got it

How to mount LUN to linux host

Created: Dec 14, 2019 21:56:23Latest reply: Sep 30, 2020 12:30:41 3840 10 1 0 0
  Rewarded HiCoins: 5 (problem resolved)

Hey guys!

I have a question about how to mount the LUNs to linux host through iSCSI?

Anyone helps me? Thank you!

Featured Answers

Best answer

Recommended answer

stephen.xu
Admin Created Dec 15, 2019 04:10:53

Hi, umairyaqub

The following is the suggestions on troubleshooting:


Storage:


1)       Confirm the port is configured with IP and it is in link-up status.


72816c61b69b4725a6d1c86a1b4f49dd


2)       Confirm the LUN/LUN group has been configured.


4b75e12c832c4cc4afdedce54f54a385

3)       Confirm the host/host group has been configured.

6dec9d2652e84161a37e36c8300a33a6

a)         Confirm the initiator has been created and the status is online. The IQN can be obtained from Linux OS.

34373ac2e9e043719f1b6186733b8c1c

b)         Confirm the storage is able to ping to the server OS.

                         i.              Login into storage using cli

a)         User: admin

b)         Password (Default): Admin@storage

                       ii.              Change to developer mode - change user_mode current_mode user_mode=developer

1f23449dd5464596b46ab28319056357

                      iii.              Change to minisystem

6d87ececb3224e60b3998c8457614731

 

                      iv.              Ping to the server OS using the interface that is configured with the IP 192.168.7.5

5e5b84497f6c4342be50e31128b32c1c

 

3d0008c91d334a109e9cd7e8fe951ee2

4)       Confirm the mapping is done.

83e5c8c7438049c9b0e5d663c8130b52

 

 

Switch:

1)       Confirm the switch configuration on port is correct:

fc73fa15fa16495ab2f8d051e64ce9fc

If bond port is configured:

2fd45d00b10e4118a6f7b8cc979cf039

3967c281961a486c84b32d29b7e2abf2 

 

 

Host:

1)       Confirm that the server is able to ping to storage service IP and gateway.

154f142f80e24046a14afd91b69bc3e9

 

l  If storage service IP is not ping-able, the possible causes are as below:

ü  Wrong cabling

ü  Switch configuration error

  Route is not configured

  VLAN is not configured

ü  Host network configuration error

  Gateway is not configured

  IP is not configured

ü  Storage service port configuration error

  Default route is not configured

  IP is not configured

 

2)       Confirm the configuration of iSCSI Initiator

a)         Make sure the iSCSI initiator package is installed. Try to run iscsiadm to check.

                         i.              If it is not installed, attach the Linux ISO and install the rpm file for iscsi-initiator-utils.

e072d6035dd84b0197281a76633775a0

                       ii.              Then obtain the iscsi iqn - vi /etc/iscsi/initiatorname.iscsi

824742432a1d47d3ad22f1f155edcfb7

                      iii.              Once obtain the initiator, add the initiator in storage.

                      iv.              Then discover the storage - iscsiadm -m discovery -t st -p 192.168.7.5 -l

f3581ff7bb294231915a8fe5ef1d4843

                       v.              Rescan the disk - rescan-scsi-bus.sh

                      vi.              Then fdisk –l to scan the disk, normally the new added disk is named as /dev/sdb

73b4a384c5754d738c7f2a3e1ce6d1c3

                    vii.              Then convert the drive to file system and mount to the system

fb27607b3fb34416b1539cac2e2231a6

c652381fe80d433d8a8995636e758efb


b7cbf06b89da42a79cab683ca5efc622


View more
  • x
  • convention:

umairyaqub
umairyaqub Created Dec 15, 2019 08:04:53 (0) (0)
thank you  
stephen.xu
stephen.xu Created Dec 16, 2019 00:34:36 (0) (0)
You are welcome.  
All Answers
to mount the lun to linux host do the following.
after creating the mapping view and adding the linux's initiator to the mapping.
go to linux and and scan for iscsi targets,
run the followings command to start iscsi and scan for luns.
1. /etc/init.d/iscsi start
Check iscsi status : /etc/init.d/iscsi status
restart iscsi : /etc/init.d/iscsi restart

Scan for target ip: iscsiadm -m discovery -t st -p x.x.x.x (where x.x.x.x is the ip of storage link connected to host)
Login iscsi target: iscsiadm -m node -t <IQN> -p x.x.x.x (where iqn is the initiator of storage and x.x.x.x is storage's ip)
if this login command doesn't work then do this to login all targets connected to that host: iscsiadm -m node -l

once this is done, check for the lun, and format it, Follow the procedure given below.
1. fdisk -l (to check the lun)
2. fdisk /dev/sdb (where /dev/sdb is your newly created lun, it can appear with any name)
then enter by this sequence
3. n>p>1>default>default>w (input these when fdisk asks you to input parameters)
after this, run again
4.fdisk -l
now /dev/sdb will appear as /dev/sdb1
now run
5. mkfs.ext3 /dev/sdb1
when its completed, your lun will be ready to mount
make a directory anywhere by
6. mkdir /test (where test is the name of new directory where we want to mount the lun)
Now you can mount
7. mount /dev/sdb1 /test
That's it. you are good to go, lun should be mounted now.
you can create a sample file by running following
touch hello.txt

Let me know if this solves the problem. Thanks
View more
  • x
  • convention:

a
View more
  • x
  • convention:

edit
View more
  • x
  • convention:

edit
View more
  • x
  • convention:

edit

View more
  • x
  • convention:

  • x
  • convention:

Hi, umairyaqub

The following is the suggestions on troubleshooting:


Storage:


1)       Confirm the port is configured with IP and it is in link-up status.


72816c61b69b4725a6d1c86a1b4f49dd


2)       Confirm the LUN/LUN group has been configured.


4b75e12c832c4cc4afdedce54f54a385

3)       Confirm the host/host group has been configured.

6dec9d2652e84161a37e36c8300a33a6

a)         Confirm the initiator has been created and the status is online. The IQN can be obtained from Linux OS.

34373ac2e9e043719f1b6186733b8c1c

b)         Confirm the storage is able to ping to the server OS.

                         i.              Login into storage using cli

a)         User: admin

b)         Password (Default): Admin@storage

                       ii.              Change to developer mode - change user_mode current_mode user_mode=developer

1f23449dd5464596b46ab28319056357

                      iii.              Change to minisystem

6d87ececb3224e60b3998c8457614731

 

                      iv.              Ping to the server OS using the interface that is configured with the IP 192.168.7.5

5e5b84497f6c4342be50e31128b32c1c

 

3d0008c91d334a109e9cd7e8fe951ee2

4)       Confirm the mapping is done.

83e5c8c7438049c9b0e5d663c8130b52

 

 

Switch:

1)       Confirm the switch configuration on port is correct:

fc73fa15fa16495ab2f8d051e64ce9fc

If bond port is configured:

2fd45d00b10e4118a6f7b8cc979cf039

3967c281961a486c84b32d29b7e2abf2 

 

 

Host:

1)       Confirm that the server is able to ping to storage service IP and gateway.

154f142f80e24046a14afd91b69bc3e9

 

l  If storage service IP is not ping-able, the possible causes are as below:

ü  Wrong cabling

ü  Switch configuration error

  Route is not configured

  VLAN is not configured

ü  Host network configuration error

  Gateway is not configured

  IP is not configured

ü  Storage service port configuration error

  Default route is not configured

  IP is not configured

 

2)       Confirm the configuration of iSCSI Initiator

a)         Make sure the iSCSI initiator package is installed. Try to run iscsiadm to check.

                         i.              If it is not installed, attach the Linux ISO and install the rpm file for iscsi-initiator-utils.

e072d6035dd84b0197281a76633775a0

                       ii.              Then obtain the iscsi iqn - vi /etc/iscsi/initiatorname.iscsi

824742432a1d47d3ad22f1f155edcfb7

                      iii.              Once obtain the initiator, add the initiator in storage.

                      iv.              Then discover the storage - iscsiadm -m discovery -t st -p 192.168.7.5 -l

f3581ff7bb294231915a8fe5ef1d4843

                       v.              Rescan the disk - rescan-scsi-bus.sh

                      vi.              Then fdisk –l to scan the disk, normally the new added disk is named as /dev/sdb

73b4a384c5754d738c7f2a3e1ce6d1c3

                    vii.              Then convert the drive to file system and mount to the system

fb27607b3fb34416b1539cac2e2231a6

c652381fe80d433d8a8995636e758efb


b7cbf06b89da42a79cab683ca5efc622


View more
  • x
  • convention:

umairyaqub
umairyaqub Created Dec 15, 2019 08:04:53 (0) (0)
thank you  
stephen.xu
stephen.xu Created Dec 16, 2019 00:34:36 (0) (0)
You are welcome.  
Thank you.
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.