I have a CentOS 5 VM and I've just increased the VM disk from 10G to 20G, but I cannot get fdisk to see the new disk size without a reboot.

I've tried echo 1 > /sys/block/sda/device/rescan, it seems to indicate it can see the new size, but when I go to fdisk to create a new partion it still sees the disk as 10G.

Any ideas?

  • Depending on your virtualisation platform and storage method, this may or may not be possible. Details matter. – womble Aug 31 '11 at 9:47
  • Which virtual disk type you've added: IDE or SCSI? – quanta Aug 31 '11 at 9:48
  • That first command worked for me... – Rodo Mar 1 '17 at 17:01

You need to issue the rescan command to your SCSI bus.

In VMware the SCSI controller might be found in some unusual place. First find it:

find /sys -iname 'scan'

For me that returned


Then just issue the rescan command

echo "- - -" >/sys/devices/pci0000:00/0000:00:07.1/host0/scsi_host/host0/scan
echo "- - -" >/sys/devices/pci0000:00/0000:00:07.1/host0/scsi_host/host1/scan
echo "- - -" >/sys/devices/pci0000:00/0000:00:10.0/host0/scsi_host/host2/scan

That should help. :)

  • 6
    ls /sys/class/scsi_host maybe faster. – quanta Aug 31 '11 at 9:52
  • 1
    9 years later... just wanna mention this made my VM go down with "ext4-fs ERROR" notices, had to stop and restart the VM. It all worked out, but still, gonna comment here to warn people this might happen. Aaaand after the reboot, the increased disk size was picked up of course. – KdgDev Mar 19 '20 at 11:00

I had to deal with a similar problem, on a SLES 11 server. The LVM was built with raw disks, running on VMWare ESXi

# pvcreate /dev/sdd; vgextend ....

After a while I needed to increase LVM size, but I didn't add a supplemental disk and then pvcreate + vgextend as I've done before, but I chose to increase the size of an existing disk (/dev/sdd in this case). After doing the increase in VMWare, I executed a

# rescan-scsi-bus.sh

But pvdisplay was still showing the 'old' disk size. It was necessary to do a

# echo 1 > /sys/block/sdd/device/rescan

for the kernel to learn the new disk size of /dev/sdd

  • 6
    echo 1 > /sys/block/sda/device/rescan worked for me on CentOS – Benedikt Köppel Apr 30 '16 at 19:37
  • -bash: /sys/module/scsi_mod/parameters/scan: Permission denied, username is root – Sarz Sep 27 '16 at 11:43

after first doing echo 1 > /sys/block/sda/device/rescan

pvresize /dev/sda did the trick for me


If the partition table is directly in use (e.g. you have mounted filesystem using a base partition) the kernel will continue to use the old partition table until this is no longer the case. Someone once told me that if you are using LVM you can get around this....


Update: Centos 6 - not possible to update partition table of active disk online, Centos 7 - it is possible to extend last partition with growpart or create new partition with fdisk and make it visible without reboot with partprobe. Probably same on ubuntu/debian. - At some point after 2.6 kernel started supporting online reread of partition table of active disk. Since question is for Centos 5 I would say no way.

If you are using partitions then you have to reboot to use new space. I didn't find a way to avoid this. If someone has let me know.

However, reboot should be done after you extend last partition on the disk or add new partition. Doesn't make sense to reboot before.

First thing you should notice after rescan is bigger disk size in fdisk and in lsblk. If you don't see it you have to play with these echo 1 and echo - - - commands.

After you see more space you can extend/add partition, then reboot, extend vg, extend lv and fs.

If you want to avoid reboot you have to assign raw sda/b/c disk to volume group without partitioning it to sda1/2/3. Then there is no need for reboot.

Partitioning was necessary some time ago when linux could not boot from LVM, but now it can.

If you do lsblk you will see partitions or lvms depending on if you are using partitions or lvm, you can have all parts if you don't use lvm or all lvms if you don't use partitions. Here is one example:

root@srv4 ~ $ lsblk
sda                           8:0    0  7.3T  0 disk
├─sda1                        8:1    0  500M  0 part /boot
└─sda2                        8:2    0  7.3T  0 part
  ├─vg_srv4-LogVol13 (dm-0) 253:0    0  7.1T  0 lvm  /
  ├─vg_srv4-LogVol05 (dm-1) 253:1    0  100G  0 lvm  /var/log
  ├─vg_srv4-LogVol04 (dm-2) 253:2    0   20G  0 lvm  /var
  ├─vg_srv4-LogVol01 (dm-5) 253:5    0   20G  0 lvm  /opt
  ├─vg_srv4-LogVol00 (dm-6) 253:6    0   20G  0 lvm  /home
  ├─vg_srv4-LogVol03 (dm-7) 253:7    0   20G  0 lvm  /usr
  └─vg_srv4-LogVol02 (dm-8) 253:8    0    8G  0 lvm  /tmp

To detect changes to existing disk:

echo 1 > /sys/class/block/sdX/device/rescan

To detect new disk:

echo 1 > /sys/class/scsi_device/X:X:X:X/device/block/device/rescan

To find X in the first situation you can use fdisk -l.



I know this maybe a little late, but I'm running KVM on the host. To get the disk size change I had to trigger it on the host, not the guest. In my case it was

  • Use lvm to extend the volume space lvextend -L+4G /dev/<volume group>/<volume>
  • Get the disk / block info virsh qemu-monitor-command <vm name from virsh list> --hmp "info block"
  • Tell kvm of the changes virsh qemu-monitor-command <vm name> --hmp "block_resize drive-virtio-disk2 <new size>"

I had previously run commands like echo "- - -" > /sys/class/scsi_host/host1/scan but nothing changed until I ran the the virsh qemu-monitor-command -hmp command


You have to reboot, there's no way around that.

  • How about the force system to rescan? – quanta Aug 31 '11 at 9:50
  • I did have to reboot :-( – AndyM Sep 9 '11 at 12:10
  • I had to reboot too. – ondra Jun 13 '16 at 8:12
  • 1
    This is completely untrue. I have done this multiple times without rebooting. – Duncan X Simpson Jun 16 '18 at 17:45
  • With CentOS7.5 running under VMware, I have tried all the suggestions above - all the echos to .../rescan and .../scan, and the new VMware disk size has not been recognized. Obviously, it works for some folks in presumably different circumstances. – Stephen P. Schaefer Nov 2 '20 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.