Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Using a Read-Only Persistence Capability in Knoppix LiveUSBs

  1. #1
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    Using a Read-Only Persistence Capability in Knoppix LiveUSBs

    .
    There is an intriguing comment by Klaus Knopper regarding an otherwise
    little-advertised capability of Knoppix to bring in additional cloop-
    compressed overlays and to combine their contents with that of the master
    KNOPPIX compressed file at boot. Klaus uses this feature to add non-free
    material, which CeBIT is licensed to distribute, to CeBIT versions
    of KNOPPIX liveCDs, LiveDVDs and their isos. This may be found at:
    http://lists.debian.org/debian-knopp.../msg00005.html

    AFAICT, Knoppix can handle, at present, eight overlays,
    KNOPPIX0, KNOPPIX1,...KNOPPIX7. The LiveCD iso has only KNOPPIX, aka
    KNOPPIX0. That leaves, for a LiveCD-sized LiveUSB, KNOPPIX1, KNOPPIX2,
    ...KNOPPIX7 unassigned and available.

    For rather-permanent, unchanging parts of one's persistence, there are
    at least three reasons one might want to utilize some of these unassigned
    overlay positions, assuming one uses a LiveUSB with persistence.
    1. A read-only version of the persistence material is safeguarded
    against inadvertent write-over;
    2 A read-only version may be compressed to 40% its ultimate size after
    boot, with the same scant time penalty with which the master KNOPPIX files
    are brought in; and
    3. A read-only version will decrease the amount of writes associated
    with its contained material over that which would occur if the material
    were both read/write and uncompressed. There is a wear consideration
    peculiar to USB write cycling.

    Prior to Knoppix 7, I had added and/or changed a number of files and
    programs beyond the standard files which come with the standard LiveCD iso.
    With the advent of Knoppix 7.0, I converted these to a cloop-compressed
    KNOPPIX1 and added that alongside the master KNOPPIX file in
    /mnt-system/KNOPPIX/. I have developed a few additonal such additions
    using Knoppix 7 since it first came out. I've recently converted these
    additional changes to KNOPPIX2. I am now looking forward to further
    adapting these efforts to an upcoming Knoppix 7.1. Two Screenshots, mtab
    and df-h illustrate this; see Attached Images below.

    I used a small bash program to facilitate and position the cloop-compressed-
    read-only KNOPPIX1 and KNOPPIX2. The essential part of this program uses
    Klaus K's magic formula, in essence, and for example:
    Code:
    cd /; 
    sudo mkisofs -R -U KNOPPIX-DATA | create_compressed_fs -B 131072 -m - - > /mnt-system/KNOPPIX/KNOPPIX1
    One may account for the content of Knoppix changes in two groups:
    1. The totality of files in /home/knoppix/ plus a small number of
    individual files that may have been changed or added.
    These changes may be recorded with a small bash script, like Keep*.
    These changes may be restored with another small bash script, like Restore*.
    2. The totality of files added via apt or Synaptic, may similarly be
    expressed by another small bash script, like Uncommon.dpkg*.

    *These or similar small programs, may be added to /etc/profile as follows:
    Code:
    Keep() { # Aid to backing-up unique user files
    cd /; KEEP=/mnt-system/keep$(date +"%m%d%H").tar.gz
    echo -e 'Compressing data; patience, this may take a little time..\c'
    tar -cz --exclude *gvfs* --exclude *cache* \
    -f $KEEP home/knoppix/ \
    etc/profile etc/rc.local etc/X11/Xsession.d/45* etc/syslog-knoppix.conf \
    etc/chromium/ mnt-system/boot/syslinux/syslinux.cfg
    echo ".Done."; echo "Restore using the command, tar -xzf '$KEEP' -C /"
    } 
    Restore() { # Restore $PEEK given the date, $1 in %m%d%H format
    PEEK="/mnt-system/keep$1.tar.gz" 
    echo "Restoring '$PEEK files to /."; tar -xzf $PEEK -C /
    } 
    Uncommon.dpkg() { # Packages uncommon to dpkg.current & "dpkg.$1"
    dpkg --get-selections > /tmp/dpkg.current
    comm -3 --nocheck-order /tmp/dpkg.current "dpkg.$1" | less | tee uncommon
    }
    Attached Images Attached Images

  2. #2
    Member Blacksimon's Avatar
    Join Date
    Oct 2011
    Location
    Italy
    Posts
    93
    I think I will use this method with the upcoming knoppix 7.1. Until now I had not really considered this possibility.
    Safe and compress overlay's size sound good.

  3. #3
    Member Blacksimon's Avatar
    Join Date
    Oct 2011
    Location
    Italy
    Posts
    93
    I used this to prevent errors:
    Code:
    cd /
    sudo mkisofs --exclude *gvfs* --exclude *cache* -R -U KNOPPIX-DATA | create_compressed_fs -B 131072 -m - - > /mnt-system/KNOPPIX/KNOPPIX1

  4. #4
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    Greetings, Blacksimon.

    Excluding .gvfs may be a good idea; it may louse up the command.
    This annoying file may or may not be hanging around to cause trouble.
    I suspect it got into my distro when I added a program which uses
    some gnome material. I complained to Klaus K, but he was not
    sympathetic with calling it a bug. Its a feature, apparently.
    An i/o re-direct command might be a more professional way of
    handling the way that .gvfs trips up a command. Maybe some Bash
    expert will suggest something appropriate here.

    FWIW, I think .gvfs trips things up using a console command or as
    part of an /etc/profile function, but as part of an executable shell
    script, I don't think it gives (me) the same trouble. I can't explain
    why this should be the case.

    The only reason to exclude [Cc]ache files is to save the space.
    I don't think they'd cause trouble unless you are a real miser on
    space, like myself.

  5. #5
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    On second thought:

    .
    I get into trouble with .gvfs while in /home/knoppix.
    I usually execute my bash script from a root lxterminal.
    My theory is that /home/knoppix is polluted with .gvfs, while / is not.
    For example, try ls -a | grep .gvfs as root in both places.

  6. #6
    Moderator Moderator
    Join Date
    Nov 2010
    Location
    Germany/ Dietzenbach
    Posts
    1,124
    Excluding .gvfs may be a good idea; it may louse up the command.
    This annoying file may or may not be hanging around to cause trouble.
    '~/.gvfs' isn't a ordinary file; it is the mountpoint for GVFS. Therefore you cannot delete or copy it.

    http://en.wikipedia.org/wiki/GVFS

  7. #7
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    Greetings, Werner, nice to hear from you.

    I've been reading about this (.gvfs) some.

    It turns out, as you say, that .gvfs is a mount point put there by some program,
    possibly LibreOffice, which I use. In my case the .gvfs, as a file, never has any contents;
    it does show up as in an mtab entry related to fuse.

    One post I read suggests unmount and delete and see what happens.
    The notion being is that if some program needs to mount something it will re-
    establish the mount point. I'm trying this route at present.

    FWIW, Ubuntu and others are re-routing this mount point to what we would call /run/knoppix/.gvfs,
    all with no more explanation than for the earlier home directory location.
    Users have been perplexed by .gvfs for as far back as 2008 I've noticed.

  8. #8
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    Result of the experiment, deleting .gvfs in /home/knoppix:

    .
    It turns out that .gvfs is re-established in /home/knoppix within
    a few minutes or hours of normal operation using at most: pcmanfm,
    lxterminal, libreoffice, firefox 19, leafpad and this forum's editor.

    From this I conclude that removing .gvfs probably causes no harm, but also
    solves no problem. Using the exclude option for scripts in /home/knoppix
    will prevent triggering error messages.

    The exclude option may not be necessary for scripts making overlays from
    /KNOPPIX-DATA, if .gvfs is not in this part Knoppix. One may assess the
    situation, for all of Knoppix with the commands: updatedb; locate .gvfs

  9. #9
    Member Blacksimon's Avatar
    Join Date
    Oct 2011
    Location
    Italy
    Posts
    93
    Greetings, Utu.
    in my case:
    options --exclude *gvfs* prevents the error messages to complete KNOPPIX1 creation options --exclude *cache* is to reduce size of KNOPPIX1
    I had already set up by default to move cromium cache, ~/.thumbnails, proxy cache to ramdisk.
    option -iso-level 4 is to prevent file/directory name truncation as you can see at the beginning of the process of mkisofs.

    Code:
    cd /
    sudo mkisofs --exclude *gvfs* --exclude *cache* -iso-level 4 -R -U KNOPPIX-DATA | create_compressed_fs -B 131072 -m - - > /mnt-system/KNOPPIX/KNOPPIX1
    I'm testing KNOPPIX1 without overlay at the moment and everything goes well.
    The size of KNOPPIX1 is only 720MB instead of 3GB overlay (2GB really used)
    With KNOPPIX1 ramdisk is used by default by knoppix

  10. #10
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    Quote Originally Posted by Blacksimon View Post
    option -iso-level 4 is to prevent file/directory name truncation
    Interesting.
    I haven't noticed this as a problem, but I may have just been lucky.

    FWIW, I often write things back to /tmp first just to see how things are turning out.
    Last edited by utu; 03-28-2013 at 09:49 PM.

Page 1 of 3 123 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
  •