Editing
Mounting iSCSI LUNs
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Mounting the LUN == This is where things diverge for different Linux distributions. The differences include the sequence during boot where multiple things have to happen before the mount is successful: # the basic device structure is created # the network devices are created # the network devices are configured and connect to a network # the iscsi subsystem starts and tries to connect to the storage server # the mount process takes the device created by the iscsi session and mounts it Getting these activities to happen in the right order is what gets challenging; the process for doing this under RHEL-style distributions uses systemd and is described [[Systemd mounted iSCSI volumes|here]]. With Debian-based distributions, the process only involves adding an entry to the '''''/etc/fstab''''' file. First, however, you need to create the filesystem and get the needed data for mounting. Get the device assigned to your LUN: ls -l /dev/disk/by-path This will show all your drives -- the one for the LUN will actually contain the iqn for the LUN in the path. Now you make the filesystem (I prefer XFS): sudo apt install -y xfsprogs sudo mkfs.xfs /dev/sdX Now you get the UUID for the filesystem to create the entry in '''''/etc/fstab'''''. Mounting by UUID is safer than using the device name since if you add more iSCSI LUNs or add other disk devices, the device name can change. ls -l /dev/disk/by-uuid Find the UUID for the iSCSI device. Note that this UUID is created by the ''mkfs'' process ... if you rebuild the filesystem, it will have a new UUID. Now you can add a line to '''''/etc/fstab''''': UUID=<uuid from the last step> <mount point> xfs _netdev,auto,defaults 0 0 The ''_netdev'' specifies that the device is network-based and must wait for the network to be up and stable before the mount can succeed. Now you can mount the device or just reboot the system: sudo mkdir <mount point> sudo mount <mount point> Definitely more work than it should have taken ...
Summary:
Please note that all contributions to WilliamsNet Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
WilliamsNet Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Navigation
Commons
Architecture
How-To
Systems
Hardware
SysAdmin
Kubernetes
OpenSearch
Special
Pages to create
All pages
Recent changes
Random page
Help about MediaWiki
Formatting Help
Tools
What links here
Related changes
Special pages
Page information