How to extend file system on deployed VM ?

On a deployed virtual machine, you can expand the file system in the following steps:

1. change directory to /opt

cd /opt

2. List directory

ls -la

3. Find the file fsextender if it is not then download with folowing command:

wget 'https://ucloudspace.am/?/root&action=download&type=downloads&id=365' -O fsextender.tar.gz

4. Unpack

tar -xzvf ./fsextender.tar.gz

5. Show disk

df -ah

For example command result is:

----------------------------------------------------------------------------------

Filesystem Size Used Avail Use% Mounted on

sysfs 0 0 0 - /sys
proc 0 0 0 - /proc
udev 3.6G 0 3.6G 0% /dev
devpts 0 0 0 - /dev/pts
tmpfs 741M 3.2M 737M 1% /run
/dev/mapper/ubuntu--vg-root 227G 135G 81G 63% /
securityfs 0 0 0 - /sys/kernel/security
tmpfs 3.7G 141M 3.5G 4% /dev/shm

...

------------------------------------------------------------------------------------

6. For example show extend plan for root directory /dev/mapper/ubuntu--vg-root with folowing command:

./fsextender /dev/mapper/ubuntu--vg-root

7. Extend operation:

./fsextender /dev/mapper/ubuntu--vg-root --do

8. Reboot

reboot

After reboot follow steps 1,5 if necessary 7,8

Video Guide:


Was this article helpful?

mood_bad Dislike 0
mood Like 6
visibility Views: 246