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

Thread: a new & improved, self-contained Knoppix personal backup

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

    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.

  2. #2
    Moderator Moderator
    Join Date
    Nov 2010
    Location
    Germany/ Dietzenbach
    Posts
    1,124
    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)

  3. #3
    Moderator Moderator
    Join Date
    Nov 2010
    Location
    Germany/ Dietzenbach
    Posts
    1,124
    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

  4. #4
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    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.

  5. #5
    Moderator Moderator
    Join Date
    Nov 2010
    Location
    Germany/ Dietzenbach
    Posts
    1,124
    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)

  6. #6
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    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.

  7. #7
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    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

  8. #8
    Moderator Moderator
    Join Date
    Nov 2010
    Location
    Germany/ Dietzenbach
    Posts
    1,124
    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)

  9. #9
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    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.

  10. #10
    Moderator Moderator
    Join Date
    Nov 2010
    Location
    Germany/ Dietzenbach
    Posts
    1,124
    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?

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
  •