Use chroot to deal with insufficient disk space

Source: Internet
Author: User
Many people ask how to expand disk space in Linux. The answer is to use LV, so I will ask what to do without LV. there will be very few answers! In any case, you have to mount another disk. Without using LV, it is difficult to simply merge the space. No doubt you have to mount another larger disk. In general, the original system tends to be retained, and the new disk is mounted only to make up the space difference. The method in this article is to completely transfer to the new disk, and the old disk is kept dry, because the Unix File System is a tree, this method is also good.
After entering the system, do the following:
1. fdisk/dev/sdx
2. mkfs. XX/dev/sdx1
3. mkdir/mnt/New & Mount/dev/sdx1/mnt/New
4. CP/*/mnt/New
5. rm-RF $ everything in the root directory except for accessing the system and executing the chroot dependency
6. Create a script in/etc/rc2.d to execute chroot/mnt/New (you can also choose not to use the old disk space), and then reboot.
In this way, when the disk is full and a larger disk is attached, the chroot smoothly transitions in. To make the original disk available, we recommend that you do not write chroot in the boot item/etc/rc2.d, so that you can enter the root directory of the old disk, and then chroot to the new disk.

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.