2

So I am trying to extend the disk space on a VM of Centos5 running cPanel.

Apparently my boss says this is easy but invariably I seem to have found a problem and cant seem to get it to play ball. The disk used to be 15GB and is now 200GB (changed via vSphere) and I can now see that the size of /dev/sda has

Disk /dev/sda: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          38      305203+  83  Linux
/dev/sda2              39         299     2096482+  83  Linux
/dev/sda3             300         556     2064352+  82  Linux swap / Solaris
/dev/sda4             557        2088    12305790    5  Extended
/dev/sda5             557        2088    12305758+  83  Linux

have tried removing sda5 and then creating a new partiotion in its place however it gives me the correct starting block (557) but gives me the last cyclinder option of 2088, not 26108. This means that it is still reading as the same size whne I write the partition info to the disk. Bouncing the server has not helped either. Have I fundamentally misunderstood the method for extending the disk on Centos? Ta

ewwhite
  • 197,159
  • 92
  • 443
  • 809
  • 1
    Whenever bosses (the reasonable type! Don't try on the difficult types ;) say something is easy, ask them politely(!!) on how they would suggest doing it ;) – rackandboneman May 17 '12 at 16:44

2 Answers2

3

This is an extended partition, so you'll need to remove partition 5 AND partition 4.

  • From there, recreate partition 4 as "Extended" and use the same start point. Your new endpoint for partition 4 will be cylinder 26108.
  • Follow that by creating partition 5 with the same start cylinder. Make its end cylinder 26108 as well.
  • Save the partition table "w" and either reboot or run partprobe to rescan.
  • From there, you'll be able to resize the filesystem on /dev/sda5 (assuming resize2fs).
ewwhite
  • 197,159
  • 92
  • 443
  • 809
1

The problem seems to be that your extended partition /dev/sda4 stops at cylinder 2088. You have to change /dev/sda4 and /dev/sda5

Ulrich Dangel
  • 296
  • 2
  • 5