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












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









share|improve this question

























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

    – datUser
    Aug 12 '15 at 19:54


















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









share|improve this question

























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

    – datUser
    Aug 12 '15 at 19:54
















1












1








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









share|improve this question
















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






debian filesystems partition vps






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 26 at 23:58









Rui F Ribeiro

39.9k1479134




39.9k1479134










asked Aug 12 '15 at 19:51









ArkymedesArkymedes

813




813













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

    – datUser
    Aug 12 '15 at 19:54





















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

    – datUser
    Aug 12 '15 at 19:54



















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

– datUser
Aug 12 '15 at 19:54







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

– datUser
Aug 12 '15 at 19:54












1 Answer
1






active

oldest

votes


















2














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.






share|improve this answer
























  • Ok, that was ridiculously easy: the "resize2fs /dev/vda1" worked like a charm and took half a second to perform. Thanks so much for this!

    – Arkymedes
    Aug 12 '15 at 22:06











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f222860%2fhow-to-extend-partition-to-all-unallocated-space-in-a-vps%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














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.






share|improve this answer
























  • Ok, that was ridiculously easy: the "resize2fs /dev/vda1" worked like a charm and took half a second to perform. Thanks so much for this!

    – Arkymedes
    Aug 12 '15 at 22:06
















2














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.






share|improve this answer
























  • Ok, that was ridiculously easy: the "resize2fs /dev/vda1" worked like a charm and took half a second to perform. Thanks so much for this!

    – Arkymedes
    Aug 12 '15 at 22:06














2












2








2







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.






share|improve this answer













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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 12 '15 at 20:36









Stephen KittStephen Kitt

170k24384461




170k24384461













  • Ok, that was ridiculously easy: the "resize2fs /dev/vda1" worked like a charm and took half a second to perform. Thanks so much for this!

    – Arkymedes
    Aug 12 '15 at 22:06



















  • Ok, that was ridiculously easy: the "resize2fs /dev/vda1" worked like a charm and took half a second to perform. Thanks so much for this!

    – Arkymedes
    Aug 12 '15 at 22:06

















Ok, that was ridiculously easy: the "resize2fs /dev/vda1" worked like a charm and took half a second to perform. Thanks so much for this!

– Arkymedes
Aug 12 '15 at 22:06





Ok, that was ridiculously easy: the "resize2fs /dev/vda1" worked like a charm and took half a second to perform. Thanks so much for this!

– Arkymedes
Aug 12 '15 at 22:06


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f222860%2fhow-to-extend-partition-to-all-unallocated-space-in-a-vps%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to make a Squid Proxy server?

第一次世界大戦

Touch on Surface Book