如何在线增加,修改,删除LUN


Adding, resizing or removing LUN on a machine that can be rebootedis typically not a difficult task. (Hardware level changes are pickedup on the server reboot, and the filesystem can then be created orresized using filesystem specific tools.) However, dynamic storagechanges are dependent upon the hardware and software (specificallyfilesystem) in use. Also, the process varies slightly depending onwhich SLES version the server is running.

The general processis to add or resize the LUN on the SAN, rescan the servers' SCSIlayer to detect the changes, rebuild the MPIO maps, and then add ormodify the filesystem. More specific steps are as follows:

Addinga LUN:

  1. Create the LUN on the SAN, andassign it to the server.

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

    NOTE- VMware environments may require the -w or --ids=XX parameter inorder to detect new disks properly.

  3. Once the disk is seen by the OS, execute `multipathreconfigure` to build the new MPIO map.

  4. On SLES 10 execute `udevtrigger`. (On SLES11udevadm triggeris executed automatically)

其中,文件rescan-scsi-bus.sh在包sg3_utils中。


Resizing a LUN:

  1. Increase the size of the LUN onthe SAN.

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

  3. Resize the MPIO map using`multipathd -k'resize map <MPIO_MAP_NAME>` (SLES 10), orrestart the multipathd daemon using `/etc/multipathd restart` (workson SLES 10 and SLES 11).
      NOTE - There is no space betweenthe -k and 'resize in themultipathd command.

  4. After confirming the MPIO mapreflects the correct size, resize the filesystem using theappropriate filesystem specific tool. (i.e. resize2fs,resize_reiserfs, pvresize, lvresize, nssmu, etc.).

NOTE: The above procedure is suitable when zero system downtime isrequired, but doesn't apply for zero application downtime. When anapplication is actively using a LUN that is being resized, it shouldbe stopped. To keep application running may lead to unpredictableresults.


Removing a LUN:

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

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

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

  4. Remove the multipath device fromall paths to the LUN. Run `echo 1 >/sys/bus/scsi/devices/${SCSI-ID}/delete`.

NOTE – If any process would stillaccess the removed LUN, system crash can occur. Double check that allprocesses and applications have been stopped and there's nothingaccessing 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 additional `udevtrigger`

  3. Hide the LUNs on the storage side.


If the above steps do not work, the hardware may not supportdynamic storage changes. If a server restart is not possible, pleasecontact Novell/SUSE 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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值