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的命令:.
- 向原始系统(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