1 Reply Latest reply on Jul 25, 2012 8:29 AM by Dude!

    Best practice of expanding partition size


      I am just wondering what's the best practice of expanding a partition. Currently the server I am working in has the partitions configure as below:

      Filesystem 1K-blocks Used Available Use% Mounted on
      5046848 4630796 155548 97% /
      /dev/sda1 101086 50293 45574 53% /boot
      tmpfs 4087296 2388360 1698936 59% /dev/shm
      /dev/sda3 5162828 141544 4759024 3% /tmp
      /dev/sdb1 1923068 734956 1090424 41% /fs0
      /dev/sdb2 1923084 70908 1754488 4% /fs1
      /dev/sdc1 89406276 68095788 16768916 81% /fs2
      /dev/sdc2 13804204 7061912 6041056 54% /fs3
      /dev/sdb3 6474880 4509556 1636416 74% /fs4

      Let's say I want to increase /fs2 which is /dev/sdc1 by another 15GB. I can go into the VMware and increase the disk size by 20GB but how will I go about increasing the partition size without affecting other partitions?

      Most of the instructions I see online basically creates a new partition but I want to avoid creating a new partition. So is it possible to do it?

        • 1. Re: Best practice of expanding partition size
          You cannot increase a partition on a disk without affecting other partitions on the same disk unless it is the last partition. You will have to completely re-organize your partitions and restore from backup. You can however extend partitions that are under LVM control by adding a free LVM controlled partition or disk and assign it to any existing LVM volume in order to increase it's capacity. There is plenty of documentation and info available on the web. If you plan to increase your LVM root volume you need to boot form external media.

          Since you are using VMware there is actually no need to create multiple partitions on any disk. You can simply put each partition on it's own virtual disk. Then after you increase the underlying virtual disk, you can use "lvextend" for devices under LVM, or "gparted" to modify the partition, and use the "resize2fs" command to adjust the file system, even while the mounted volume is online.