1 Star 0 Fork 2

午十二/iTennis-Lopts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
repart_xfs_more.sh 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
iTennis 提交于 2019-04-20 09:07 . modify xfs partitions
#!/bin/bash
###########################
#将XFS格式的逻辑卷分区的home目录删掉,将剩余空间全部分给根分区
###########################
TYPE=centos
DE_PART=root
umount /home
lvremove -f /dev/${TYPE}/home
sed -i "/home/d" /etc/fstab
echo "y" | lvcreate -L +10G -n tmp ${TYPE}
echo "y" | mkfs.xfs /dev/${TYPE}/tmp
echo "/dev/mapper/${TYPE}-tmp /tmp xfs defaults 0 0" >> /etc/fstab
mount /dev/mapper/${TYPE}-tmp
cp -ar /var /var_bak
echo "y" | lvcreate -L +10G -n var ${TYPE}
echo "y" | mkfs.xfs /dev/${TYPE}/var
echo "/dev/mapper/${TYPE}-var /var xfs defaults 0 0" >> /etc/fstab
mount /dev/mapper/${TYPE}-var
cp -ar /var_bak/* /var
#rm -rf /var_bak
echo "y" | lvcreate -L +150G -n log ${TYPE}
echo "y" | mkfs.xfs /dev/${TYPE}/log
echo "/dev/mapper/${TYPE}-log /var/log xfs defaults 0 0" >> /etc/fstab
mkdir -p /var/log
mount /dev/mapper/${TYPE}-log
echo "y" | lvcreate -L +60G -n bigdata ${TYPE}
echo "y" | mkfs.xfs /dev/${TYPE}/bigdata
echo "/dev/mapper/${TYPE}-bigdata /srv/BigData xfs defaults 0 0" >> /etc/fstab
mkdir -p /srv/BigData
mount /dev/mapper/${TYPE}-bigdata
echo "y" | lvcreate -L +60G -n opt ${TYPE}
echo "y" | mkfs.xfs /dev/${TYPE}/opt
echo "/dev/mapper/${TYPE}-opt /opt xfs defaults 0 0" >> /etc/fstab
mount /dev/mapper/${TYPE}-opt
echo "y" | lvextend -l +100%FREE /dev/mapper/${TYPE}-opt
echo "y" | xfs_growfs /dev/mapper/${TYPE}-opt
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/woaiguoyiran/iTennis-Lopts.git
git@gitee.com:woaiguoyiran/iTennis-Lopts.git
woaiguoyiran
iTennis-Lopts
iTennis-Lopts
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385