2

I have created new instance with Centos 6.4 with 20 GB Disk Space but when i logging to the VPS and Execute df -h the space shown as the following

Filesystem            Size  Used Avail Use% Mounted on
/dev/vda1             984M  706M  229M  76% /
none                 1012M     0 1012M   0% /dev/shm

and the output of fdisk -l

Disk /dev/vda: 21.5 GB, 21474836480 bytes
4 heads, 32 sectors/track, 327680 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a5c87

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1              17       16401     1048640   83  Linux

i need the vda1 taking all the space of vda how i can do this ?

user9517
  • 115,471
  • 20
  • 215
  • 297
Tarek Esmail
  • 21
  • 1
  • 2

1 Answers1

2

You need to resize partition, then grow filesystem:

  1. Take backup
  2. fdisk /dev/vda -> d -> 1 -> n -> p -> 1 -> 17 -> [enter]

  3. -> p

    ensure that partition is marked with asterisk (*) to be bootable, if not:

    a -> 1

    when done -> w

  4. resize2fs /dev/vda1

    (online process, wait!)

  5. reboot

Note: You are missing swap partition, you can use +xxxxM instead if [enter] to leave some space for swap partition.

GioMac
  • 4,544
  • 4
  • 27
  • 41
  • I need this automatically when i create the instance , the default image for openstack is fedora 19 not have this problem this problem with any images like centos , windows and other , when i trying to install centos from ISO file there are not any disk appears – Tarek Esmail Sep 07 '13 at 12:10
  • 1
    this is how it is. You need to configure parameters during installation or you need other image. – GioMac Sep 07 '13 at 12:16