[个人笔记] CentOS Stream 9 笔记_2022-11.sh

wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh

mkdir /www&&mount /dev/vdb1 /www

free -h

cat /proc/sys/vm/swappiness //swap文件优先级,0~100,0代表优先使用系统内存,100代表优先使用swap

cat /etc/fstab

more /etc/redhat-release 

cat /proc/meminfo|grep -i swap

swapon -s
swapoff -a
mkswap --help

dmsetup ls
dmsetup info

lsblk

lvscan
lvdisplay
lvresize -L 几或+/-几G /dev/cs_c20221113194938/root

hostnamectl set-hostname node1
hostname

grub2-install /dev/sda
grub2-mkconfig -o /boot/grub2/grub.cfg

新的网卡管理服务netmanager

firewall-cmd --permanent --add-port=8050/tcp

//CentOS旧版本更新repo文件
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.epel.cloud|g' /etc/yum.repos.d/CentOS-*.repo
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*.repo
yum makecache
yum install -y wget vim
yum update -y

重装成CentOS Stream 9的命令:.

  1. 向原始系统(CentOS-8.1)发送命令
//CentOS旧版本更新repo文件 及 安装Grub2
cat /etc/redhat-release
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.epel.cloud|g' /etc/yum.repos.d/CentOS-*.repo
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*.repo
yum makecache
yum install grub2* -y
yum install vim -y

        2.Grub2配置(使用在线Repo启动,Vmware上成功启动): 

    set timeout=1
    set default='CentOS Stream 9 DVD Install'
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod ext4
    insmod video_cirrus
    set root=(hd1,1)

  menuentry 'CentOS Stream 9 DVD Install' --class fedora --class gnu-linux --class gnu --class os {
   insmod iso9660
   insmod loopback
   set iso_path="/iso/CentOS-Stream-9-20230410.0-x86_64-dvd1.iso"
   loopback loop $iso_path
   linux (loop)/isolinux/vmlinuz inst.vnc inst.vncpassword=xFe3x783 ip=dhcp inst.repo=http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os quiet
   initrd (loop)/isolinux/initrd.img
}

# 该文件为阿里云Centos8的repo,应存放在/etc/yum.repos.d/的CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
 
[PowerTools]
name=CentOS-$releasever - PowerTools - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/PowerTools/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official


[AppStream]
name=CentOS-$releasever - AppStream - mirrors.aliyun.com
#failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/AppStream/$basearch/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值