11
2024
06
16:39:36

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



推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

1.安装工具

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

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

[root@localhost ~]# unsquashfs squashfs.imgParallel unsquashfs: Using 48 processors1 inodes (16384 blocks) to write[====================================================================================================================================================================================-] 16384/16384 100%

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

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)


本文链接:http://hqyman.cn/post/6582.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下~~


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: