Got it

Adding, resizing and removing LUN's without restarting SLES

Latest reply: Nov 10, 2020 02:44:17 4804 2 4 0 0

Hello, Community!

This post talks about the processes of adding, resizing and removing LUN's without restarting SLES or the OES Linux SUSE Server 10,11,12. Please see more details below.

Linux SUSE Server

ENVIRONMENT

SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Server 11
Novell Open Enterprise Server 11 (OES 11) Linux
Novell Open Enterprise Server 2 (OES 2) Linux
SUSE Linux Enterprise Server 12 (SLES 12)
SUSE Linux Enterprise Server 12 Service Pack 1 (SLES 12 SP1)
SUSE Linux Enterprise Server 12 Service Pack 2 (SLES 12 SP2)
SUSE Linux Enterprise Server 12 Service Pack 3 (SLES 12 SP3)

ISSUE DESCRIPTION

A LUN on an attached storage device (typically a SAN) needs to be added, resized or removed - without rebooting the server itself.

RESOLUTION

Adding, resizing or removing LUN on a machine that can be rebooted is typically not a difficult task. (Hardware level changes are picked up on the server reboot, and the filesystem can then be created or resized using filesystem specific tools.) However, dynamic storage changes are dependent upon the hardware and software (specifically filesystem) in use. Also, the process varies slightly depending on which SLES version the server is running.

The general process is to add or resize the LUN on the SAN, rescan the servers' SCSI layer to detect the changes, rebuild the MPIO maps, and then add or modify the filesystem. More specific steps are as follows:

Adding an LUN

  1. Create the LUN on the SAN, and assign it to the server.

  2. On the server, execute `rescan-scsi-bus.sh`. Use `lsscsi` to confirm the LUN is seen by the OS. If the disk is not seen, repeat this step using different command line parameters to scan for all devices (i.e. -w -c -l). If the LUN is still not seen, a reboot may be required.

NOTE - VMware environments may require the -a or --alltargets parameter in order to detect new disks properly.
  1. Once the disk is seen by the OS, execute `multipath` or `multipath -v4` (verbose) to build the new MPIO map.

  2. On SLES 10 execute `udevtrigger`. (On SLES11 udevadm trigger is executed automatically)


Resizing an LUN

  1. Increase the size of the LUN on the SAN.

  2. On the server, execute `echo 1 > /sys/block/sdX/device/rescan`.

  3. Resize the MPIO map.
    a) On SLES11 or SLES12, use `multipathd -k'resize map <MPIO_MAP_NAME>'`  
    b) If the resize command fails to resize the LUN or if running SLES10, restart the multipathd daemon using `/sbin/multipathd restart`

NOTE - There is no space between the -k and 'resize in the multipathd command.
  1. After confirming the MPIO map reflects the correct size, resize the filesystem using the appropriate filesystem specific tool. (i.e. resize2fs, resize_reiserfs, pvresize, lvresize, nssmu, etc.).


NOTE: The above procedure is suitable when zero system downtime is required, but doesn't apply for zero application downtime. When an application is actively using a LUN that is being resized, it should be stopped. To keep applications running may lead to unpredictable results.

Removing an LUN

  1. Stop all file access to the LUN to be removed and umount the filesystem if applicable.

  2. If LVM was used on the device(s) to be removed, make sure that no Logical Volumes, Volume Groups or Physical Volumes are still present / in use on the relevant device(s). For more information see “man lvremove”, “man vgremove” and “man pvremove”.

  3. To verify there are no open files left for the device(s) use “lsof /dev/device_name

  4. Check in the output of `multipath -ll` for the WWID of the LUN to be deleted.

  5. Remove the WWID using `multipath -f <WWID>`.

  6. Remove the multipath device from ALL paths to the LUN, run `echo 1 > /sys/bus/scsi/devices/${H:B:T:L}/delete`  (Where H = host:B = bus:T = target:L = lun) For example, 4:0:0:1

NOTE – If any process should still access the removed LUN, a system crash can occur. Make sure that all processes and applications have been stopped and there's nothing accessing the device.
  1. Ensure the LUNs have disappeared from the output of `lsscsi`.

  2. Remove the stale block device entries, on SLES 11 use `multipathd reconfigure`, SLES 10 requires an additional `udevtrigger`

  3. Hide the LUNs on the storage side.


If the above steps do not work, the hardware may not support dynamic storage changes. If a server restart is not possible, please contact Technical Support for further investigation.

ADDITIONAL INFORMATION

Locating the LUN number is best accomplished using the output of `lsscsi`. The beginning of each device line contains 4 numbers separated by colons. These numbers represent the Host:Bus:Target:LUN of each SCSI device. For example:

# lsscsi
[4:0:0:0]    disk    DGC      RAID 5           0216  /dev/sdb 
[4:0:0:1]    disk    DGC      RAID 5           0216  /dev/sdf 
[4:0:0:2]    disk    DGC      RAID 5           0216  /dev/sdc 
[4:0:1:0]    disk    DGC      RAID 5           0216  /dev/sdd 
[4:0:1:1]    disk    DGC      RAID 5           0216  /dev/sdg 
[4:0:1:2]    disk    DGC      RAID 5           0216  /dev/sde 


In the above output, the LUN number for /dev/sdc and /dev/sde (two individual paths) is 2.

Locating the MPIO map name is best accomplished using the `multipath -ll` output. The following example shows the multipath map for the two devices shown above:

# multipath -ll
36006016073c01400a0c14ebcd9bfde11 dm-6 DGC,RAID 5
size=100G features='1 queue_if_no_path' hwhandler='1 emc' wp=rw
|-+- policy='round-robin 0' prio=4 status=active
| `- 4:0:0:2 sdc 8:32 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
  `- 4:0:1:2 sde 8:64 active ready running


In this example, the MPIO map name is 36006016073c01400a0c14ebcd9bfde11.

Thank you
View more
  • x
  • convention:

Cool!
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.