Another way to restore Hot Backup files.(abandoned)

Miscellaneous tools
Post Reply
Message
Author
User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

Another way to restore Hot Backup files.(abandoned)

#1 Post by rhadon »

Hi,

I'm working on a way to restore backup files from 2byte's Pupsave Hot Backup without using pfix=ram. Till now only tested (and working) with hd and Slacko 5.3.

You boot a BKP file and at the end you can choose whether you want to save back to the BKP file, to restore the BKP file to the default partition without the BKP part or both, save and restore, or leave everything as it was before booting.

The main limitation, the BKP files must be on the same drive as Slacko, but on another partition.

It has advantages and I think it's useful, but sometimes I also think, it's too complex.

What do you think? Is it worth to investigate time in this project or is it too complicate?

My test bed: Slacko on sda2/slacko-5.3, BKP files on sda7/slacko-5.3. Both folders must have the same name.

By now I use a patched version of Hot Backup which creates file names like "slackosave.BKP111216-08.20.3fs".

To use or to run a BKP file I use pfix=ataflash instead of pfix=atahd and added psavemark=7 (7 because it's sda7 for me).

Now I'm able to test. Is the BKP file the one I want, or do I need another BKP file?

At the end of testing I can choose as described before.

Here is the way:

1) Run Slacko 5.3

2) Install PupsaveHotBackup-1.3-test.pet (it's OK for 2byte that I 'abuse' his wonderful program, Thank You)

3) Download alsa_snapmergepuppy-20111210-shinobar.tar.gz, extract it and replace /usr/sbin/snapmergepuppy. This is because the original one can cause problems, sometimes not erverything will be saved at the end.

4) Download rc.shutdown-20111217-rhadon.tar.gz, extract it and replace /ect/rc.d/rc.shutdown.

5) Change menu->System->Puppy Event Manager->Save Session->Save interval to "0"

At next reboot you have access to your BKP files by using pfix=ataflash and psavemark=[number_of_the_BKP_partition].

Is it too complex?

Hints, recommendations or feedback is really appreciated :wink: .

Also, if anybody thinks that the idea is good, but my code is lousy, your'e probably right. It's OK for me, if somebody says 'I can do it better and I will do'.

Have a nice time,
Rolf

alsa_snapmergepuppy-20111210-shinobar.tar.gz can be found here.
Attachments
restore_01.png
(4.51 KiB) Downloaded 1212 times
PupsaveHotBackup-1.3-test.pet
(4.47 KiB) Downloaded 397 times
Last edited by rhadon on Mon 30 Jan 2012, 09:43, edited 1 time in total.
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#2 Post by Sylvander »

1. WOW! You're making my dreams come true! :D 8)
While I can only dream of stuff like this, you are making it real!

2. This is definitely worth investing time and effort, and I shall do so.

3. The limitation of needing to have the BKP files on the same_drive_different_partition as the...what? The pupsave file?...
Will cause me difficulty, because I'll need to transfer [or copy and delete the originals of] all my pupsave files from their 10GB internal HDD, to something bigger, then swap drives.
[I have a spare 80GB HDD lying around somewhere.]

4. I'm having some difficulty understanding exactly the significance of the various shut-down choices available.
Here's my understanding so far:
e.g.
(a) Do not save anything:
All changes made during the session are lost.
Next session will be identical to the previous session.

(b) Save back to backup partition, and don't change name.
Is the original pupsave, used for the original session, held on the "default" partition?
And is a backup of that [plus changes made during the session] placed on the backup partition when this choice is made, and added to the name is text/numbers telling when the backup was initiated?

(c) Restore original backup file to default partition, and remove BKP part.
Which backup does this restore?
A backup copy of the original pupsave? [Backup-0?]...
And does it remove the BKP part so that it has a name IDENTICAL to the original pupsave?
Or...
Does it restore the 1st backup [backup-1] made at the end of the 1st session that MAY include changes made during the session?

(d) SaveAndRestore as described above.
Does this save the latest state of the latest session?
[Whichever session that may be]...
Including all changes made during the session?
And also restore the backup copy of the original pupsave, so that at next boot [producing the next session], the Puppy OS environment will be back as it was during the original/zero session before any backups were made or restored?

5. I have a copy of "Slacko-5.3-MAIN" set up to boot from a CD-RW, with a pupsave file on the internal HDD.
I guess I'll do the experimenting with that.
Need to check out that it looks in good condition to do that.

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#3 Post by rhadon »

Hi Sylvander,

thank you for your friendly reply and sorry for confusing.

Usually I boot Slacko from sda2 (with pmedia=atahd), do whatever I want, make sometimes a backup (in this case with Hot Backup-test to sda7) and finish the session.

Now the scenario I've tested and tried to descibe:

Booting with pmedia=ataflash and psavemark=7 let me use one of the BKP files (on sda7). This is now my save file. I can test it, is it working as I expect or does it contain what I want, or have I go back to an earlier BKP file? At the end I'm able to decide:

1) leaving everything as it was before I booted this BKP file,

