How Linux migrates the/home partition

Source: Internet
Author: User
Lab Environment:
The company originally installed the RHEL5 server with an automatic partitioning scheme, as the number of system users using the server continues to increase, the root partition often face disk space exhaustion situation, occasionally also caused the system to fail to boot. In order to solve these problems, we need to add a new SCSI hard disk for the server, and migrate the data from user directory "/home" to the hard disk, which will not affect the use of the old user account after the migration.
Requirements Description:
(1) Add a 80GB SCSI disk to the virtual machine.
Add new hard drive after shutdown, reboot into RHEL5 system (or reboot after adding hard drive)
Vm→settings (or press the shortcut key Ctrl+d) →add→




(2) Set up a 20GB partition on the new hard disk to hold all the normal user's host folders.
Partitioning and formatting
1 Use the FDISK command to partition the new hard disk, creating a 20GB Primary partition ("/DEV/SDB1").





2 perform "partprobe" to update the partition table information, using the MKFS command to format the newly created partition in the previous step to the EXT3 file system.


(3) The newly created partition is still attached to the "/home" directory and needs to import the data from the system.
Migrating the "/home" Partition
1 Transfer the contents of the original "/home" directory and do a backup.

2 Modify the partition mount settings in the "/etc/fstab" file.



3 Attach the newly created partition to the "/home" directory by pressing the settings in the "/etc/fstab" file.

4 Copy the user data backed up in this step ① to the newly mounted "/home" file system.

(4) The server can automatically mount to the partition after each boot.

How Linux migrates the/home partition

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.