{"id":441,"date":"2016-12-26T21:59:03","date_gmt":"2016-12-26T21:59:03","guid":{"rendered":"https:\/\/www.xsofthost.com\/help\/?p=441"},"modified":"2017-02-10T22:05:00","modified_gmt":"2017-02-10T22:05:00","slug":"mount-extension-partition-on-vps","status":"publish","type":"post","link":"https:\/\/www.xsofthost.com\/help\/mount-extension-partition-on-vps\/","title":{"rendered":"Mount Extension of a partition on a VPS"},"content":{"rendered":"<h2>How Mount Extension partition on VPS Server<\/h2>\n<p>After you upgrade your <strong>VPS<\/strong> resources, the RAM and the CPU will be automatically upgraded following a simple reboot.<br \/>\nHowever, even though a reboot upgrade the amount of disk space available, the partition on it is not automatically extended. <\/p>\n<p>This part can be done manually. It is highly recommended to extend the partition while in Rescue Mode. <br \/>\nThis guide will assume the VPS has been rebooted in this mode and there is only one partition on your VPS in ext3 or ext4. Please note that the output of the commands may slightly differ than yours. Also, if you reinstall your VPS, the partition will be automatically updated. <\/p>\n<p>Connect to your VPS in <strong>Rescue Mode<\/strong>, enter the following command:<\/p>\n<div class=\"cmd\"><span class=\"prompt\">lsblk<\/span><\/div>\n<p>\nThis will give you the current mounted partitions on your VPS, the one for the Rescue Mode and the one actually containing your data. The output will look like this:<\/p>\n<div class=\"cmd\"><span class=\"output\">NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT <\/span><\/p>\n<div class=\"output\">sda 254:0 0 10G 0 disk<\/div>\n<div class=\"output\">\u2514\u2500sda1 254:1 0 10G 0 part \/<\/div>\n<div class=\"output\">vdb 254:16 0 30G 0 disk<\/div>\n<div class=\"output\">\u2514\u2500sdb1 254:17 0 30G 0 part \/mnt\/sdb1<\/div>\n<div>\u00a0<\/div>\n<\/div>\n<p>consuming that your VPS partition \/dev\/sdb1 mounted. It needs to be unmounted. The command to do so is:<\/p>\n<div class=\"cmd\"><span class=\"prompt\">umount \/dev\/sdb1<\/span><\/div>\n<p>\n Next, it is hight recommended that a filesystem check is made on the partition to correct any error currently present. run the command :<\/p>\n<div class=\"cmd\"><span class=\"prompt\">e2fsck -yf \/dev\/sdb1<\/span><\/p>\n<div>\u00a0<\/div>\n<div class=\"output\">e2fsck 1.42.9 (4-Feb-2014)<\/div>\n<div class=\"output\">Pass 1: Checking inodes, blocks, and sizes<\/div>\n<div class=\"output\">Pass 2: Checking directory structure<\/div>\n<div class=\"output\">Pass 3: Checking directory connectivity<\/div>\n<div class=\"output\">Pass 4: Checking reference counts<\/div>\n<div class=\"output\">Pass 5: Checking group summary information<\/div>\n<div class=\"output\">\/dev\/sdb1: 37870\/1310720 files (0.2% non-contiguous), 313949\/5242462 blocks<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"alert alert-danger\">If you see a &#8220;bad magic superblock&#8221; error, do not continue further. If you can&#8217;t diagnose or fix this issue, it would be best to reinstall the VPS.<\/div>\n<p>After that, open the fdisk application by excute the following command:<\/p>\n<div class=\"cmd\"><span class=\"prompt\">fdisk -u \/dev\/sdb<\/span><\/div>\n<p>\nyou can see the commands available for this application by pass m parameter :<\/p>\n<div class=\"cmd\"><span class=\"prompt\">Command (m for help): m<\/span><\/p>\n<div>\u00a0<\/div>\n<div class=\"output\">Command action<\/div>\n<div class=\"output\">a toggle a bootable flag<\/div>\n<div class=\"output\">b edit bsd disklabel<\/div>\n<div class=\"output\">c toggle the dos compatibility flag<\/div>\n<div class=\"output\">d delete a partition<\/div>\n<div class=\"output\">l list known partition types<\/div>\n<div class=\"output\">m print this menu<\/div>\n<div class=\"output\">n add a new partition<\/div>\n<div class=\"output\">o create a new empty DOS partition table<\/div>\n<div class=\"output\">p print the partition table<\/div>\n<div class=\"output\">q quit without saving changes<\/div>\n<div class=\"output\">s create a new empty Sun disklabel<\/div>\n<div class=\"output\">t change a partition&#8217;s system id<\/div>\n<div class=\"output\">u change display\/entry units<\/div>\n<div class=\"output\">v verify the partition table<\/div>\n<div class=\"output\">w write table to disk and exit<\/div>\n<div class=\"output\">x extra functionality (experts only)<\/div>\n<\/div>\n<p>now we run the command to retrieve the partition start sector. Keep this number with you for later. It is indicated under &#8220;Start&#8221;.<\/p>\n<div class=\"cmd\"><span class=\"prompt\">Command (m for help): p<\/span><\/p>\n<div class=\"blank\">\u00a0<\/div>\n<div class=\"output\">Disk \/dev\/sdb: 30 GB, 21474836480 bytes<\/div>\n<div class=\"output\">54 heads, 49 sectors\/track, 15851 cylinders, total 41943040 sectors<\/div>\n<div class=\"output\">Units = sectors of 1 * 512 = 512 bytes<\/div>\n<div class=\"output\">Sector size (logical\/physical): 512 bytes \/ 512 bytes<\/div>\n<div class=\"output\">I\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<\/div>\n<div class=\"output\">Disk identifier: 0x000132ff<\/div>\n<div class=\"blank\">\u00a0<\/div>\n<div class=\"output\">Device Boot Start End Blocks Id System<\/div>\n<div class=\"output\">\/dev\/vdb1 * *2048* 41941745 20969849 83 Linux<\/div>\n<\/div>\n<p>\n Then, we will remove the partition table and create a new point using the same starting point:<\/p>\n<div class=\"cmd\"><span class=\"prompt\">Command (m for help): d<\/span><\/p>\n<div>\u00a0<\/div>\n<div class=\"output\">Selected partition 1<\/div>\n<\/div>\n<p>The sole partition on the disk is automatically deleted. Then, create a new one.<\/p>\n<div class=\"cmd\"><span class=\"prompt\">Command (m for help): n<\/span><\/p>\n<div class=\"output\">Partition type:<\/div>\n<div class=\"output\">p primary (0 primary, 0 extended, 4 free)<\/div>\n<div class=\"output\">e extended<\/div>\n<div class=\"prompt\">Select (default p): p<\/div>\n<div class=\"prompt\">Partition number (1-4, default 1): 1<\/div>\n<div class=\"prompt\">First sector (2048-41943039, default 2048): 2048<\/div>\n<div class=\"prompt\">Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): 41943039<\/div>\n<\/div>\n<p class=\"bold\">On the line First sector, this is where you must enter the number showed earlier. In the line Last sector, you should enter the default value.<\/p>\n<p>Then, you should make that partition <strong>bootable<\/strong>. If not, your VPS will no longer be functioning.<\/p>\n<div class=\"cmd\"><span class=\"prompt\">Command (m for help): a<\/span><\/p>\n<div class=\"blank\">\u00a0<\/div>\n<div class=\"prompt\">Partition number (1-4): 1<\/div>\n<\/div>\n<p>Save your changes and exit the application as following:<\/p>\n<div class=\"cmd\"><span class=\"prompt\">Command (m for help): w<\/span><\/p>\n<div>\u00a0<\/div>\n<div class=\"output\">The partition table has been altered!<\/div>\n<div class=\"blank\">\u00a0<\/div>\n<div class=\"output\">Calling ioctl() to re-read partition table.<\/div>\n<div class=\"output\">Syncing disks.<\/div>\n<\/div>\n<p>Now, we have to extend the partition by running the following :<\/p>\n<div class=\"cmd\"><span class=\"prompt\">resize2fs \/dev\/sdb1<\/span><\/p>\n<div>\u00a0<\/div>\n<div class=\"output\">resize2fs 1.42.9 (4-Feb-2014)<\/div>\n<div class=\"output\">Resizing the filesystem on \/dev\/sdb1 to 5242624 (4k) blocks.<\/div>\n<div class=\"output\">The filesystem on \/dev\/vdb1 is now 5242624 blocks long.<\/div>\n<\/div>\n<p>now you have to mount the created partion again<\/p>\n<div class=\"cmd\"><span class=\"prompt\">mount \/dev\/sdb1 \/mnt<\/span><\/div>\n<p>Finally you can check your result :<\/p>\n<div class=\"cmd\"><span class=\"prompt\">df -h<\/span><\/p>\n<div>\u00a0<\/div>\n<div class=\"output\">Filesystem Size Used Avail Use% Mounted on<\/div>\n<div class=\"output\">\/dev\/sda1 2GB 1GB 1GB 50% \/<\/div>\n<div class=\"output\">none 4.0K 0 4.0K 0% \/sys\/fs\/cgroup<\/div>\n<div class=\"output\">udev 1.9G 12K 1.9G 1% \/dev<\/div>\n<div class=\"output\">tmpfs 386M 360K 386M 1% \/run<\/div>\n<div class=\"output\">\/dev\/sdb1 20G 512M 19G 2.5% \/mnt<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How Mount Extension partition on VPS Server After you upgrade your VPS resources, the RAM and the CPU will be automatically upgraded following a simple reboot. However, even though a reboot upgrade the amount of disk space available, the partition on it is not automatically extended. This part can be done manually. It is highly [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":438,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[41],"tags":[42,50,74],"_links":{"self":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts\/441"}],"collection":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/comments?post=441"}],"version-history":[{"count":1,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts\/441\/revisions"}],"predecessor-version":[{"id":442,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/posts\/441\/revisions\/442"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/media\/438"}],"wp:attachment":[{"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/media?parent=441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/categories?post=441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xsofthost.com\/help\/wp-json\/wp\/v2\/tags?post=441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}