Extended storage space in Ubuntu

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.