CentOS

Add new LUN or Disk, or Resize the LUN or Disk on a Linux without a reboot

JJ
Jobin Joseph · Founder and CEO
·Published 16 October 2013·1 min read

We often need to add or modify a disk to a running server. In this article, we will see how you can Add new LUN or Disk, or Resize the LUN or Disk on a Linux without a reboot

Scenario 1 – Add  a new Disk or LUN

You have added a new disk / LUN to the running server and it is not appearing on the server.

Solution

We have to find the hostnumber first, by running the below commands.

grep mpt /sys/class/scsi_host/host?/proc_name

This will show you a result like the below one,

/sys/class/scsi_host/host1/proc_name:mptspi

In my case, host1 is the one im looking for.

Now, run the below command and the disk will be detected.

echo "- - -" /sys/class/scsi_host/host1/scan

Scenario 2 – Expand or Resize current Disk or LUN

You have already a LUN / Disk attached to the server and you need to resize the same.

Solution

Once you have resized the LUN / Disk from the Storage, please run the below command

echo 1 > /sys/class/scsi_device/device/rescan

If you are facing any issues after running the command, please comment below.

Jobin Joseph
Jobin Joseph, Founder and CEO
5x AWS Certified, ISO 27001:2022 Lead Implementer, 17+ years building cloud infrastructure for regulated industries.
About Jobin →

Reading this because your AWS bill or uptime is a problem?

30 minutes, direct with the founder, no sales pitch: one specific recommendation for your AWS workload.

Book a free 30-minute review
30 min Free Consultation →