Chinaunix首页 | 论坛 | 博客
  • 博客访问: 551031
  • 博文数量: 116
  • 博客积分: 2063
  • 博客等级: 大尉
  • 技术积分: 1174
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-26 16:44
个人简介

none

文章分类

全部博文(116)

文章存档

2023年(2)

2020年(3)

2019年(4)

2018年(7)

2017年(6)

2016年(17)

2015年(13)

2014年(19)

2013年(6)

2012年(13)

2011年(5)

2010年(11)

2008年(10)

分类: LINUX

2015-11-06 11:40:58

From  

1、普通squashfs文件解压缩及查看

  (1) 可使用unsuqashfs命令直接解压缩。

   [root@localhost squashfs]# unsquashfs squashfs.img

 (2)也可mount到临时目录

  [root@localhost squashfs]# mount -o loop squashfs.img -t squashfs temp/

2、XZ算法压缩后的squashfs.img解压缩与查看

  下载Fedora 15 Live CD后,尝试解压缩ISO中的squashfs.img文件,发现无法mount,也无法通过unsquashfs命令解压缩。提示“Filesystem uses xz compression, this is unsupported by this version”。但下载到的最新squashfs 4.2版本,提示XZ压缩算法的。

[root@localhost ~]# mount -o loop /boot/Fedora-15-x86_64-Live-Desktop.iso /mnt/

[root@localhost ~]# ls /mnt/

EFI  GPL  isolinux  LiveOS

[root@localhost ~]# cd /mnt/LiveOS/

[root@localhost LiveOS]# ls

livecd-iso-to-disk  osmin.img  squashfs.img

[root@localhost squashfs]# file squashfs.img

squashfs.img: Squashfs filesystem, little endian, version 4.0, 578519788 bytes, 3 inodes, blocksize: 131072 bytes, created: Fri May 13 15:49:05 2011

[root@localhost squashfs]# mount -o loop squashfs.img -t squashfs temp/

mount: wrong fs type, bad option, bad superblock on /dev/loop1,

missing codepage or helper program, or other error

In some cases useful info is found in syslog – try

dmesg | tail  or so

[root@localhost squashfs]#

[root@localhost squashfs]# unsquashfs squashfs.img

Filesystem uses xz compression, this is unsupported by this version

Decompressors available:

gzip

下载最新的squashfs工具,发现Makefile有个选项,“#XZ_SUPPORT = 1”,选择打开XZ_SUPPORT=1,保存退出。重新编译后,就可以解压缩使用XZ算法压缩的squashfs.img文件了。

[root@localhost squashfs]#

########### Building XZ support #############

#

# LZMA2 compression.

#

# XZ Utils liblzma () is supported

#

# To build using XZ Utils liblzma – install the library and uncomment

# the XZ_SUPPORT line below.

#

#XZ_SUPPORT = 1

[root@localhost squashfs-tools]# make clean && make && make install

[root@localhost squashfs]#

[root@localhost squashfs]# unsquashfs squashfs.img

Parallel unsquashfs: Using 16 processors

1 inodes (32768 blocks) to write

[= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = /] 32768/32768 100%

created 1 files

created 2 directories

created 0 symlinks

created 0 devices

created 0 fifos

阅读(6092) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

k_ewell2015-11-06 12:05:44

[root@localhost XM]# ./unsquashfs -version
unsquashfs version 4.3 (2014/05/12)
copyright (C) 2014 Phillip Lougher <phillip@squashfs.org.uk>

Decompressors available:
        gzip
        xz

k_ewell2015-11-06 11:45:16

# LZMA2 compression.
#
# XZ Utils liblzma (http://tukaani.org/xz/) is supported
#
# To build using XZ Utils liblzma - install the library and uncomment
# the XZ_SUPPORT line below.
#
XZ_SUPPORT = 1 

# To build using XZ Utils liblzma - install the library and uncomment
# the LZMA_XZ_SUPPORT line below.
#
# To buil