Move tmp partitions in linux

Source: Internet
Author: User
For details about the tmp partition in mobile linux-Linux Enterprise Application-Linux server application, see the following section. During Server Management, you may encounter insufficient partition space or need to adjust the partition size. If you are a common user, you may have to back up data and reinstall the system. However, in the operating linux server system, this is unrealistic. We must learn to dynamically adjust linux partitions. linux provides us with an lvm logical drive volume solution, in addition, there is another method. This article will show you one by one:

In fact, linux provides a more convenient way for our management. We know that the various statuses in the linux system are represented at the corresponding running level, for example, the shutdown process is run level 0. Single User management is run level 1. Our commonly used graphical user interface is defined as run level 5 in a system, and restart is run level 6, for the running level in linux, I will introduce you in detail in future articles. Today, I will introduce you to how to move the tmp partition in linux!

During normal system initialization, the/etc/fstab file will be loaded at startup to mount the file system. When we normally access the system and perform maintenance management, all file systems are not allowed to be detached. So what can we do to let us unload the file system? The answer is "run level". In runlevel 1, the system enters the single-user management mode. Only the root user can log on to the system. When the system runs completely in the memory, we can perform full operations on the hard disk, next we will go to runlevel 1

# Init 1 after executing this command as the root user, the system will shut down all running services and switch to single-user mode. At this time, only the root user can log on. After logging on, for example, we can move/tmp to/var/tmp. We can use:

# Mv/tmp/var/tmp

In this way, the content in/tmp is moved to the/var/tmp directory. Next we will delete the/tmp directory:

# Rm-rf/tmp

Next, create a symbolic link to/var/tmp:

Ln-s/var/tmp

In this case,/tmp is actually changed to a symbolic link pointing to/var/tmp. Then we press ctrl + D to return to the graphic interface. After logging on, the/tmp directory has been removed.

In the same way, you can move/var partition to the new hard disk, but the/var partition is no better than/tmp partition. The important data for system operation is saved here, make sure to back up the data before moving it and check it carefully.

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.