Page 1 of 2 12 LastLast
Results 1 to 10 of 41

Thread: Squashfs-ed knoppix

Hybrid View

  1. #1
    Senior Member registered user
    Join Date
    Dec 2009
    Posts
    423
    As you have noticed, I tried out the idea of squashfs. Eversince, I have been using it without a single problem. There is actually no downside, but there are a few ( perhaps not very significant ) upsides. For summary, they are :-

    1. stock kernel module (vs patched module ).
    2. less virtual memory required.
    3. slightly better compression.

    To create the compress image, this is what I use :-
    Code:
    mksquashfs /mnt/knx/source/KNOPPIX /mnt/knx/master/KNOPPIX/KNOPPIX.sq -b 262144 -noappend
    For comparison, this is what I use for cloop image :-
    Code:
    mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "KNOPPIX www.knoppix.net" \
    -hide-rr-moved -cache-inodes -pad /mnt/knx/source/KNOPPIX \
     | nice -5 /usr/bin/create_compressed_fs - 262144 > /mnt/knx/master/KNOPPIX/KNOPPIX
    You notice that for both cases, I don't sort the files according to 'frequent use', but that does not mean it is not important. I just don't bother to do it.

    Last but not least, I have modified the initrd.gz to mount squashfs accordingly :-

    Code:
    indknoppix(){
     local dev
     for dev in "$@"; do
      [ -b "$dev" ] || continue
      message -n -e "\r${CRE}${BLUE}${SEARCHINGFOR} $DISTRO in: ${MAGENTA}$dev${NORMAL}   "
      trymount "$dev" /mnt-system >/dev/null 2>&1 || continue
      if [ -r /mnt-system/"$knoppix_dir"/KNOPPIX -o -r /mnt-system/"$knoppix_dir"/KNOPPIX.sq ]; then
       message -e "\r${CRE}${GREEN}$DISTRO ${FOUNDAT}: ${MAGENTA}$dev${NORMAL}       "
       return 0
      fi
      umount /mnt-system
     done
     return 1
    }
    ....
    mountknoppix(){
     local k dev dir count=0 RC=0
     [ -b /dev/cloop ] || mknod m 644 /dev/cloop b 240 0
     [ -f /mnt-system/"$knoppix_dir"/modules/squashfs.ko ] && \
       insmod /mnt-system/"$knoppix_dir"/modules/squashfs.ko
     [ -d /sys/module/cloop ] || insmod /mnt-system/"$knoppix_dir"/modules/cloop.ko preload=32 || return 2
     [ -d /sys/module/aufs ]  || insmod /mnt-system/"$knoppix_dir"/modules/aufs.ko || return 3
     if checkbootparam squashfs && [ -f /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx].[Ss][Qq] ]
     then 
       mount -o loop=/dev/loop1 /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx].sq /KNOPPIX
     elif [ -f /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx].[Ss][Qq] -a \
       ! -f /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx] ]
     then
       mount -o loop=/dev/loop1 /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx].sq /KNOPPIX
     else
     for k in /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx] \
              /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx][0-9]; do
      .....
    I retained the cloop booting capability for comparison purposes. When both images are present, I use a cheatcode to select the preferred one. It was kind of elaborate but now I can safely say, it is unnecessary to retain the cloop image at all.

    Have fun.

  2. #2
    Senior Member
    Join Date
    Jan 2011
    Posts
    123
    I have tried myself to squashfs my knoppix cd install on usb and created knoppix.sq but I do not have inirt.gz but a look at syslinux.cfg learned that it used minirt.gz.
    I modified that the way you did in the above post but I somehow messed up pretty badly.
    first there was a syntax error while booting so I reedited the init script and now it's completely screwed up

    is someone so kind to share their (m)inirt.gz with me?

  3. #3
    Senior Member
    Join Date
    Jan 2011
    Posts
    242
    Quote Originally Posted by dinosoep View Post
    is someone so kind to share their (m)inirt.gz with me?
    Do you still have available
    a) a working Linux and
    b) Knoppix on the CD you used to install to USB in the first place ?

    If so, pop the CD in and mount it under /media/sr0. You should find what you are looking for under /media/sr0/boot/syslinux/minirt.gz.

    If the Linux you are running is the Knoppix on you CD, then the CD is already mounted so look under /mnt-system/boot/syslinux/minirt.gz.

    Quote Originally Posted by dinosoep View Post
    in the above post
    Which post ?

  4. #4
    Senior Member
    Join Date
    Jan 2011
    Posts
    123
    forester, look at the previous page of this forum
    yes I have still a working linux install and the original iso file. I want however the modified version that uses squashfs instead of cloop

  5. #5
    Senior Member registered user
    Join Date
    Dec 2009
    Posts
    423
    Quote Originally Posted by dinosoep View Post
    forester, look at the previous page of this forum
    yes I have still a working linux install and the original iso file. I want however the modified version that uses squashfs instead of cloop
    Try this :-

    http://www.fileserve.com/file/s9TyZW8

    The said file is modified from some older version of Knoppix - for my own use - so I do not claim its suitability for general use. I also have other mods for other reasons which you might want to ignore.

  6. #6
    Senior Member
    Join Date
    Jan 2011
    Posts
    123
    kl522, I saw your post a little to late.
    I've been messing around with minirt.gz and I now have a "working" version for 6.4.3
    my mountknoppix is now:
    Code:
    mountknoppix(){
    local k dev dir count=0 RC=0
     [ -b /dev/cloop ] || mknod m 644 /dev/cloop b 240 0
     grep -q squashfs  /proc/filesystems || insmod /mnt-system/"$knoppix_dir"/modules/squashfs.ko || return 4
    grep -q cloop /proc/devices     || insmod /mnt-system/"$knoppix_dir"/modules/cloop.ko preload=32 || return 2
     grep -q aufs  /proc/filesystems || insmod /mnt-system/"$knoppix_dir"/modules/aufs.ko || return 3
    
     if checkbootparam squashfs && [ -f /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx].[Ss][Qq] ]
     then 
       mount -o loop=/dev/loop1 /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx].sq /KNOPPIX
     elif [ -f /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx].[Ss][Qq] -a \
       ! -f /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx] ]
     then
       mount -o loop=/dev/loop1 /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx].sq /KNOPPIX
     else
     for k in /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx] \
              /mnt-system/"$knoppix_dir"/[Kk][Nn][Oo][Pp][Pp][Ii][Xx][0-9]; do
      [ -r "$k" ] || continue
      check_knoppix "$k"
      if [ $count = 0 ]; then
       dev=/dev/cloop ; dir=/KNOPPIX
      else
       dev=/dev/cloop$count ; dir=/KNOPPIX$count
       [ -b $dev ] || mknod -m 644 $dev b 240 $count
       [ -d $dir ] || mkdir -m 755 $dir
      fi
      if ! losetup $dev $k >/dev/null 2>&1 || ! mount -r -t iso9660 $dev $dir >/dev/null 2>&1; then
       # Verbose error message
       echo -n -e "\n\r${RED}${BROKENIMAGE}: $k ${ON} "; mount | grep /mnt-system; dmesg | tail | grep cloop; echo -n "${NORMAL}"
       # Clean up for next retry
       for dev in /dev/cloop*; do
        umount -f "$dev" >/dev/null 2>&1
        losetup -d "$dev" >/dev/null 2>&1
       done
       return 4
      fi
      let count++
     done
    fi
     return 0
    }
    I'll see how long it'll run and if there turns out to be some problems I'm going to use your older version kl522

  7. #7
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    @ kl522
    Great thread. Subscribing.

  8. #8
    Senior Member
    Join Date
    Jan 2011
    Posts
    242
    Quote Originally Posted by dinosoep View Post
    forester, look at the previous page of this forum
    Sorry, my mistake. With you now. Interesting thread. Will subscribe too.

    Pity the FAQ on the finix site seems to have disappeared. (Post #2, this thread).

    Puzzled by the early assertions about virtual memory size. I don't see how that can be deduced from the output of df -h. That reports the file system size, how much is used and how much is free. Nothing, as far as I know, about virtual memory sizes. One has to be careful with these figures when it comes to compressed file systems. It seems cloop reports the size of the file system before compression, squashfs after compression.

  9. #9
    Member registered user
    Join Date
    Sep 2005
    Posts
    36
    Quote Originally Posted by kl522 View Post
    Code:
    mksquashfs /mnt/knx/source/KNOPPIX /mnt/knx/master/KNOPPIX/KNOPPIX.sq -b 262144 -noappend
    ...
    Quote Originally Posted by kl522 View Post
    Code:
    mkisofs -R -U -V "KNOPPIX.net filesystem" -publisher "KNOPPIX www.knoppix.net" \
    -hide-rr-moved -cache-inodes -pad /mnt/knx/source/KNOPPIX \
     | nice -5 /usr/bin/create_compressed_fs - 262144 > /mnt/knx/master/KNOPPIX/KNOPPIX
    Well, this already shows the fundamental difference: SquashFS is a filesystem on its own, it reads a directory structure with a bunch of files from someplace and compresses them while putting them into a container.

    Cloop, on the other hand, does not care about the underlying filesystem. It provides a sort of "compressing shell" around anything that is thrown at it. It could even be a cpio archive or a tar file.

    With cloop you could do the following:
    - Make a full bitwise backup copy of any partition, including boot sector and whatnot, using dd.
    - After compressing it with cloop, you get a rather small image that provides read access while "staying compressed" and still contains everything the original partition did, true to the bit.

    You cannot do that with sqashfs, you only get the part that is underlined above. The italic part will never be possible with sqashfs.

    It could be arguable whether the possibility to have a bit-copy of the original filesystem at hand has any value in the use case of a live-CD/DVD. Maybe not. But I believe that cloop has some value above that: It is a general compressor/decompressor and, in the special case of a mountable filesystem, provides read access to the compressed thing (plus providing write protection by design).

    Therefore, for me it would be a major pity to drop cloop altogether.

    Have fun
    Dirk
    Last edited by DirkS; 04-15-2011 at 11:10 PM.

  10. #10
    Senior Member registered user
    Join Date
    Dec 2009
    Posts
    423
    Quote Originally Posted by DirkS View Post
    It could be arguable whether the possibility to have a bit-copy of the original filesystem at hand has any value in the use case of a live-CD/DVD. Maybe not. But I believe that ....
    You are not even convinced yourself and yet you are trying to convince us. And finally you use the word 'believe' .....

    You should give us an example of what you described is useful in the context of a live-CD/DVD which the purpose is to squeeze has many programs as possible into the distro.
    And that better be something cannot be done by squashfs.

    And finally I said before, if Klaus is serious about wanting to continue to use cloop, he should work on including his patch into the mainstream kernel.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


HyperX FURY DDR4 64GB (4x16GB) 3200MHz PC4-25600 Desktop RAM Memory DIMM 288PIN picture

HyperX FURY DDR4 64GB (4x16GB) 3200MHz PC4-25600 Desktop RAM Memory DIMM 288PIN

$129.95



A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G picture

A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G

$13.99



Team T-FORCE VULCAN Z 32GB (2 x 16GB) PC RAM DDR4 3200 (PC4 25600) Memory picture

Team T-FORCE VULCAN Z 32GB (2 x 16GB) PC RAM DDR4 3200 (PC4 25600) Memory

$54.99



128GB SAMSUNG (4 X 32GB) 2Rx4 PC4-2400T DDR4 ECC REGISTERED SERVER RAM picture

128GB SAMSUNG (4 X 32GB) 2Rx4 PC4-2400T DDR4 ECC REGISTERED SERVER RAM

$129.95



A-Tech 8GB PC3-12800 Desktop DDR3 1600 MHz Non ECC 240-Pin DIMM Memory RAM 1x 8G picture

A-Tech 8GB PC3-12800 Desktop DDR3 1600 MHz Non ECC 240-Pin DIMM Memory RAM 1x 8G

$13.99



HyperX FURY DDR3 8GB 16GB 32GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pin picture

HyperX FURY DDR3 8GB 16GB 32GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pin

$15.90



Crucial DDR3L 16GB 1600 2x 8GB PC3-12800 Laptop SODIMM Memory RAM PC3 16G DDR3 picture

Crucial DDR3L 16GB 1600 2x 8GB PC3-12800 Laptop SODIMM Memory RAM PC3 16G DDR3

$22.45



Team T-FORCE VULCAN Z 16GB (2 x 8GB) 288-Pin PC RAM DDR4 3200 (PC4 25600) Intel picture

Team T-FORCE VULCAN Z 16GB (2 x 8GB) 288-Pin PC RAM DDR4 3200 (PC4 25600) Intel

$33.99



128GB Kit 4x 32GB PC4-17000 LRDIMM DELL POWEREDGE R730xd R730 R630 Memory RAM picture

128GB Kit 4x 32GB PC4-17000 LRDIMM DELL POWEREDGE R730xd R730 R630 Memory RAM

$139.96



HYNIX HMT31GR7BFR4C-H9 8GB PC3-10600R DDR3-1333MHZ 2Rx4 (LOT OF 8) DRAT-3 picture

HYNIX HMT31GR7BFR4C-H9 8GB PC3-10600R DDR3-1333MHZ 2Rx4 (LOT OF 8) DRAT-3

$40.00