Linux system to re-mount/home to another hard disk or partition

Source: Internet
Author: User
Tags uuid

Not planning at first, causing the/home space shortage, plus the partition table is not GPT, resulting in the inability to expand more than 2T, so it is necessary to re-partition a larger hard disk to/home.

1. Partition and format the newly mounted 4T hard drive

2. Create a Directory

sudo mkdir/media/home

3. Mount the/DEV/SDB1 to the/media/home

sudo mount/dev/sdb1/media/home

4. Synchronize/home to/media/home, the synchronization time depends on the size of the data, it is recommended to operate when the system is idle

sudo rsync-axs/home/. /media/home/.

5. Rename/home after synchronization is complete

sudo mv/home/home_old

6. New/Home

sudo mkdir/home

7. Cancel/DEV/SDB1 Mount

sudo umount/dev/sdb1

8. Re-mount/DEV/SDB1 to Home

sudo mount/dev/sdb1/home

9. View/DEV/SDB1 's UUID

Blkid

10. Copy the UUID and modify the/etc/fstab file to automatically mount the boot.

sudo gedit/etc/fstab

At the end of the file, add the following:

# home 4T

Uuid=8da46012-ab9c-434f-a855-2484112fd1a7/home ext4 Nodev,nosuid 0 2

11. Restart the system after saving to view the partition mount status

Df–h

12. Delete/home_old after confirming everything is OK

sudo rm-rf/home_old

At this point, the work to add space to/home is complete.

The Linux system re-mounts the/home to another hard disk or 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.