Skip to Content
Linux Shell Scripting Cookbook - Third Edition
book

Linux Shell Scripting Cookbook - Third Edition

by Clif Flynt, Sarath Lakshman, Shantanu Tushar
May 2017
Beginner
552 pages
28h 47m
English
Packt Publishing
Content preview from Linux Shell Scripting Cookbook - Third Edition

How to do it...

  1. Create a squashfs file by adding source directories and files with the mksquashfs command:
        $ mksquashfs SOURCES compressedfs.squashfs

Sources can be wildcards, files, or folder paths.

Consider this example:

        $ sudo mksquashfs /etc test.squashfs
        Parallel mksquashfs: Using 2 processors
        Creating 4.0 filesystem on test.squashfs, block size 131072.
        [=======================================] 1867/1867 100%  
More details will be printed on the terminal. The output is stripped to save space.
  1. To mount the squashfs file to a mount point, use loopback mounting, as follows:
        # mkdir /mnt/squash
        # mount -o loop compressedfs.squashfs /mnt/squash

You can access the contents at /mnt/squashfs.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Shell Scripting - Second Edition

Mastering Linux Shell Scripting - Second Edition

Mokhtar Ebrahim, Andrew Mallett

Publisher Resources

ISBN: 9781785881985