Write-through (直写模式)
数据同时写如 Cache (缓存) 和硬盘。
优点是:不会出现突然断电掉数据的情况
缺点是:但是写入速度较慢
Write-back (回写模式)
数据先写入 Cache (缓存) ,再从 Cache (缓存) 写入硬盘。
优点是:写入速度较快
缺点是:突然断电存储在 Cache (缓存) 里的数据无法找回
数据同时写如 Cache (缓存) 和硬盘。
优点是:不会出现突然断电掉数据的情况
缺点是:但是写入速度较慢
数据先写入 Cache (缓存) ,再从 Cache (缓存) 写入硬盘。
优点是:写入速度较快
缺点是:突然断电存储在 Cache (缓存) 里的数据无法找回
# yum install yum-utils -y
(注意:这里假设的情况是本系统可以正常使用 YUM 安装软件)
# yumdownloader --resolve --destdir /tmp/ansible ansible
(补充:这里以将 ansible 安装包和 ansible 的依赖包下载到本地的 /tmp/ansible 目录为例)
(
注意:
1) 这里建议直接下载软件名称比如这里的 ansible,而不是下载指定了具体版本的软件,如果下载制定了具体版本的软件,其对应的依赖包可能不会下载下来
2) 这里假设的情况是本系统可以正常使用 YUM 安装软件
)
# yumdownloader --resolve --destdir /tmp/ansible createrepo
(补充:这里以将 createrepo 安装包和 createrepo 的依赖包下载到本地的 /tmp/ansible 目录为例)
(注意:这里假设的情况是本系统可以正常使用 YUM 安装软件)
# cd /tmp/ansible
(补充:这里以进入到目录 /tmp/ansible 为例)
# rpm -ivh createrepo_c & rpm -ivh createrepo_c-libs & rpm -ivh drpm
(
补充:这里安装的软件包有
1) createrepo_c
2) createrepo_c-libs
3) drpm
)
# cd ../
# createrepo ansible
(补充:这里以用 ansible 目录里的软件包创建 YUM 源为例)
# vim /etc/yum.repos.d/ansible.repo
创建以下内容:
[ansible]
name=ansible
baseurl=file:///tmp/ansible
gpgcheck=0
enabled=1
(
补充:这里以
1) 文件名为 ansible
2) 文件标题为 ansible
3) YUM 源的软件包位置在 /tmp/ansible
4) 不进行 gpgcheck 检测
5) 启用此 YUM 源
为例
)
# yum install ansible -y
(补充:这里以安装 ansible 软件为例)
# yum install yum-utils -y
# yumdownloader --resolve --destdir /tmp/ansible ansible
(补充:这里以将 ansible 安装包和 ansible 的依赖包下载到本地的 /tmp/ansible 目录为例)
# tput clear
# tput cols
# tput civis
# tput cnorm
# tput sc
# tput cup 20 30
(补充:这里以将光标跳转到第 20 行的第 30 列为例)
# tput rc
1) 0,黑色
2) 1,蓝色
3) 2,绿色
4) 3,青色
5) 4,红色
6) 5,洋红色
7) 6,黄色
8) 7,白色
# tput setaf 1
(补充:这里以把字体设置成蓝色为例)
# tput setab 4
(补充:这里以把背景设置成红色为例)
# tput setaf setab
(补充:这里以把字体设置成蓝色把背景设置成红色为例)
# tput bold
# tput underline
# tput sc ; tput cup 23 45 ; echo “Output this location is 23/45” ; tput rc
(
补充:
1) 这里的 tput sc 是保存当前的光标位置
2) 这里的 tput cup 23 45 是将光标移动到第 23 行的第 45 列
3) 这里的 echo “Output this location is 23/45” 是输出内容 “Output this location is 23/45”
4) 这里的 tput rc 是将光标回到刚刚保存的光标位置
5)这里以在第 23 行的第 45 列输出信息 “Output this location is 23/45” 为例
)
tput
默认情况下 ReaR 创建的备份只恢复存储的布局和启动加载器,不恢复实际的用户数据和系统文件
# yum install rear
# vim /etc/rear/local.conf
创建以下内容:
......
OUTPUT=ISO
OUTPUT_URL=file:///tmp/rescue_system/
(
补充:这里以
1) 以 ISO 的格式存储备份 (我们可以选择 ISO 格式或 USB 格式,分别用于 ISO 引导或 USB 引导)
2) 将备份存储在本地 /tmp/rescue_system/ 目录为例
)
(
注意:这样的设置会创建 2 个备份文件:
1) 第 1 个配置文件会在用户设置的本地目录 /tmp/rescue_system//rear-localhost.iso 里
2) 第 2 个配置文件会在 Relax-and-Recover (ReaR) 默认的本地目录 /var/lib/rear/output/ 里
)
# vim /etc/rear/local.conf
创建以下内容:
......
OUTPUT=ISO
BACKUP=NETFS
OUTPUT_URL=null
BACKUP_URL="iso:///tmp/rescue_system/"
ISO_DIR="output location"
(
补充:这里以
1) 以 ISO 的格式存储备份 (我们可以选择 ISO 格式或 USB 格式,分别用于 ISO 引导或 USB 引导)
2) 将备份存储在本地 /tmp/rescue_system/ 目录为例
)
# rear -v mkrescue
......
Wrote ISO image: /var/lib/rear/output/rear-rhel8.iso (125M)
Copying resulting files to file location
(
注意:当出现以下内容时,则代表备份成功
……
Wrote ISO image: /var/lib/rear/output/rear-rhel8.iso (125M)
Copying resulting files to file location
)
https://access.redhat.com/documentation/zh-cn/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-relax-and-recover_rear