1. After expanding the disk via the console and restarting the instance, check the cloud disk capacity in the console:

2. Check the disk space usage, including data disks that are not yet mounted, using the following commands:
df -h
fdisk -l
Friendly reminder: If you run the fdisk -l command and do not see /dev/xvdb, it means your cloud server has no data disk. In that case, you do not need to mount anything, and this tutorial does not apply to you.
3. From steps 1 and 2, we find:
/dev/xvdb: 21.5 GB
/dev/xvdb1 9.9G
/dev/xvdb1 needs to be changed to 20 GB to indicate a successful expansion.

4. If your disk was previously mounted on the server, unmount it first.
umount /dev/xvdb1
Note: umount /var/www should also work (Alibaba Cloud official documentation recommends using this command).
Error:
umount: /var/www: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))

5. This means a program is currently using the disk. You can run lsof /dev/xvdb1 or fuser -mv /dev/xvdb1 to see which process is occupying it, as shown in the figure below:
I found a bash process with PID 18786, a cosplash process with PID 1291, and a soffice.bin process with PID 1308 occupying it. You can then stop the corresponding services or kill the corresponding processes to successfully unmount the disk.
If there is only a single bash process, it usually means a user is logged in within this directory. Simply navigating out of this directory will resolve it.
Execute the following commands in sequence:
lsof /dev/xvdb1
fuser -mv /dev/xvdb1
lsof /dev/xvdb1
After one user logged out, the bash process was gone;

6. The results show that a process is currently occupying the mounted data disk, preventing it from being unmounted. You can forcefully terminate the process occupying the data disk with the following commands:
Execute in sequence:
kill -9 1291
kill -9 1308

7. Execute again:
umount /dev/xvdb1
Success;

umount /dev/xvdb1
Success;
8. Delete the original partition and create a new one.
Execute:
fdisk /dev/xvdb
to partition the data disk;
Following the prompts, enter in sequence:
d
n
p
1
Press Enter twice
wq
The partitioning will begin and finish very quickly.

9. Check the new partition.
Use:
fdisk -l
You can see that the new partition xvdb1 has been successfully created.
10. Format the disk.
Use the resize2fs command to expand the file system size; existing data will not be lost.
e2fsck -f /dev/xvdb1
resize2fs /dev/xvdb1

11. Mount the disk.
Finally, we mount the expanded disk back to its original mount point.
mount /dev/xvdb1 /var/www

