Rebuild initrd image

本文档展示了如何在RHEL 8环境中,通过`find`、`cpio`和`xz`命令,以xz压缩格式重新构建initrd镜像。首先切换到`/tmp/custom_initrd`目录,然后执行一系列命令创建新的initrd镜像,并确认新文件的压缩类型为XZ。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[root@rhel-8 rules.d]# cd /tmp/custom_initrd/

[root@rhel-8 custom_initrd]#
Execute the below command to rebuild initrd image with xz as compression format

[root@rhel-8 custom_initrd]# find . 2>/dev/null | cpio -c -o | xz -9 --format=xz > /tmp/new.img
378439 blocks
Check the compression type of your new initrd file

[root@rhel-8 custom_initrd]# ls -l /tmp/new.img
-rw-r–r--. 1 root root 53615972 Sep 13 20:24 /tmp/new.img

[root@rhel-8 custom_initrd]# file /tmp/new.img
/tmp/new.img: XZ compressed data

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值