【20231214】银河麒麟系统(5.4.18-52-generic)ghost镜像还原失败问题

【20231214】银河麒麟系统(5.4.18-52-generic)ghost镜像还原失败问题

0 前言

转载请附上原文出处链接

稀土掘金本文链接:https://juejin.cn/post/7321586653113827362

CSDN本文链接:https://blog.csdn.net/qq_43252610/article/details/135471948

1 问题概述

1.1 基础环境

【问题发生时间】20231214

【系统】5.4.18-52-generic

【CPU】飞腾D2000/8

【显卡】JH920

【驱动版本】1.4.2

1.2 问题现象

计算机A

使用从Live安装,系统安装完毕后,安装相关业务软件,备份,制作ghost1

计算机B

使用从Ghost安装,使用ghost1安装系统,系统安装失败,多次尝试发现必现。

安装失败显示如下

2 问题定位

2.1 日志分析

麒麟系统安装工具的日志位于/var/log/installer/

其中有三个文件:kylin-os-installer.logkylin-os-installer_2023-12-14.logrunscripcommand.log

记录错误信息的日志为:kylin-os-installer.log

下面是错误的部分,执行rsync -aHAX /rofs/ /target命令时出现了错误

++ rsync -aHAX /rofs/ /target
rsync: rsync_xal_set: lsetxattr("/target/boot/efi","security.boxadm") failed: Operation not supported (95)
rsync: rsync_xal_set: lsetxattr("/target/boot/efi","security.kysec") failed: Operation not supported (95)
rsync: rsync_xal_set: lsetxattr("/target/boot/efi/EFI","security.boxadm") failed: Operation not supported (95)
rsync: rsync_xal_set: lsetxattr("/target/boot/efi/EFI","security.kysec") failed: Operation not supported (95)
rsync: rsync_xal_set: lsetxattr("/target/boot/efi/EFI/BOOT","security.boxadm") failed: Operation not supported (95)
rsync: rsync_xal_set: lsetxattr("/target/boot/efi/EFI/BOOT","security.kysec") failed: Operation not supported (95)

failed: Operation not supported (95),不支持的操作?难道是kyimg文件损坏了?

核对生成的ghost文件的md5码,发现拷贝出来的文件未损坏。

md5sum kylin-kylin-aarch64-231214093218.kyimg

银河麒麟的同系列系统除了该款系统,还有一个高版本的系统:5.4.18-65-generic

且银河麒麟支持使用其他支持ghost安装的高版本银河麒麟系统进行引导,还原ghost镜像。

2.2 2207系统验证

使用2207系统引导,还原ghost1。能够正常还原。

同样看一下日志:kylin-os-installer.log

执行rsync -aHAX /rofs/ /target命令完全正常,后续步骤也完全正常。

++ rsync -aHAX /rofs/ /target
++ msg 文件系统拷贝完成
+++ date '+%Y-%m-%d %H:%M:%S'
++ echo '2023-12-14 11:29:45 文件系统拷贝完成'

那说明ghost1kyimg文件是正常的。

2.3 rsync工具

根据日志的打印,报错的是rsync工具

对比两个系统之间rsync工具的版本

2205

rsync --version

rsync  version 3.1.3  protocol version 31
Copyright (C) 1996-2018 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, prealloc

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

2207

rsync --version

rsync  version 3.1.3  protocol version 31
Copyright (C) 1996-2018 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, prealloc

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

完全一致????都是3.1.3

dpkg看一下包的版本

2205

dpkg -l | grep rsync

ii  rsync                                                 3.1.3-8kylin1k3                    arm64        fast, versatile, remote (and local) file-copying tool

2207

dpkg -l | grep rsync

ii  rsync                                                 3.1.3-8kylin1k4                    arm64        fast, versatile, remote (and local) file-copying tool

版本存在差别,2205系统用的是3.1.3-8kylin1k32207系统用的是3.1.3-8kylin1k4

确认版本存在差距,那么在2205系统上升级rsync的包,看ghost安装是否还会存在问题。

升级rsync

sudo dpkg -i rsync_3.1.3-8kylin1k4_arm64.deb

(正在读取数据库 ... 系统当前共安装有 208065 个文件和目录。)
准备解压 rsync_3.1.3-8kylin1k4_arm64.deb  ...
正在解压 rsync (3.1.3-8kylin1k4) 并覆盖 (3.1.3-8kylin1k3) ...
正在设置 rsync (3.1.3-8kylin1k4) ...
正在处理用于 systemd (245.4-4kylin3.11k18) 的触发器 ...
正在处理用于 man-db (2.9.1-1kylin0k1) 的触发器 ...

升级后可以正常安装,确认是rsync工具问题导致2205系统ghost镜像还原失败。

3 机理分析

首先从下面的错误打印进行分析

++ rsync -aHAX /rofs/ /target
rsync: rsync_xal_set: lsetxattr("/target/boot/efi","security.boxadm") failed: Operation not supported (95)
rsync: rsync_xal_set: lsetxattr("/target/boot/efi","security.kysec") failed: Operation not supported (95)
rsync: rsync_xal_set: lsetxattr("/target/boot/efi/EFI","security.boxadm") failed: Operation not supported (95)
rsync: rsync_xal_set: lsetxattr("/target/boot/efi/EFI","security.kysec") failed: Operation not supported (95)
rsync: rsync_xal_set: lsetxattr("/target/boot/efi/EFI/BOOT","security.boxadm") failed: Operation not supported (95)
rsync: rsync_xal_set: lsetxattr("/target/boot/efi/EFI/BOOT","security.kysec") failed: Operation not supported (95)

lsetxattr用于设置文件扩展属性的值,扩展属性是ext4文件系统中的一个特性,详细介绍可以查看下面链接中的内容:

lsetxattr介绍-中文:https://www.onitroad.com/jc/linux/man-pages/linux/man2/lsetxattr.2.html

lsetxattr介绍-英文:https://www.man7.org/linux/man-pages/man2/listxattr.2.html

attr介绍-中文:https://www.onitroad.com/jc/linux/man-pages/linux/man7/xattr.7.html

attr介绍-英文:https://www.man7.org/linux/man-pages/man7/xattr.7.html

not supported的类型为security.boxadmsecurity.kysec

security是安全模块

kysec明显是银河麒麟特有的类型,怀疑是银河麒麟在这个版本rsync工具中未能正确支持

既然已经知道3.1.3-8kylin1k4版本的sync工具能够正常使用,那么直接解包对比下

dpkg -x rsync_3.1.3-8kylin1k3_arm64.deb rsync_3

dpkg -x rsync_3.1.3-8kylin1k4_arm64.deb rsync_4

对比解包后的文件,rsync二进制文件变化,changelog有改动

根据changelog记录,3.1.3-8kylin1k4正是修复了该问题

rsync (3.1.3-8kylin1k4) v101; urgency=medium

  * filter operation not supported error for setxattr

 -- yangzhao <yangzhao@kylinos.cn>  Thu, 14 Oct 2021 11:33:56 +0800

由于该软件包麒麟相关的修改闭源,无法知晓整个修改的核心原因。

4 解决措施

使用2205系统安装系统时,需要在引导系统中升级rsync3.1.3-8kylin1k4

5 举一反三

对比版本时,除了工具自带的版本打印命令,也需要注意软件包的版本

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值