折腾记-装最新centos,重新配置网站

折腾是病,其实这个没人看的博客一直运转的好好的,某天看到装最新centos系统,心里痒痒的,开始折腾,这一折腾就是折腾了一天,晚上还是强迫自己睡觉的,中间的曲折就不说了,主要说说折腾的过程,以便以后更好的折腾。
1:刚开始是xshell登陆ssh折腾,折腾的很不舒服,正确姿势是进入阿里云后台,登陆远程链接。一开始装的系统是后台装的debian系统,重启,进入高级模式,在高级菜单里选择recovery mode模式。systemctl start networking,连接上网;fdisk -l 确定自己的盘名称。
2:开始系统的重新安装,详细地址参考:https://tech.cxthhhhh.com/linux/2018/07/31/original-network-one-click-reinstall-centos-7-official-pure-safe-efficient-cn.html。感谢技术达人的分享,这里要根据自己网络的好坏下载时间不等。等的人心急,喝杯茶。时间差不多刷新远程链接登入,看见完成后,在阿里云后台控制按钮重启机器。再远程链接进入后,发现系统是centos了,等待完成。
3:正如技术达人分享,系统装完后,要进行磁盘扩展,虽然都是英文,但是还是看懂了,就是最后一步的输入数值。是 [Free PE / Size]乘以4

1. Enter disk management
(Please note that your disk is vda or sda, I will use vda to demonstrate how to partition)
fdisk /dev/vda

2. Press the keyboard [n] in sequence to divide the remaining space.
Next enter the keyboard [p], indicating that we want to create a primary partition.
Next enter the keyboard [3], indicating that we want to create vda3.
The default value is taken twice in succession, so that all remaining space can be divided.

3. Next press the keyboard [t] to indicate that we want to modify the partition format.
Next enter the serial number 3, indicating that we want to modify the vda3 space.
Next enter the serial number 8e, indicating that we want to modify to the LVM partition format.
Next press the keyboard [w] to save the changes to the partition table.
(ignoring the notification that the device is busy)

4. Assign the remaining free disk space to the /root partition
partprobe
pvcreate /dev/vda3
vgextend centos /dev/vda3

5. View the LVM size that can be divided into /root partitions.
vgdisplay
[Assignable LVM Space] is the value obtained by multiplying the value of [Free PE / Size] by 4MB, and the size is MB.

6. Assign to / root partition by size.
lvextend -L +[Assignable LVM Space]MB /dev/mapper/centos-root
resize2fs -p /dev/mapper/centos-root
df -h

折腾记-装最新centos,重新配置网站
4:完成后全新干净的系统就安装好了,此刻就是SSH操作,网站环境配置,网站数据的配置等工作了,前面都有说过了,就不重复了。看了一下新装的系统(命令:cat /etc/redhat-release)是CentOS Linux release 7.5.1804 (Core) ,到官网上看了一下,为最新版本。折腾完成后还是很舒服的,听别对于现在各种云的自己的系统什么安全固件啊都木有了。注意配置好密码,端口也基本就很安全了,还是值得折腾的。

原创文章,作者:道情,如若转载,请注明出处:https://www.imhua.com/2018/92.html

发表评论

登录后才能评论

联系我们

QQ:36676984

在线咨询:点击这里给我发消息

邮件:admin@imhua.com

QR code