Resizing Plesk Linux (Ubuntu) server on Hyper-V with dynamic expansion

&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2530 " id&equals;"quads-ad2530" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;<h2>Change Production Environment VM &lpar;Plesk&rpar;&colon;<&sol;h2>&NewLine;<p>Having to change a production Environment Virtual Machine while hosting multiple website could be a nightmare especially when you have no space left and websites are on the edge of error&period;<&sol;p>&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2527 " id&equals;"quads-ad2527" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2524 " id&equals;"quads-ad2524" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2522 " id&equals;"quads-ad2522" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;<p>I got a complaint from one of the webmasters of the websites that her password was not working so I went and changed it from Plesk however&comma; it didn’t actually work&period;<&sol;p>&NewLine;<p>When connected to the server I realized that there was no space left on the server<&sol;p>&NewLine;<p><strong>Ubuntu 18&period;04 is the server edition&period;<&sol;strong><&sol;p>&NewLine;<p>On my Hyper-V Host I went and checked if I can resize the VM while it’s on but unfortunately since the machine has Checkpoints&period; After switching off the machine and removing the Checkpoints I was able to resize the disk to 700GB and start it again&period;<&sol;p>&NewLine;<p>In this article I will take you through the process or resizing the Linux Machine starting from Hyper-V all the way until your Plesk Server is able to provision this disk space&period;<&sol;p>&NewLine;<h4>Resize Linux &sol; Ubuntu on Hyper-V<&sol;h4>&NewLine;<p>To Resize Ubuntu&sol;Linux Server on HyperV<&sol;p>&NewLine;<p>Edit Machine On Hyper-V&comma; If the edit button is greyed out then you&&num;8217&semi;ll need to switch off the VM to be able to expand the physical disk&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image001&period;png"><img style&equals;"margin&colon; 0px&semi; display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"clip&lowbar;image001" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image001&lowbar;thumb&period;png" alt&equals;"clip&lowbar;image001" width&equals;"628" height&equals;"311" border&equals;"0" &sol;><&sol;a> &NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2523 " id&equals;"quads-ad2523" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine; &NewLine;<&sol;p>&NewLine;<p>After expanding the disk &lpar;in my case I expand it to 712GB&rpar; since the current disk is 100&percnt; full already<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image002&period;png"><img style&equals;"margin&colon; 0px&semi; display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"clip&lowbar;image002" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image002&lowbar;thumb&period;png" alt&equals;"clip&lowbar;image002" width&equals;"612" height&equals;"100" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image003&period;png"><img style&equals;"margin&colon; 0px&semi; display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"clip&lowbar;image003" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image003&lowbar;thumb&period;png" alt&equals;"clip&lowbar;image003" width&equals;"440" height&equals;"107" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<h4>Scan Physical Disk Space<&sol;h4>&NewLine;<p>After expansion on Hyper-V is successful&comma; I will switch on the VM&comma; then will need to rescan the already connected disk&comma; first identify which disk you want to rescan&period; &lpar;in my case it is sda3&rpar;<&sol;p>&NewLine;<p><strong>ls &sol;sys&sol;class&sol;scsi&lowbar;disk&sol;<&sol;strong><&sol;p>&NewLine;<p>In my example&comma; I see a symlink named 2&colon;0&colon;0&colon;0&comma; so we rescan this scsi-disk&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image004&period;png"><img style&equals;"margin&colon; 0px&semi; display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"clip&lowbar;image004" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image004&lowbar;thumb&period;png" alt&equals;"clip&lowbar;image004" width&equals;"539" height&equals;"49" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p><strong>echo &&num;8216&semi;1&&num;8217&semi; &gt&semi; &sol;sys&sol;class&sol;scsi&lowbar;disk&sol;2&bsol;&colon;0&bsol;&colon;0&bsol;&colon;0&sol;device&sol;rescan<&sol;strong><&sol;p>&NewLine;<p>When trying to scan as a normal user or a superuser in normal mode&comma; I get permission denied issue so I will go ahead and turn to Root mode<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image005&period;png"><img style&equals;"margin&colon; 0px&semi; display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"clip&lowbar;image005" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image005&lowbar;thumb&period;png" alt&equals;"clip&lowbar;image005" width&equals;"922" height&equals;"102" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p>Scanning is finished<&sol;p>&NewLine;<h4>Change Volume Disk<&sol;h4>&NewLine;<p>Follow the instructions below in order to expand the machine&&num;8217&semi;s disk and introduce the changes to Plesk&period;<&sol;p>&NewLine;<p>Run <strong>Parted <&sol;strong>as a super user &lpar;Root or sudo su superuser&rpar;<&sol;p>&NewLine;<p>Press <strong>P <&sol;strong>to list partitions and then choose the partition you want to expand&period;<&sol;p>&NewLine;<p>In my case it&&num;8217&semi;s going to be Partition 3<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image006&period;png"><img style&equals;"margin&colon; 0px&semi; display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"clip&lowbar;image006" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image006&lowbar;thumb&period;png" alt&equals;"clip&lowbar;image006" width&equals;"611" height&equals;"303" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p>In order to resize the partition 3 I will type<&sol;p>&NewLine;<p><strong>Resizepart 3<&sol;strong><&sol;p>&NewLine;<p>And next to that you&&num;8217&semi;ll have to put the value that you need to expand the disk &lpar;In my case I will type -0&rpar;<&sol;p>&NewLine;<p>-0 value will give it provision the entire disk space from Hyper-V<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image007&period;png"><img style&equals;"margin&colon; 0px&semi; display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"clip&lowbar;image007" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image007&lowbar;thumb&period;png" alt&equals;"clip&lowbar;image007" width&equals;"551" height&equals;"301" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p>After doing so&comma; the new value of partition 3 will be updated<&sol;p>&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2525 " id&equals;"quads-ad2525" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image008&period;png"><img style&equals;"margin&colon; 0px&semi; display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"clip&lowbar;image008" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image008&lowbar;thumb&period;png" alt&equals;"clip&lowbar;image008" width&equals;"670" height&equals;"157" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p>Quit<&sol;p>&NewLine;<h4>Resize Logical Volume<&sol;h4>&NewLine;<p>The file system meta information needs to indicate the size of disk&comma; and resize2fs updates this&period; Thus&comma; after expanding&comma; run resize2fs &sol;dev&sol;sda3&period;<&sol;p>&NewLine;<h4><&sol;h4>&NewLine;<p>If resize2fs didn&&num;8217&semi;t work for any reason try pvresize in Root Mode<&sol;p>&NewLine;<p><strong>pvresize &sol;dev&sol;sda3<&sol;strong><&sol;p>&NewLine;<p>To write changes to the Logical Volume run the following command<&sol;p>&NewLine;<p><strong>lvextend -l &plus;100&percnt;FREE &sol;dev&sol;mapper&sol;ubuntu&&num;8211&semi;vg-ubuntu&&num;8211&semi;lv<&sol;strong><&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image009&period;png"><img style&equals;"display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"clip&lowbar;image009" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;clip&lowbar;image009&lowbar;thumb&period;png" alt&equals;"clip&lowbar;image009" width&equals;"919" height&equals;"81" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p>It&&num;8217&semi;s recommended to do this in read mode&comma; so I will quit the root and get back to my normal user<&sol;p>&NewLine;<p>Let’s see the Volume Group using VGS command&comma; as you can see it looks like the Volume group has already updated the size&period;<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;image&period;png"><img style&equals;"display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"image" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;image&lowbar;thumb&period;png" alt&equals;"image" width&equals;"457" height&equals;"63" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p>Now we need to check the Physical Volume&period; sda3 was upgraded from 268GB to 711 GB<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;image-1&period;png"><img style&equals;"margin&colon; 0px&semi; display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"image" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;image&lowbar;thumb-1&period;png" alt&equals;"image" width&equals;"670" height&equals;"86" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p>Next we’ll need to check the Logical Volume and see if it is updated<&sol;p>&NewLine;<p>To do this&comma; type sudo lvdisplay<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;image-2&period;png"><img style&equals;"margin&colon; 0px&semi; display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"image" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;image&lowbar;thumb-2&period;png" alt&equals;"image" width&equals;"649" height&equals;"344" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p>Let’s check if there’s any update on the Logical Volumes by using<&sol;p>&NewLine;<p>sudo df –H<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;image-3&period;png"><img style&equals;"display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"image" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;image&lowbar;thumb-3&period;png" alt&equals;"image" width&equals;"782" height&equals;"249" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p>The disk I need to increase is &sol;dev&sol;mapper&sol;ubuntu—vg-ubuntu—lv<&sol;p>&NewLine;<p>Last step&colon;<&sol;p>&NewLine;<h2>Extending Logical Volume<&sol;h2>&NewLine;<p>To do this I will type the command<&sol;p>&NewLine;<p>Sudo resize2fs &sol;dev&sol;mapper&sol;ubuntu—vg-ubuntu—lv<&sol;p>&NewLine;<p>This should take care of the disk expansion<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;image-4&period;png"><img style&equals;"margin&colon; 0px&semi; display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"image" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;image&lowbar;thumb-4&period;png" alt&equals;"image" width&equals;"852" height&equals;"119" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p>Once this command is successful&comma; It should reflect on the disk size via command df -H<&sol;p>&NewLine;<p><a href&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;image-5&period;png"><img style&equals;"display&colon; inline&semi; background-image&colon; none&semi;" title&equals;"image" src&equals;"https&colon;&sol;&sol;www&period;moh10ly&period;com&sol;wp-content&sol;uploads&sol;2020&sol;12&sol;image&lowbar;thumb-5&period;png" alt&equals;"image" width&equals;"722" height&equals;"240" border&equals;"0" &sol;><&sol;a><&sol;p>&NewLine;<p>Hope this help someone&comma; If for some reason your Plesk stopped working after this please try to move the tc&period;log file to another location and then restart mysql&sol;mariadb<&sol;p>&NewLine;<p><strong>sudo mv &sol;var&sol;lib&sol;mysql&sol;tc&period;log &sol;root&sol;<&sol;strong><&sol;p>&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2531 " id&equals;"quads-ad2531" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;<p><strong>sudo service mariadb start<&sol;strong><&sol;p>&NewLine;&NewLine;<&excl;-- WP QUADS Content Ad Plugin v&period; 2&period;0&period;92 -->&NewLine;<div class&equals;"quads-location quads-ad2529 " id&equals;"quads-ad2529" style&equals;"float&colon;none&semi;margin&colon;0px 3px 3px 3px&semi;padding&colon;0px 0px 0px 0px&semi;" data-lazydelay&equals;"0">&NewLine;&NewLine;<&sol;div>&NewLine;&NewLine;

moh10ly

Recent Posts

Reset passwords for Active Directory Users

Reset and manage your Active Directory users' Passwords Active Directory is one of the most…

3 years ago

Finding Exchange Database hidden mailboxes. ​

Finding Exchange Database hidden mailboxes. Story:Maybe you have been in this situation before, trying to…

3 years ago

Setting up ADConnect and PTA (Password auth through) servers agents behind proxy

If you're using a Proxy server in your firewall or in your network and have…

3 years ago

Get Report of Active Directory Locked Accounts and Machine they logged in from

Story:I got some clients  that have reported some of their users being locked out and…

3 years ago

Checking and Providing Full and SendAs delegate access on O365 Exchange Online

Delegate Permissions This is a code that I have wrote recently to check if an…

3 years ago

Retrieving attachments from Exchange mailbox using python

Story: I got a request from a client who constantly gets CVs and have to…

4 years ago

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298

Warning: Undefined array key "adsense_ad_type" in /www/wwwroot/www.moh10ly.com/wp-content/plugins/quick-adsense-reloaded/includes/amp-condition-display.php on line 298