2) save changes during the session to the BKP file (on sda7), same name, same time as it had before,

3) restore this BKP file (without any changes) to sda2, delete the original file on sda2 and remove the BKP part. For example: I use slackosave-test.BKP111216-09.20.3fs (from sda7). This file will be copied to sda2, the original file slackosave-test.3fs will be deleted and slackosave-test.BKP111216-09.20.3fs will be renamed to slackosave-test.3fs.

4) first save (#2) and than restore (#3).

I hope it's more understandable now.

Your questions brought me to another scenario: what's if I use pmedia=ataflash for my usual booting from sda2 with the usual save file from sda2?

I'm ashamed, I haven't thought about that. But seems to be easy to fix.

I've never used CDs with a pupsave on hd (or maybe a long time ago). I think the main problem is the boot option psavemark, which only allows searching for a save file in a partition of the same drive where Puppy is booted.

I will do some tests during the next days.

btw. your posts inspired me to use ataflash :wink:

Thank you,
Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#4 Post by Sylvander »

1. Still reading, thinking, reading, thinking...
And attempting to make sense of it all, and attempting to figure out the significance of everything, and whether there might be problems...
Things might not work as I'd expect or hope.
So I think I'll look before I leap.

2. Perhaps the next best step would be to explain how I do things right now...
And perhaps make some points along the way.
Then perhaps ask some further question regarding your method.
Then perhaps you might explain how your method differs from mine, and answer my questions.

3. How I do things right now:
(a) I edit the isolinux.cfg file included in the ISO, to include pmedia=ataflash, and use this altered ISO to burn a CD-RW disk.
The Puppy loaded from such a disk treats the pupsave on an internal HDD [which has been sought, found as suitable, chosen for use if more than 1 found, and loaded into RAM] as though a pupsave on a flash drive.
I can then make a couple of config/coding changes so that (b) and (e) below are possible:

(b) There is no auto-save, during the session, of the changes made during the session.
Manual saves can be made during the session by clicking the "Save" icon at this moment and/or that.

(c) I can choose [or not] if/when to use "PupsaveHotBackup" at one or more particular moments, to make none, or one, or more backups...
To any location I choose.
Normally I hold these on an external USB connected HDD.
During boot these pupsave backups would not be seen because the HDD is [normally] not powered on.
But even if powered on, these backed-up pupsaves would not be listed for use because of the way they are named. [No .2fs or .3fs extension on the end]
With your naming method, would [all of] your backups be listed/offered to be chosen for use?
I like there to be only ONE suitable file found by the Puppy, so that there is no delay, no need to choose, the Puppy simply proceeds to load.

(d) I might, during a session, choose to NOT click the "Save" icon, so any changes made during the session would NOT be saved back to the pupsave during the session.

(e) Then at shutdown, when offered the option "Save the session: Yes/No?"...
If I choose "No"...
Any changes made during the session are NOT saved at this point in time either.
Net result of (d) and (e) is that no changes are saved back to the pupsave

(f) I might make changes early in the session, then...
Click "Save" [1 or more times, each time 1 or more changes are made] to send them to the pupsave...
Then make further changes [unwanted, and beyond my control, like super-cookies?], but NOT make any further saves after the initial save[s].

(g) I am happy with all of the above, but regret that I am unable to make any PUPSAVE-HOT-RESTORE of any PupsaveHotBackup.
A restore must be done by booting to a 2nd Puppy, and using that to do the restore and rename of a chosen PupsaveHotBackup file.
Last edited by Sylvander on Mon 19 Dec 2011, 13:54, edited 2 times in total.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#5 Post by Sylvander »

QUESTIONS:

1. "Booting with pmedia=ataflash"
(a) How do you do this?
Same method I use, or by making changes within the loaded Puppy?

2. "and psavemark=7"
This is new to me, can you explain it?
How do you configure this? What does it do?

3. "let me use one of the BKP files (on sda7). This is now my save file"
(a) So you are loading, and saving back to, this file on sda7 [with its name that's different to slackosave-test.3fs on sda2]?

4. "save changes during the session to the BKP file (on sda7), same name, same time as it had before"
(a) Doesn't this mean that the date and time included in the file name is now misleading?
Because the changes included within it relate to a later time?

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#6 Post by rhadon »

Hi Sylvander,
Still reading, thinking, reading, thinking...
oh my god, I really can imaging the smoke coming out your ears :lol: (friendly and well minded, far away from any negative offence).

Again, sorry for confusion. I'm not experienced in using Puppy from CD (but I'm learning :wink: ) and it seems to me that you are not experienced with booting from hd (with grub).

Well, I try to answer your latest questions first:
1. "Booting with pmedia=ataflash"
(a) How do you do this?
Booting Puppy from hd via grub:
I can make a permanent entry in menu.lst (I think it's similar to your change in isolinux.conf).

Or in the grub boot menu I can highlight the 'Slacko' entry, press "e" (for edit) and add "pmedia=ataflash" and "psavemark=7" to the kernel line. This is similar to starting from cd with an unchanged isolinux.cfg and using "puppy pmedia=ataflash" at the boot prompt (the first 5 sec.).

Code: Select all

2. "and psavemark=7" 
 This is new to me, can you explain it? 
 How do you configure this? What does it do?
With booting from cd, you don't need this option (explanation later). Sorry, this was also new to me. It means, that you can boot from e.g. sda2 (internal hd, where the folder /slacko-5.3 is, but using a save file from another partition (here sda7, where my BKP files are).
The lack or the annoying part, you can only choose another partition of the same drive, not another drive.
3. "let me use one of the BKP files (on sda7). This is now my save file"
(a) So you are loading, and saving back to, this file on sda7 [with its name that's different to slackosave-test.3fs on sda2]?
Yes. Maybe it's better to say "For this session this is now my save file".
4. "save changes during the session to the BKP file (on sda7), same name, same time as it had before"
(a) Doesn't this mean that the date and time included in the file name is now misleading?
Because the changes included within it relate to a later time?
Also yes, if you want. You can test the BKP file without any change at the end, you can make changes permanent at every time with the desktop icon or at the end you can choose to save. Or you can restore this BKP file as it was since the latest hit of the save button on the desktop. Or by using SaveRestore, all changes will be saved to this BKP file and the file will be copied and renamed to your usual folder. Your original save file will be erased. The idea is that you have all choices. No need to press the save button on the desktop if you don't want.

The bad news, the restore part doesn't work for you at the moment. I must change the way of detecting the drive and maybe the path of the original save file. Maybe it must be added manually. 'Don't Save' anything and 'Save' should work.

The good news, in your case it seems to be easy to switch between your original save file(s) on internal hd and your backup files on usbhd.

Have I forgotten to answer something?

Please confirm if you are able and willing to do:

Including my changes, there should be no difference for your daily work as you described earlier at 3. How I do things right now.
The only difference should be at the end: 4 menu items instead of a single Save Yes/No. Don't save anything and Save should work in the same way as your Save Yes/No.

Please make at least 2 Hot Backups with my patched version to your usb hd. Reboot with usb hd plugged in.

You should only see your save files on your internal hd or it should boot directly if you have only one. You should nothing see from the usb drive.

Now reboot and at the boot splash screen (during the first 5 sec.) type in "puppy pmedia=usbflash" (without "" of course). Now you should only see your BKP files on your usb hd. Is this right?

Please be patient with me. Even if 2 native speakers are talking, there is a big area for misunderstanding. And my native language isn't english.

~Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

lcb
Posts: 3
Joined: Sun 08 Jan 2012, 17:33

#7 Post by lcb »

Hi rhadon,

I think you should go ahead with your idea. The ability to load a previous session it's a must on this distribution as a lot of packages we install are not well tested, are from other distributions or even sometimes not well implemented, which could break the system on a "reboot", unless we use it as is from the time of installation, with no additions at all, besides the machines or media where Puppy is used from (old computers, pens, etc) could break more easily.

In my opinion:
- the grub.list should contain a "recovery mode" where we could do some "recovery" tasks, including the possibility of selecting a previous .3fs. - it should contain an option to load it from another media;
- the possibility of a selection from automatic backups at certain intervals; also, the process of recovering and restoring should use some faster utility, (I have no clue what is used by now) like the pre-installed 'rsync'.

Summarizing, your implementation of these routines IT IS USEFUL and we thank you for your efforts in making Puppy Linux user friendly and painless in case of "problems" when they arise.

I followed your instructions for the application of modifications, backing it up to another partition of same drive, and I didn't notice anything different. I understand what you did so far is only in a test phase scenario.

* In a way I'm relatively new with Puppy Linux (in fact I use it for a couple years but only now I'm using it on an daily-basis because I have it as a backup server for my other machines/distros, a synergy server, a printer server and a couple more minor uses, besides always having one pen for OSes and disk utilities, so, I apologize for any eventual misunderstandings on Puppy functioning. *

User avatar
rhadon
Posts: 1292
Joined: Thu 27 Mar 2008, 11:05
Location: Germany

#8 Post by rhadon »

Hi Icb,

sorry for answering so late and thank you for your feedback.

I tried to merge some different ideas (created by others) to make puppy related life easier.

Unfortunately by this way there are too many restrictions and exceptions. At the moment I see no way to solve this. All solutions I can think about would be restricted by one puppy version. Each other version must be manually changed. This is not a good basis for making things easier.

I think it's better to stop until I get a better idea or another solution.

Regards,
Rolf
Ich verwende "frugal", und das ist gut so. :wink:
Raspberry Pi without Puppy? No, thanks.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#9 Post by Sylvander »

Hello rhadon. :D

I should and do apologize for not replying before now. :oops:

Our exchanges came at a bad time for me.
Christmas was approaching, with so much to do.

Had I found it easy to understand, all would have been well, but I really cannot find the motivation to take on anything I'm struggling to understand.

Other urgent+important things to be dealt with. :(

It's a pity, because I consider this worth doing.

Who knows, at some point the bug may hit me, and I'll be back into this.

Provided you are in the mood at the same time.

Post Reply