微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

How to resize /dev/mapper/centos-home

• backup the contents of /home

> tar -czvf /root/home.tgz -C /home .

• test the backup

> tar -tvf /root/home.tgz

• unmount home

> umount /dev/mapper/centos-home

• remove the home logical volume

> lvremove /dev/mapper/centos-home

• recreate a new 400GB logical volume for /home,format and mount it

> lvcreate -L 400GB -n home centos
> mkfs.xfs /dev/centos/home
> mount /dev/mapper/centos-home

• extend your /root volume with ALL of the remaining space and resize (-r) the file system while doing so

> lvextend -r -l +100%FREE /dev/mapper/centos-root

• restore your backup

> tar -xzvf /root/home.tgz -C /home

• check /etc/fstab for any mapping of /home volume. IF it is using UUID you should update the UUID portion. (Since we created a new volume,UUID has changed)


copied from:

http://serverfault.com/questions/771921/how-to-shrink-home-and-add-more-space-on-centos7

原文地址:https://www.jb51.cc/centos/378586.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。