Migrate/home directory to other partitions in Linux environment

Source: Internet
Author: User

In general, we migrate the home directory to other partitions in the Linux environment, nothing more than the size of the space, after the migration can do the expansion effect, so here do a migration process. This is illustrated by the method of adding a new hard disk partition and migrating the home directory to the new partition.


The first step, because the virtual machine used, so first add a hard disk it


Step Two

Fdisk/dev/sdb

then choose N (Create a new partition)

First Sector the general return with the default is good, meaning represents the starting point of the sector code. Then pop command (M for help): interface, select w, meaning write exit, after partprobe The following synchronization partition table.

MKFS.XFS/DEV/SDB1 will be /DEV/SDB1 partition is formatted as XFS File System

Step Three

to create a temporary /Home Catalogue

Mount /dev/sdb1 to temp directory

Enter Init 1 to switch to Maintenance mode (make sure no one is connected to the system in production, if there are still visitors, need to clear), copy home directory files to /mnt/home and go to Mount profile directory /etc/fstab

Enter the VIM editor so input

Finally can be edited into this, the previous home line to delete, save exit, input Mount-a

Enter DF and ls-l instructions to view,/home has been migrated successfully

Original/home Do not delete, after the system stabilized for some time before processing. If the original directory is simply lifted and mounted to the new directory, the files in the original directory will be hidden.



Migrate/home directory to other partitions in Linux environment

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.