The directory of the file system for expansion.

1. First, you must ensure that other districts have enough space to give to the root directory /. You can use the following command to see:

$ sudo df -h

It can be seen here home directory free space is still very great, so we will be home of the space given to some of the root directory.

2. The expansion of the root of the idea is as follows:

The / home folder backup, delete the logical volume / home file system is located, to increase the logical volume / file system is located, to increase / file system size, and finally the new / home directory, and restore the contents of / home folder.

3. Back up the / home partition contents

It should be selected to accommodate the next / home folder partition size, see / run remaining space 32G, so we will / home to backup / run below.

$ sudo tar cvf /run/home.tar /home

4. Uninstall / home

First terminate all use the / home file system process, here be careful not to do the following in the / home directory:

$ sudo fuser -km /home

Then, uninstall:

$ sudo umount /home

5. Delete / logical volume lv home located:

$ sudo lvremove /dev/mapper/centos-home

Select y.

6. To extend the logical root directory is located, to increase the 1T here:

$ sudo lvextend -L +1T /dev/mapper/centos-root

7. expand / file system:

$ sudo xfs_growfs /dev/mapper/centos-root

8. Reconstruction / home file system needed for logical volumes:

Since we have just points out 1.0T, so creating a logical volume size here is 2.5T.

$ sudo lvcreate -L 2.5T -n/dev/mapper/centos-home

9. Create a file system:

$ sudo mkfs.xfs  /dev/mapper/centos-home

10. The new file system is mounted / home directory:

$ sudo mount /dev/mapper/centos-home

11. restore the contents of / home directory:

$ sudo tar xvf /run/home.tar -C /
12. Delete / run following a backup:
$ sudo rm -rf /run/home.tar


reference:

1. Linux root directory full of resolve (/ dev / mapper / centos- root 100% issue)

2. 解决umount: /home: device is busy

Guess you like

Origin blog.csdn.net/u011078141/article/details/91974028