Sie sind auf Seite 1von 4

OESF Portal Help Search Members Calendar

Options
Feb 1 2007, 02:49 PM
Welcome Guest ( Log In | Register )
OESF Forums > General Forums > General Support and Discussion > Software
How To: Create And Mount A Squashfs Image
Snappy Post #1
Group: Members
Posts: 793
Joined: 28-November 04
From: NM, US, sometimes Asia
Member No.: 5,633
Hi all,
I didn't really see a squashfs tutorial thread on the forum, so I thought I'll do one.
wink.gif
Most of the info is available from mksquashfs --help but I also gleaned from
http://www.artemio.net/projects/linuxdoc/s...ml#mksqoverview
For what squashfs is about and why you might want to use it, see the next post.
smile.gif
1. Install mksquashfs if it's not installed already.
2. Create a mksquashfs image
eg, you want to create an image based on a directory 'myfiles'
CODE
$ mksquashfs myfiles/ myfiles.squashfs
Creating little endian 2.1 filesystem on ati.squashfs, block size
65536.
Little endian filesystem, data block size 65536, compressed data,
compressed metadata, compressed fragments
Filesystem size 12785.03 Kbytes (12.49 Mbytes) 27.52% of
uncompressed filesystem size (46448.82 Kbytes)
Inode table size 17172 bytes (16.77 Kbytes) 33.86% of
uncompressed inode table size (50709 bytes)
Directory table size 13324 bytes (13.01 Kbytes) 35.20% of
uncompressed directory table size (37853 bytes)
Number of duplicate files found 4
Number of inodes 2118
Number of files 1889
Number of fragments 400
OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio
How To: Create And Mount A Squashfs Image - OESF F... http://www.oesf.org/forum/index.php?showtopic=23149
1 of 4 26/02/2012 07:57
Feb 1 2007, 03:00 PM
Feb 14 2007, 03:46 PM
Number of symbolic links 0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 229
Number of uids 1 root (0)
Number of gids 0
If yours went through, you should get an image file myfiles.squashfs.
3. Mount the image
CODE
# mkdir /mnt/mydir
# mount myfiles.sqsh /mnt/mydir -t squashfs -o loop
That's it! Now when you look into /mnt/mydir, you should see the original directory
structure with files in it.
smile.gif
For more on loop devices, you can refer to meanie's site or search google.
TIP: Meanie's pdaXqtrom for cacko creates additional loop devices.
Snappy Post #2
Group: Members
Posts: 793
Joined: 28-November 04
From: NM, US, sometimes Asia
Member No.: 5,633
Squashfs simply allows you to create an image for a whole directory, partition or
filesystem into an image, partition or filesystem. The example above compresses a
whole directory into a single read-only image file. This image is then mounted and
the files and directory structure can be accessed directly as before.
The advantage (for me anyway) is that a lot of space is saved! In my case, the
original directory was 40+mb, while the image was 12mb!
YMMV, so if your files can benefit from compression and are not changed often, and
you don't need to modify the files, then squashfs may be for you.
speculatrix Post #3
thanks for this. I started writing up a quick guide on my website to document how I
did the oesf forum archive.
How To: Create And Mount A Squashfs Image - OESF F... http://www.oesf.org/forum/index.php?showtopic=23149
2 of 4 26/02/2012 07:57
Feb 14 2007, 04:25 PM
Feb 28 2007, 05:59 PM
Group: Admin
Posts: 3,276
Joined: 29-July 04
From: Cambridge, England
Member No.: 4,149
Snappy Post #4
Group: Members
Posts: 793
Joined: 28-November 04
From: NM, US, sometimes Asia
Member No.: 5,633
QUOTE(speculatrix @ Feb 15 2007, 07:46 AM)
thanks for this. I started writing up a quick guide on my website to document how
I did the oesf forum archive.
Great!
biggrin.gif
Was looking around as well for RW compressed format and found that jffs3 or
something provides journalling and compression in RW format. Wonder if anyone
tried that?
smile.gif
Meanie Post #5
Group: Members
Posts: 2,807
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686
QUOTE(Snappy @ Feb 15 2007, 10:25 AM)
QUOTE(speculatrix @ Feb 15 2007, 07:46 AM)
thanks for this. I started writing up a quick guide on my website to document
how I did the oesf forum archive.
Great!
biggrin.gif
Was looking around as well for RW compressed format and found that jffs3 or
something provides journalling and compression in RW format. Wonder if anything
tried that?
smile.gif
jffs2 is what is used on the NAND afaik, jffs2/jffs3 can only be installed on a device
like the NAND....
How To: Create And Mount A Squashfs Image - OESF F... http://www.oesf.org/forum/index.php?showtopic=23149
3 of 4 26/02/2012 07:57
Mar 2 2007, 03:30 PM
Mar 4 2007, 04:30 PM
Next Oldest Software Next Newest
speculatrix Post #6
Group: Admin
Posts: 3,276
Joined: 29-July 04
From: Cambridge, England
Member No.: 4,149
I imagine you can do a loopback mount of jffsX images as well, however, it's probably
not the best way to use them, they're designed specifically for putting directly onto
flash block devices to level wear and recover from bad blocks?
Snappy Post #7
Group: Members
Posts: 793
Joined: 28-November 04
From: NM, US, sometimes Asia
Member No.: 5,633
hmmm ... guess have to keep looking ...
Makes me miss doublespace and stacker ... for those who still recall those 'huge'
40mb hdd in DOS days!
wink.gif
Enter Keywords

Search Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Forum Home Go
Lo-Fi Version Time is now: 26th February 2012 - 09:56 AM
Powered By IP.Board 2012 IPS, Inc.
Licensed to: Roy El-Rayes, oesf.org
How To: Create And Mount A Squashfs Image - OESF F... http://www.oesf.org/forum/index.php?showtopic=23149
4 of 4 26/02/2012 07:57

Das könnte Ihnen auch gefallen