<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2530 " id="quads-ad2530" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>
<h2>Change Production Environment VM (Plesk):</h2>
<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.</p>
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2527 " id="quads-ad2527" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2524 " id="quads-ad2524" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2522 " id="quads-ad2522" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<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, it didn’t actually work.</p>
<p>When connected to the server I realized that there was no space left on the server</p>
<p><strong>Ubuntu 18.04 is the server edition.</strong></p>
<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. After switching off the machine and removing the Checkpoints I was able to resize the disk to 700GB and start it again.</p>
<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.</p>
<h4>Resize Linux / Ubuntu on Hyper-V</h4>
<p>To Resize Ubuntu/Linux Server on HyperV</p>
<p>Edit Machine On Hyper-V, If the edit button is greyed out then you&#8217;ll need to switch off the VM to be able to expand the physical disk.</p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image001.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image001" src="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image001_thumb.png" alt="clip_image001" width="628" height="311" border="0" /></a> 

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2523 " id="quads-ad2523" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>
 
</p>
<p>After expanding the disk (in my case I expand it to 712GB) since the current disk is 100% full already</p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image002.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image002" src="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image002_thumb.png" alt="clip_image002" width="612" height="100" border="0" /></a></p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image003.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image003" src="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image003_thumb.png" alt="clip_image003" width="440" height="107" border="0" /></a></p>
<h4>Scan Physical Disk Space</h4>
<p>After expansion on Hyper-V is successful, I will switch on the VM, then will need to rescan the already connected disk, first identify which disk you want to rescan. (in my case it is sda3)</p>
<p><strong>ls /sys/class/scsi_disk/</strong></p>
<p>In my example, I see a symlink named 2:0:0:0, so we rescan this scsi-disk.</p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image004.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image004" src="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image004_thumb.png" alt="clip_image004" width="539" height="49" border="0" /></a></p>
<p><strong>echo &#8216;1&#8217; >; /sys/class/scsi_disk/2\:0\:0\:0/device/rescan</strong></p>
<p>When trying to scan as a normal user or a superuser in normal mode, I get permission denied issue so I will go ahead and turn to Root mode</p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image005.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image005" src="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image005_thumb.png" alt="clip_image005" width="922" height="102" border="0" /></a></p>
<p>Scanning is finished</p>
<h4>Change Volume Disk</h4>
<p>Follow the instructions below in order to expand the machine&#8217;s disk and introduce the changes to Plesk.</p>
<p>Run <strong>Parted </strong>as a super user (Root or sudo su superuser)</p>
<p>Press <strong>P </strong>to list partitions and then choose the partition you want to expand.</p>
<p>In my case it&#8217;s going to be Partition 3</p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image006.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image006" src="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image006_thumb.png" alt="clip_image006" width="611" height="303" border="0" /></a></p>
<p>In order to resize the partition 3 I will type</p>
<p><strong>Resizepart 3</strong></p>
<p>And next to that you&#8217;ll have to put the value that you need to expand the disk (In my case I will type -0)</p>
<p>-0 value will give it provision the entire disk space from Hyper-V</p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image007.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image007" src="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image007_thumb.png" alt="clip_image007" width="551" height="301" border="0" /></a></p>
<p>After doing so, the new value of partition 3 will be updated</p>
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2525 " id="quads-ad2525" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image008.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image008" src="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image008_thumb.png" alt="clip_image008" width="670" height="157" border="0" /></a></p>
<p>Quit</p>
<h4>Resize Logical Volume</h4>
<p>The file system meta information needs to indicate the size of disk, and resize2fs updates this. Thus, after expanding, run resize2fs /dev/sda3.</p>
<h4></h4>
<p>If resize2fs didn&#8217;t work for any reason try pvresize in Root Mode</p>
<p><strong>pvresize /dev/sda3</strong></p>
<p>To write changes to the Logical Volume run the following command</p>
<p><strong>lvextend -l +100%FREE /dev/mapper/ubuntu&#8211;vg-ubuntu&#8211;lv</strong></p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image009.png"><img style="display: inline; background-image: none;" title="clip_image009" src="https://www.moh10ly.com/wp-content/uploads/2020/12/clip_image009_thumb.png" alt="clip_image009" width="919" height="81" border="0" /></a></p>
<p>It&#8217;s recommended to do this in read mode, so I will quit the root and get back to my normal user</p>
<p>Let’s see the Volume Group using VGS command, as you can see it looks like the Volume group has already updated the size.</p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/image.png"><img style="display: inline; background-image: none;" title="image" src="https://www.moh10ly.com/wp-content/uploads/2020/12/image_thumb.png" alt="image" width="457" height="63" border="0" /></a></p>
<p>Now we need to check the Physical Volume. sda3 was upgraded from 268GB to 711 GB</p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/image-1.png"><img style="margin: 0px; display: inline; background-image: none;" title="image" src="https://www.moh10ly.com/wp-content/uploads/2020/12/image_thumb-1.png" alt="image" width="670" height="86" border="0" /></a></p>
<p>Next we’ll need to check the Logical Volume and see if it is updated</p>
<p>To do this, type sudo lvdisplay</p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/image-2.png"><img style="margin: 0px; display: inline; background-image: none;" title="image" src="https://www.moh10ly.com/wp-content/uploads/2020/12/image_thumb-2.png" alt="image" width="649" height="344" border="0" /></a></p>
<p>Let’s check if there’s any update on the Logical Volumes by using</p>
<p>sudo df –H</p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/image-3.png"><img style="display: inline; background-image: none;" title="image" src="https://www.moh10ly.com/wp-content/uploads/2020/12/image_thumb-3.png" alt="image" width="782" height="249" border="0" /></a></p>
<p>The disk I need to increase is /dev/mapper/ubuntu—vg-ubuntu—lv</p>
<p>Last step:</p>
<h2>Extending Logical Volume</h2>
<p>To do this I will type the command</p>
<p>Sudo resize2fs /dev/mapper/ubuntu—vg-ubuntu—lv</p>
<p>This should take care of the disk expansion</p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/image-4.png"><img style="margin: 0px; display: inline; background-image: none;" title="image" src="https://www.moh10ly.com/wp-content/uploads/2020/12/image_thumb-4.png" alt="image" width="852" height="119" border="0" /></a></p>
<p>Once this command is successful, It should reflect on the disk size via command df -H</p>
<p><a href="https://www.moh10ly.com/wp-content/uploads/2020/12/image-5.png"><img style="display: inline; background-image: none;" title="image" src="https://www.moh10ly.com/wp-content/uploads/2020/12/image_thumb-5.png" alt="image" width="722" height="240" border="0" /></a></p>
<p>Hope this help someone, If for some reason your Plesk stopped working after this please try to move the tc.log file to another location and then restart mysql/mariadb</p>
<p><strong>sudo mv /var/lib/mysql/tc.log /root/</strong></p>
<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2531 " id="quads-ad2531" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>

<p><strong>sudo service mariadb start</strong></p>

<!-- WP QUADS Content Ad Plugin v. 2.0.92 -->
<div class="quads-location quads-ad2529 " id="quads-ad2529" style="float:none;margin:0px 3px 3px 3px;padding:0px 0px 0px 0px;" data-lazydelay="0">

</div>


Reset and manage your Active Directory users' Passwords Active Directory is one of the most…
Finding Exchange Database hidden mailboxes. Story:Maybe you have been in this situation before, trying to…
If you're using a Proxy server in your firewall or in your network and have…
Story:I got some clients that have reported some of their users being locked out and…
Delegate Permissions This is a code that I have wrote recently to check if an…
Story: I got a request from a client who constantly gets CVs and have to…