使用squashfs工具解压并创建的 squashfs.img文件

使用squashfs工具解压并创建的 squashfs.img文件

小西飞

文章来自 使用squashfs工具解压并创建的 squashfs.img文件 - 知乎 (zhihu.com)

1.安装工具

[root@localhost ~]# yum install -y squashfs-tools

2.用unsuqashfs命令直接解压缩squashfs.img

[root@localhost ~]# unsquashfs squashfs.img
Parallel unsquashfs: Using 48 processors
1 inodes (16384 blocks) to write

[====================================================================================================================================================================================-] 16384/16384 100%

created 1 files
created 2 directories
created 0 symlinks
created 0 devices
created 0 fifos

3.挂载文件系统

[root@localhost ~]# cd squashfs-root/LiveOS/
[root@localhost LiveOS]# mount rootfs.img /mnt/rootfs/
[root@localhost LiveOS]# ls /mnt/rootfs/
bin  boot  dev  etc  firmware  lib  lib64  lost+found  mnt  modules  proc  root  run  sbin  sys  tmp  usr  var

4.根据需要可以修改/mnt/rootfs目录下文件

5.修改后重新打包

[root@localhost ~]# mksquashfs squashfs-root/ squashfs.img -comp xz -Xbcj x86 -e boot
Parallel mksquashfs: Using 48 processors
Creating 4.0 filesystem on squashfs.img, block size 131072.
[====================================================================================================================================================================================-] 16384/16384 100%

Exportable Squashfs 4.0 filesystem, xz compressed, data block size 131072
        compressed data, compressed metadata, compressed fragments, compressed xattrs
        duplicates are removed
Filesystem size 442739.12 Kbytes (432.36 Mbytes)
        21.11% of uncompressed filesystem size (2097216.44 Kbytes)
Inode table size 23442 bytes (22.89 Kbytes)
        35.69% of uncompressed inode table size (65690 bytes)
Directory table size 58 bytes (0.06 Kbytes)
        100.00% of uncompressed directory table size (58 bytes)
Xattr table size 55 bytes (0.05 Kbytes)
        100.00% of uncompressed xattr table size (55 bytes)
Number of duplicate files found 0
Number of inodes 3
Number of files 1
Number of fragments 0
Number of symbolic links  0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 2
Number of ids (unique uids + gids) 1
Number of uids 1
        root (0)
Number of gids 1
        root (0)
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值