{"id":1332,"date":"2017-01-03T09:57:59","date_gmt":"2017-01-03T08:57:59","guid":{"rendered":"https:\/\/elkano.org\/blog\/?p=1332"},"modified":"2017-01-03T09:57:59","modified_gmt":"2017-01-03T08:57:59","slug":"resize-vps-disk-automated","status":"publish","type":"post","link":"https:\/\/elkano.org\/blog\/resize-vps-disk-automated\/","title":{"rendered":"Resize vps disk in an automated way"},"content":{"rendered":"<p>This is the commands I run to resize automatically the VPS disks when I have resized the disk through Proxmox interface.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\" data-enlighter-theme=\"atomic\">\r\n#!\/bin\/bash\r\n\r\n# This is only needed if you use GPT type tables\r\necho &quot;Fix&quot; | \/usr\/local\/sbin\/parted  ---pretend-input-tty \/dev\/sdb print\r\n# Resize partition 1 using all the space\r\n\/usr\/local\/sbin\/parted \/dev\/sdb resizepart 1 100%\r\n#  I use LVM so the physical volume must be resized first\r\npvresize \/dev\/sdb1\r\n# Resize the logical volume using all space available\r\nlvresize \/dev\/vgdata\/home -l +100%FREE\r\n# Finally notify file system to use all the space\r\nresize2fs \/dev\/vgdata\/home\r\n<\/pre>\n<p>Note: I use parted 3.2, if your distribution comes with an older one uninstall it and install it from <a href=\"http:\/\/ftp.gnu.org\/gnu\/parted\/\">sources<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the commands I run to resize automatically the VPS disks when I have resized the disk through Proxmox interface. #!\/bin\/bash # This is only needed if you use GPT type tables echo &quot;Fix&quot; | \/usr\/local\/sbin\/parted &#8212;pretend-input-tty \/dev\/sdb print # Resize partition 1 using all the space \/usr\/local\/sbin\/parted \/dev\/sdb resizepart 1 100% # I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,3,7],"tags":[117,206,35,207],"_links":{"self":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/1332"}],"collection":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/comments?post=1332"}],"version-history":[{"count":0,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/1332\/revisions"}],"wp:attachment":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/media?parent=1332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/categories?post=1332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/tags?post=1332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}