前往小程序,Get更优阅读体验!
立即前往
发布
社区首页 >专栏 >centos7单用户模式&bond

centos7单用户模式&bond

原创
作者头像
用户1168904
修改2021-05-21 18:11:00
修改2021-05-21 18:11:00
1.7K0
举报
文章被收录于专栏:运维相关文档运维相关文档

Centos 7 与 Centos 6有很大区别。单用户模式也有所不同

1、开机启动,在grub菜单时按e,进入grub菜单,找到linuxl6 /vmlinuz-3.10行,最后加上init=/bin/sh

2、从新挂载根分区,并设置读写

# mount -o remount,rw /

3、编写pass密码脚本,其中123456为密码

# cat pass.sh

#/bin/sh

LANG=C

passwd << EOF

123456

123456

EOF

# chmod +x pass.sh

#./pass.sh

4、#touch /.autorelabel 如果系统关闭了selinux可不执行这步

5、#exec /sbin/init

双网卡绑定

[monitor@docker37 ~]$ cat /etc/rc.local

#!/bin/bash

# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES

#

# It is highly advisable to create own systemd services or udev rules

# to run scripts during boot instead of using this file.

#

# In contrast to previous versions due to parallel execution during boot

# this script will NOT be run after all other services.

#

# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure

# that this script will be executed during boot.

touch /var/lock/subsys/local

/usr/src/OM/linux/supportscripts/srvadmin-services.sh start

modprobe bonding &> /dev/null

echo +bond0 > /sys/class/net/bonding_masters

ifconfig em1 down

echo +em1 > /sys/class/net/bond0/bonding/slaves

ifconfig em1 up

ifconfig em2 down

echo +em2 > /sys/class/net/bond0/bonding/slaves

ifconfig em2 up

ifconfig bond0 up

[monitor@docker37 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0

BONDING_OPTS="miimon=100 updelay=0 downdelay=0 xmit_hash_policy=layer3+4 mode=802.3ad"

TYPE=Bond

BONDING_MASTER=yes

BOOTPROTO=none

NAME=bond0

ONBOOT=yes

BRIDGE=bridge0

~

[monitor@docker37 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-em1

DEVICE=em1

ONBOOT=yes

BOOTPROTO=none

[monitor@docker37 ~]$ cat /etc/sysconfig/network-scripts/ifcfg-em2

DEVICE=em2

ONBOOT=yes

BOOTPROTO=none

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档