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
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.
Comments