Ramdisk and partial remastering in Knoppix 7
.
Another un-advertised new feature in Knoppix 7
Klaus K has included a new 'ramdisk' element in Knoppix 7 for serial
collection of LiveUSB program changes that may be individually compacted
which may then be expanded and added in overlay fashion to the basic
operating system at boot.
A brief description of the use 'ramdisk' to achieve an alternative to
wholesale re-mastering occurs on debian-knoppix at:
http://lists.debian.org/debian-knopp.../msg00005.html
A progress report on my ramdisk experience
.
First, a historic note:
In post #1 I called some attention to Klaus K's recent murmurings about using
'ramdisk' as an alternative to some of the more recent re-mastering schemes that
use lots of resources and time.
You may be interested to know this is not something new or even new to Knoppix.
Just take a look at:
http://www.oreillynet.com/sysadmin/b...s_wow_jus.html
Now, for something closer to home:
In posts elsewhere on this forum I have touted a little scheme of I think-of as
'partial backups'. I try to keep track of the tweaks I use and where they go, so
I can collect these in a file update*.tar.gz. I then use the cheatcode note about
how to get this file overlaid on KNOPPIX-DATA and become a part of
knoppix-data.img. I've used this all through Knoppix 6 to back-up my LiveUSB when
I ruin my knoppix-data.img by some inadvertent mistake. Maybe a little clumsy, but
it serves the purpose. my tweaks in update*.tar.gz amount to about 50 Mb which
I store on /mnt-system/ in-between uses.
It turns out, I can read this 50 Mb update*.tar.gz into the Knoppix 7 ramdisk and
produce an equivalent 30 Mb KNOPPIX1. I have to do some juggling with reboots
and using the knoppix noimage cheatcode to accomplish this, but it works.
There are two hidden bonuses in this approach. First, you needn't be very
fastidious about noting your tweaks and where they go. Ramdisk does this for you.
It only retains the directories, and contents thereof it needs to record differences
from an initial compressed image. Second, after all the manipulations you may
once again re-install a persistence file to record retain any additional
changes you might decide to investigate on a more tentative basis than the
ramdisk approach.
You don't need a second system to accomplish all this. I bootstrapped my 8 Gb
Knoppix 7.0.2 LiveUSB from an update*.tar.gz state to a ramdisk-modified version
with persistence using only two special commands and the cheatcode 'knoppix noimage'.
A second system would be a good idea as a backup, but this is just to let you
know it's possible to do without.
The two commands that are crucial are: To transfer update*.tar.gz to /ramdisk/;
Code:
sudo tar -xzf /mnt-system/update*.tar.gz - C /ramdisk
and, To create the file KNOPPIX1 you will need to complete this task:
Code:
sudo mkisofs -R -U home etc KNOPPIX-DATA var (or whatever the ramdisk dirs were) \
| create_compressed_fs -B 131072 -m - - >/tmp/KNOPPIX1
I'll work out a turn-by-turn list eventually,
but the first step is rebooting with knoppix noimage to bring in the ramdisk;
next read update*.tar.gz into ramdisk;
next get rid of your original knoppix-data.img and KNOPPIX-DATA;
next make your directory list and issue the second command to produce KNOPPIX1;
next move KNOPPIX1 into the directory that has KNOPPIX and formerly held
KNOPPIX-DATA as well; and
last, but not least, reboot and re-establish persistence, when prompted to do so.
I may have thrown in a few re-boots here and there along the way to see how
things were going. I'll have to make some notes. But the preceeding gives you
the broad outline.
I think there is a sequel to this that Klaus K has defined which describes
how to combine compressed images, but I've not progressed that far yet.
I'm interested to hear the experiences of others with Knoppix 7's ramdisk.
Houston, I have a problem.
.
I have developed a number of changes to Knoppix 7.0.2 and
used the following procedure to save these changes to KNOPPIX1 and
re-establish persistence:
1. In a normal, bare Knoppix 7.0.2, I establish a LiveUSB with
persistence and develop certain changes and try them out, noting
all the steps necessary.
2. I reboot with the cheatcode 'knoppix noimage' and repeat all
the same necessary change steps.
3. I use Klaus K's formula to capture the ramdisk information in
KNOPPIX1, using all the directories I note using 'ls' in ramdisk and no others.
4. I transfer KNOPPIX1 into the same /mnt-system/KNOPPIX/ directory
as the original KNOPPIX file itself.
5. I delete knoppix-data.img, reboot and re-establish persistence.
6. I am pleased that KNOPPIX1 us now doing its job.
Here's what is not going right for me:
I go through steps 1 through 5 with some different changes and
develop and install KNOPPIX2, but without the success in step 6.
The simplest instances of this are to simply use Install-Components or
Aptitude to bring in Flash or ntfs-3g. The ntfs-3g exercise is the one
Klaus K uses to showcase the stacking of KNOPPIX1, KNOPPIX2,.. etc.
I presume this is supposed to work, but I can't seem to make it so.
Any suggestions as to what to look for are welcome.
Minimizing and minimizing..
Quote:
Originally Posted by
utu
.
This is not to take away from heretofore 'standard' re-mastering procedure(s) but to
highlight a subtle refinement in using Knoppix that accomplishes much of what one hopes to
achieve by re-mastering, or making backups of some kind. This alternative is elegant
in minimizing the resources required in re-mastering, including time.
A full remastering of a Poor Man's Install using squashfs needs about 12GB temporary space, for example on a Windows partition, and it can take 15-20 minutes. For precise timings of an actual process, see my squashfs report, #7 in http://knoppix.net/forum/threads/298...l=1#post127051 So while minimization is obviously correct, the savings achieved may be less than impressive. IMHO, the relevant reasons for using this kind of scheme is to improve workflow, backup safety etc. That a full remastering can be done with a minimum of work, doesn't mean one should do it. On the contrary, the easier it is, the more careful one should be about checking out alternatives.
How things are stacking-up
.
I've had great success in successively updating my Knoppix 7.0.2 DVD-size LiveUSB
using the process of stacking successive compressed images mentioned by Klaus K in
the link noted in my Post #1. This is a LiveUSB on an 8 Gb Class 10 SDHC made using
a Knoppix 7.0.2 LiveCD. At present, I have 230 Mb unused of my 500 Mb persistence,
and have 3.1 GB unused in /mnt-system.
I consider success in this instance is in being able to efficiently save whatever
small increments I develop in my LiveUSB, and to do so in such a fashion that
the occasional inadvertent ruination of tweaks stored only temporarily is 'no big deal'.
My KNOPPIX1, in 31 Mb, contains the bulk of my usual tweaks, except flash;
my KNOPPIX2, in 85 Mb, contains flash, an ntfs revision and Hidden Gems.
My current KNOPPIX-DATA has only a few new tweaks, so it hardly qualifies yet
for moving to the safety of KNOPPIX3.
These two new compressed images added about eight seconds to my boot-up time.
If one starts out with a LiveUSB and persistence, one may disregard ramdisk as a
necessary special case. The little program I use for this progression is as follows.
I have only chosen to automate a few of the steps, leaving several simple procedures
that require some judgment to the process as outlined in my Post #14.
Code:
#!/bin/bash
# Declare Integer count
#
# ~/text/smite: remember to do 'chmod +x backup' & 'chown root:root smite'
# Activate in /home/knoppix/text as sudo ./smite
#
IMGDIR=/mnt-system/KNOPPIX/; count=1
cd $IMGDIR; for dir in KNOPPIX[0-9]; do let count++; done
UPDIMG=$IMGDIR'KNOPPIX'$count
# No more than 9 images allowed
if [ "$count" -gt 9 ]; then echo 'Too many images; exiting.'; exit 0; fi
cd /KNOPPIX-DATA/; sudo mkisofs -x '*[Cc]ache*' -x '*.wine*' -R -U etc home root usr var| \
create_compressed_fs -B 131072 -m - - > $UPDIMG
exit 0
So far, it is my impression that for the purpose of progressing one's LiveUSB by
stacking successive images one may disregard a lot of the mkisofs options that are
required to define an iso for a bootable CD or for handling non-Linux files.
The exclude option is one that IS essential, to allow editing of what's ultimately saved.
I'd be pleased to hear of anyone else's experience with this stacking idea.
Look at mountunion() in init
Quote:
Originally Posted by
utu
init's mountunion() looks like you may have up to ten such upgrades, if you have enough space on your LiveUSB
From an earlier post.