1

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
1
  • Have you bumped the sys admins that host your site. This kind of "upgrade" seems half-assed to me honestly. I would ask them "What gives?" and see if they will expand your partitions for you. EDIT, just read the 80 euro part. Sheesh, good hosting is hard to find sometimes... Commented Aug 12, 2015 at 19:54

1 Answer 1

3

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.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.