Vishal Gupta's Blog

Resizing disks on Linux

Posted by Vishal Gupta on Mar 12, 2011

RHEL 5.3 x64 disks

On a RHEL OS using LVM volume manager, you can extend the underlying disk and its associated filesytem (non-root) can be extended while its mounted.

  • Extend the underlying virtual/SAN disks.
  • Check the size of disk

#   fdisk -l

  • Force the re-scan of disk, so that OS kernel can see the new size

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

where disk extended was /dev/sdb

  • Extend LVM physical volume size.

# pvs

# pvresize /dev/sdb

# pvs

  • Extend LVM logical volume

# lvdisplay

# lvextend /dev/ora_vg/ora /dev/sdb

# lvdisplay

  • Extend filesystem (online)

# df –h

# resize2fs /dev/ora_vg/ora

# df –h

Filesystem is extended.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: