-
Senior Member
registered user
a new & improved, self-contained Knoppix personal backup
.
I posted a simple backup program on this forum a while back at:
http://www.knoppix.net/forum/threads...ghlight=backup
I've refined it a bit. Mine now requires only about 77M, about half the space it formerly required.
Not only is this a nice backup, you can use the same procedure to re-establish all your
preferences on the next upgrade of Knoppix, as I just did.
Its use is as follows. More on this in the original reference, if needed.
When you make a new LiveUSB, don't use every last MB for persistence;
leave a little in /mnt-system, say 200MB or so. That is, just devote 200MB LESS to persistence.
After you have modified your new Knoppix LiveUSB somewhat, add 'backup' to your /home/knoppix directory; then, occasionally, as root, exercise 'backup' to put an update.tar.gz file into /mnt-system. Whenever you modify your new system, do another backup to keep current.
If you ever spoil* your knoppix-data.img, delete knoppix-data.img; move update.tar.gz
from the mnt-system into the same directory that knoppix-data.img was in and reboot;
re-establish the persistence file when prompted. Assuming Knoppix is again functioning,
either delete update.tar.gz now or move it back into the /mnt-system directory; don't
leave it in the same directory as knoppix-data.img. Make a new backup soon in any event.
Here's the little program:
Code:
#!/bin/bash
#
# 'backup'
#
# This script captures personal folders, adjustments, choices & tweaks,
# but does NOT account for program additions or removals
# relative to the LiveUSB's initial configuration;
# e.g., changes achieved using Synaptic.
#
# Note: do 'chown root:root backup' & 'chmod +x backup'.
cd /
echo -e 'Tarring data to update.tar in /tmp..\c'
tar -cf /tmp/update.tar KNOPPIX-DATA/home/
tar -rf /tmp/update.tar KNOPPIX-DATA/etc/
tar -rf /tmp/update.tar KNOPPIX-DATA/root/
tar -rf /tmp/update.tar mnt-system/boot/syslinux/syslinux.cfg
echo '..Done.'
#
echo 'Zipping update.tar to update.tar.gz in /tmp.'
echo -e 'Patience; this may take a little time..\c'
cd /tmp #tar -tf update.tar > tar.lst
gzip update.tar; echo '..Done.'
#
echo -e 'Moving update.tar.gz to /mnt-system..\c'
mv update.tar.gz /mnt-system; echo '..Done.'
#
echo 'All done.'
#
exit 0
____________________________
* I consider knoppix-data.img 'spoiled' either when my LiveUSB won't boot, or when the OS
doesn't seem to act as it should. I've spoiled my share.
In my experience this has usually been a result of one of three errors on my part:
1..Changing the plugged status of the USB while it is doing a read or write operation;
2..Bringing in too much additional program content via Synaptic; or
3..Making some OS change as ROOT that didn't turn out right.
-
If you ever spoil* your knoppix-data.img, delete knoppix-data.img; move update.tar.gz from the mnt-system into the same directory that knoppix-data.img was in and reboot;
Before this step you have to boot Knoppix with cheatcode "knoppix noimage" to avoid problems with persistent memory.
At next boottime (without any cheatcode) I run in trouble. Knoppix recognize the file update.tar.gz and uncompress it and also ask for new persistent memory. But it doesn't start to LXDE. I can only change to a terminal and reboot. I didn't find a explanation for this curious behaviour.
Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.7.1 remaster)
-
A little suggestion
Code:
STOR=update$(date +'%m%d%y').tar.gz
cd /
tar -czf /mnt-system/$STOR KNOPPIX-DATA/home/ KNOPPIX-DATA/root/ \
mnt-system/boot/syslinux/syslinux.cfg
-
Senior Member
registered user
Greetings, Werner.
I hope the goblins have returned your lxmenu to your top-line-lxpanel by now.
Sorry you are having problems with my little backup program.
I can't duplicate your complaint here.
The steps are:
1. Use my program prepare /mnt-system/update.tar.gz.
2. Move update.tar.gz to /mnt-system./KNOPPIX temporarily.
3a If the system is behaving, leave /mnt-system/KNOPPIX/knoppix-data.img where it is
and reboot.
Screen should indicate both knoppix-data.img and update.tar.gz being read-in.
When system comes up, move update.tar.gz one level back to /mnt-system for safe-keeping.
3b If the system is not behaving, either delete knoppix-data.img or move it out of
/mnt-system/KNOPPIX/ and reboot.
Screen should first ask you to re-establish persistence (my words). Do so.
As I recall, once persistence is established, update.tar.gz is read in.
If that's not the case, reboot and things should proceed as in 3a.
I appreciate your refinements to my crude programming and will incorporate these
to some extent. I sometimes leave things 'spread out' so I can more easily remember
and/or change them. I am mindful of the elegance of brevity, but my short-term memory
isn't so good as it once was.
I have been lucky up to now not to get my update*'s confused. It is time I used a
technique such as yours to keep them distinctly identified. Thanks for the idea.
Last edited by utu; 09-30-2011 at 03:30 PM.
-
If the system is not behaving, either delete knoppix-data.img or move it out of
/mnt-system/KNOPPIX/ and reboot.
If I do so, I lose free space for persistent memory (=pm):
a) flash-disk Installation of my CD on a 4GB USB stick
b) after first boot Knoppix offers 3.3GB for pm, I selected 2GB
c) deleted 'knoppix-data.img'
d after next boot Knoppix offers 1.3GB for pm, I selected 1GB
e) deleted 'knoppix-data.img'
f) after next boot Knoppix offers 0.3GB for pm, I selected 0.2GB
Therefore you can only delete 'knoppix-data.img' after booting with cheatcode "knoppix noimage"
Step 2 and 3a isn't necessary. The contents of your just created update.tar.gz is allready within the old knoppix-data.img.
Now I did it in single steps and all went well:
1. create 'update tar.gz' within '/mnt-system'
2. reboot (cheatcode "noimage") and delete 'knoppix-data.img'
3. reboot and create new pm
4. reboot and move 'update.tar.gz' to '/mnt-system/KNOPPIX/'
5. reboot and move 'update.tar.gz' to '/mnt-system' or store it anywhere else
Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.7.1 remaster)
-
Senior Member
registered user
Hi, Werner
A couple of fine points:
1..I prefer to do the tarring and zipping in the system-&-persistence side of the USB,
so the /mnt-system side only has to be as big as the zipped file.
Remember, I usually use just a 2 Gb USB.
So, I tar to /tmp , gzip there and mv the result to /mnt-system.
2..I'm not following you yet with the noimage cheatcode.
I guess if I've ever gotten an unreasonably small value offered
for persistence, I may have just started over & reformatted
the whole USB.
3...Most of the required space is for the browser's purposes.
I've just changed to IceWeasel 7 and my storage has gone from
77Mb to 44Mb. I wonder if you can confirm this.
-
Senior Member
registered user
An update on the 'update' program
.
Here's an update using Werner's dating method, even in the status lines.
I've included a listing of tarred files, mailed to root, also suitably dated.
I now backup ~124 Mb into 48 Mb of tgz on /mnt-system.
IceWeasel alone accounts for 91 Mb of the 124 Mb it might be noted.
Code:
#!/bin/bash
#
# new.backup: do 'chmod +x new.backup' & 'chown root:root new.backup'
#
cd /
STOR=update$(date +'%m%d%y').tar
echo -e 'Tarring data to '$STOR' in /tmp..\c'
tar -cf /tmp/$STOR KNOPPIX-DATA/home/ KNOPPIX-DATA/etc/ \
KNOPPIX-DATA/root/ mnt-system/boot/syslinux/syslinux.cfg
echo '..Done.'
cd /tmp
STORZ=$STOR.gz
echo 'Zipping to '$STORZ' in /tmp.'
tar -tf $STOR > ~/$STOR.lst
echo -e 'Patience; this may take a little time..\c'
gzip $STOR; echo '..Done.'
#
echo -e 'Moving '$STORZ' to /mnt-system..\c'
mv $STORZ /mnt-system; echo '..Done.'
#
echo 'All done.'
#
exit 0
-
I changed the procedure a little:
1. create 'update tar.gz' within '/mnt-system'
2. reboot (cheatcode "noimage") and delete 'knoppix-data.img'
3. reboot, create new persistent memory and
Code:
tar -xzf /mnt-system/update.tar.gz -C /
4. reboot
The way in your update on the 'update'
over '/tmp' are only for clarity reasons but without any benefit.
Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.7.1 remaster)
-
Senior Member
registered user
Hello, again, Werner.
Just to make sure we see eye to eye on this, I see two different scenarios for using this backup idea:
1..After making some personal additions, and otherwise the LiveUSB with persistence seems to be working ok;
2..After making some personal additons, and the LiveUSB with persistence isn't behaving properly.
In case 1, we want to preserve BOTH our personal stuff & the PROGRAM changes inherent in persistent store.
In case 2, we want to preserve our personal stuff, but we will have to sacrifice PROGRAM changes & start a new persistent store, which will not include any program changes outside of home/, root/, etc/ and syslinux.cfg.
I think this means we may only want to use the noimage cheatcode for case 2; specifically NOT for case 1.
For myself, dealing with case 2, I'd try the noimage first; if it gives a reasonable choice for persistent store
that's the way to go. If not, then I'd repartition the USB with GParted and make a new LiveUSB from scatch,
then add the update disregarding any use of noimage (in this specific instance).
Last edited by utu; 10-01-2011 at 03:59 PM.
-
If you boot Knoppix with cheatcode "noimage" you can only see persistent memory in the (compressed) file '/mnt-system/KNOPPIX/knoppix-data.img'. If you boot without this cheatcode you can also see the persistent memory in the (decompressed) directory '/KNOPPIX-DATA/'.
In "case 1" from you, all is done by Knoppix.
You can change personal settings in '/home/knoppix/' or '/root/', you can install or deinstall programs in '/usr/' and the program-settings in '/etc/'. But in reality Knoppix writes all this stuff in '/KNOPPIX-DATA/' using "UNIONFS".
To prevent later trouble you can do a backup (your "update.tar.gz") from your personal stuff, which is a part of 'KNOPPIX-DATA/', and leave out the remaining of '/KNOPIX-DATA/'.
In "case 2" you can
a) only delete persistent memory alone, or
b) reformat the whole USB flash-drive and reinstall Knoppix. But why this expenditure?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
MSI Z490-A PRO LGA1200 Intel 10th Gen USB3.2 Gen2 ATX Motherboard
$66.99
GIGABYTE B450M DS3H WIFI (AMD Ryzen AM4/M.2/HMDI/DVI/USB 3.1/DDR4 Motherboard
$64.99
ASUS H110M-R Motherboard Intel 6th/7th Gen LGA1151 DDR4 Micro-ATX i/o shield
$42.00
Gigabyte GA-Q170M-D3H-GSM LGA1151 DDR4 Desktop Motherboard w/ I/O Plate
$49.99
Asus Prime H310M-A R2.0 Intel LGA 1151 DDR4 Desktop Motherboard
$54.99
Asus Prime A320M-K mATX AM4 Motherboard (Ryzen 1000-5000 Ready)
$49.99
MSI PRO B650-P WiFi AMD AM5 DDR5 WiFi 6E ProSeries Motherboard
$95.95
GIGABYTE GA-X99-UD4P MOTHERBOARD, M.2 SATA3, LGA2011-3, DDR4, & I/O Shield
$69.99
Gigabyte M-ATX motherboard with Intel Core i3 8100 CPU and 8GB DDR4 RAM
$84.00
ASUS B85M-E Motherboard Intel B85 (4th Gen) LGA1150 DDR3 microATX
$39.99