"Re-mount Disk space" Linux System/home disk space is re-attached to/root

Source: Internet
Author: User
Tags disk usage

The following is a centos7 test done on the version
Use the following command to view disk usage
ls -lh

 file system capacity used% mount point Devtmpfs  3.9G 0 3.9G 0%/devtmpfs  3.9G 0 3.9G 0%/dev/shmtmpfs  3.9G 2.9M 3.9G 1%/runtmpfs 3.9g 0 3.9G 0%/sys/fs/cgroup /dev/mapper/fedora-root 60G 46G 12G 8 1%/tmpfs  3.9G 400K 3.9G 1%/tm     P /dev/sda1 477M 141M 307M 32%/boottmpfs 787M  0 787M 0%/run/user/0/dev/mapper/fedora-home 141G 60M 134G 1%/Home 

/dev/mapper/fedora-homeThe corresponding mount directory is/home
/dev/mapper/fedora-rootThe corresponding mount directory is/root
From the list above /dev/mapper/fedora-home , we can see that the catalogue is very large, but we are /dev/mapper/fedora-root very small now, how can we move the space in the past? Use the following actions

The following steps demonstrate the space size of mobile/home 1G to/root canceling the/home directory mount
Umount-v/Home
check the disks to be transferred
E2fsck-ff  /dev/mapper/fedora-home# 5 Steps for this command operation result must all be passed

The results are shown below

E2fsck 1.42.13 (17-may-20154: Checking reference counts 5th step: Check Cluster summary information /dev/mapper/fedora-home:130190/ 10838016 files (0.1% non-contiguous), 8077341/43338752 blocks
Change the/dev/mapper/fedora-home disk size

Calculation steps: 141G-Transfer 1g = 140G

Resize2fs/dev/mapper/fedora-home  140G
Cut disk space
Lvreduce-l -1g/dev/mapper/fedora-home
Re-mount Home/home
Mount-v/Home
Transfer to/root
Lvextend-l+1g/dev/mapper/fedora-root
Make/root space Effective
Resize2fs/dev/mapper/fedora-root

"Re-mount Disk space" Linux System/home disk space is re-attached to/root

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.