Today, we have solved the problem of insufficient Ubuntu storage space. I checked a lot of information on the Internet and there was no way to satisfy me.
I am a cainiao user, and of course I use the most dish method. The following are my solutions for your reference.
Procedure:
Step 1In ubuntu, go to the/host/Ubuntu/disks directory where Ubuntu is installed, and copy the Virtual Disk root. disk to extra. Disk. It takes a long time to wait ......
Of course, you can use other names.
Step 2, Run"Sudo Mount-o loop/host/Ubuntu/disks/extra. Disk/mnt"Command to mount extra. disk to the/mnt directory.
Step 3To check whether the extra. Disk virtual disk is attached properly. If the mount is normal, the/mnt directory contains directories such as bin, home, USR, and etc, which are copies of the/directory.
Delete all directories and files except/mnt/home.
Step 4, Execute"Sudo MV-r/mnt/home // MNT/"Move all subdirectories and files under the/mnt/home directory to the/mnt directory. Delete the/mnt/home directory.
Step 5, Execute"Sudo VI/etc/fstab"Modify the/etc/fstab file and mount extra. disk to the/home directory.
Step 6, Execute"Sudo Rm-RF/home /*"Delete all data in the/home directory.
Step 7, Execute"Sudo Mount-"Or restart the Ubuntu system. The above operation takes effect! (Note: The Mount-a command is to mount all the drive letters in/etc/fstab)
Verification:
Run"DF-H"View the mounting and usage of the drive letter.
As shown above:/dev/loop1 is mounted to the/home directory and the size is 12 GB.
Run [menu]-[Attachment]-[disk usage analyzer] to analyze the disk usage.
You can choose to delete files or directories that occupy a large space.
The deletion provided by gnome is not a real deletion, but the object is moved ~ /. Local/share/trash Directory, which is equivalent to the recycle bin. You can use RM to delete objects.
Summary:
in addition to the/home directory, you can also choose other places, such as/OPT,/usr, And/MNT. As you like.
In addition to copying a virtual disk, you can also mount a real drive letter, such as/dev/sda6. How to do it.