How to extend partition to all unallocated space in a VPS?

Arkymedes

I rent a VPS that uses a SSD of 10GB (Debian 7) and I upgraded yesterday to their "second tier" plan that uses a 20GB disk. However, the "one-click-upgrade" process didn't work as I expected and what they did was to move my data to a bigger drive without actually extending the partitions. So now I have 10GB of unallocated space.

I do run around 5 websites on this VPS with mail accounts and all that jazz and I'm very scared to mess up anything so I called their support and they offered to do the job for me for 80 EUR that I find unacceptable since I thought it was included when doing the upgrade. Their older offers from last year used to be just a one click job but the excuse is that "SSD's are different, so it's up to the user".

Anyway, how can I actually do that without screwing things up and is it possible to do that on a "live" system?

I know a couple of commands so here it goes what I could find:

root@vpsxxxxxx:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          9.9G  7.6G  1.8G  81% /
udev             10M     0   10M   0% /dev
tmpfs           388M  200K  388M   1% /run
/dev/vda1       9.9G  7.6G  1.8G  81% /
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           775M     0  775M   0% /run/shm
/dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client2/web2/log
/dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client1/web3/log
/dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client3/web5/log
/dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client5/web7/log
/dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client4/web6/log

root@vpsxxxxxx:~# fdisk -l

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

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048    41943039    20970496   83  Linux

root@vpsxxxxxx:~# sfdisk -l

Disk /dev/vda: 41610 cylinders, 16 heads, 63 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/4/32 (instead of 41610/16/63).
For this listing I'll assume that geometry.
Units = cylinders of 65536 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/vda1   *     16  327679  327664   20970496   83  Linux
/dev/vda2          0       -       0          0    0  Empty
/dev/vda3          0       -       0          0    0  Empty
/dev/vda4          0       -       0          0    0  Empty
Stephen Kitt

fdisk -l shows that your new partition already occupies all 20GB of space, so all you need to do is resize the filesystem itself. There are various ways of doing this depending on the filesystem you're using; if you have fsadm installed, you can use that:

fsadm resize /dev/vda1

(this will work for ext2/ext3/ext4 filesystems as well as ReiserFS and XFS).

Otherwise, assuming ext2/ext3/ext4:

resize2fs /dev/vda1

It should be possible to do this with the filesystems mounted, without rebooting. The commands will tell you if something is wrong before doing anything risky.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to extend partition with unallocated space?

From Dev

How to extend root partition using unallocated space?

From Dev

Extend root partition with unallocated space on the left

From Dev

Unable to extend partition to adjacent unallocated space

From Dev

Cannot extend a partition located AFTER the unallocated space

From Dev

Extend the ubuntu root partition with unallocated space

From Dev

Ubuntu 16.10 extend partition from unallocated space

From Dev

Can't extend C partition. How to make unallocated space "adjacent"

From Dev

How to extend C: drive to claim unallocated space?

From Dev

how to merge / extend unallocated space? (Not dual os)

From Dev

Why can't I extend this partition into the unallocated space?

From Dev

Extend root partition using unallocated space on dual boot system

From Dev

Unallocated space, how to resize /home partition?

From Dev

How to grow filesystem to use unallocated space in partition?

From Dev

How to add this unallocated space to ubuntu partition

From Dev

how to allocate the unallocated space of windows partition

From Dev

Unallocated space, how to resize /home partition?

From Dev

gparted: how to merge unallocated space with a partition

From Dev

How to merge my root partition with unallocated space

From Dev

How to add the unallocated space to root partition?

From Dev

How to add unallocated space to root partition

From Dev

How to add unallocated space to partition in this particular case?

From Dev

Extend unallocated partition into linux partition

From Dev

Unallocated space partition to Primary Partition

From Dev

I want to extend root partition but unallocated space is on the left side of the root partition

From Dev

Turning unallocated space into an NTFS partition

From Dev

Adding unallocated space to Ubuntu partition

From Dev

Merge unallocated space with Ubuntu partition?

From Dev

Expanding ubuntu partition with unallocated space

Related Related

  1. 1

    How to extend partition with unallocated space?

  2. 2

    How to extend root partition using unallocated space?

  3. 3

    Extend root partition with unallocated space on the left

  4. 4

    Unable to extend partition to adjacent unallocated space

  5. 5

    Cannot extend a partition located AFTER the unallocated space

  6. 6

    Extend the ubuntu root partition with unallocated space

  7. 7

    Ubuntu 16.10 extend partition from unallocated space

  8. 8

    Can't extend C partition. How to make unallocated space "adjacent"

  9. 9

    How to extend C: drive to claim unallocated space?

  10. 10

    how to merge / extend unallocated space? (Not dual os)

  11. 11

    Why can't I extend this partition into the unallocated space?

  12. 12

    Extend root partition using unallocated space on dual boot system

  13. 13

    Unallocated space, how to resize /home partition?

  14. 14

    How to grow filesystem to use unallocated space in partition?

  15. 15

    How to add this unallocated space to ubuntu partition

  16. 16

    how to allocate the unallocated space of windows partition

  17. 17

    Unallocated space, how to resize /home partition?

  18. 18

    gparted: how to merge unallocated space with a partition

  19. 19

    How to merge my root partition with unallocated space

  20. 20

    How to add the unallocated space to root partition?

  21. 21

    How to add unallocated space to root partition

  22. 22

    How to add unallocated space to partition in this particular case?

  23. 23

    Extend unallocated partition into linux partition

  24. 24

    Unallocated space partition to Primary Partition

  25. 25

    I want to extend root partition but unallocated space is on the left side of the root partition

  26. 26

    Turning unallocated space into an NTFS partition

  27. 27

    Adding unallocated space to Ubuntu partition

  28. 28

    Merge unallocated space with Ubuntu partition?

  29. 29

    Expanding ubuntu partition with unallocated space

HotTag

Archive