psav=....conquering/understanding puppy boot command(s)

Using applications, configuring, problems
Message
Author
Sailor Enceladus
Posts: 1543
Joined: Mon 22 Feb 2016, 19:43

#31 Post by Sailor Enceladus »

backi wrote:Hi belham !
Swap?? Hmmm, what??? I thought the whole point of using puppies (in fact, all related pup OSes too) was that a user never had to worry about either setting up a "swap" and/or using one? I nderstand why in bigger Linux OSes what swap does, and dutifully set it up in all the big Linux OSes I run. But who, and I guess more importantly WHY, has anyone in pup & pup-related land ever set up and/or used 'swap" with a pup? Even with 512mb of RAM, puppies won't use "swap" when running a pup OS designed for 512mb of less. Equally, you cannot run pups on 512mb ram or less that are designed for bigger amounts (i.e. the 64-bit pups, fatdog, tahr, etc, etc). I have never in the years since I started using pup back in ~2006-2007 ever set up a swap partition? Apologies if this all is ignorant ramblings and I should have been setting up "swap" partitions for all pups this whole time.
In this case i have to contradict your statement ........i have a whole lot of swapping going on on my old Thoshiba 3000 .......1 core ....1 gig Ram ...

I am using Zram which mostly helps avoiding Swaps to a Swap Partition.....but sometimes Ram gets out of Limits and additional Swap Partition will be used .Not very often.
Yup. I have 1GB Ram and sometimes Firefox freezes and I have to kill it then restart it if I don't have my 2GB swap partition.

backi
Posts: 1922
Joined: Sun 27 Feb 2011, 22:00
Location: GERMANY

#32 Post by backi »

Hi Sailor Encaladus !

Did you ever tried Zram ? ......useful if you have only 1 Gig or less Ram .
If not Google for it ....or if you are on Tahrpup .....just install with PPM.....
zram-config ...save.
After reboot it is activ .Almost no configuration .
Don`t know if there is a thread here on the Forum .....if not it would maybe useful.....for Machines with less Ram.

User avatar
6502coder
Posts: 677
Joined: Mon 23 Mar 2009, 18:07
Location: Western United States

#33 Post by 6502coder »

belham2 wrote:Even with 512mb of RAM, puppies won't use "swap" when running a pup OS designed for 512mb of less.
Well, all my Puppy installations to hard disk are frugal, and I always set up a swap partition. My 412 Retro machine has 96 MB RAM and 384 MB of swap. My Wary 5141 machine has 192 MB RAM and 1 GB of swap. On both of these machines, I do see the swap partition being used from time to time. Even my Precise machine with 1 GB RAM uses its swap partition now and then.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#34 Post by greengeek »

belham2 wrote:Swap?? Hmmm, what??? I thought the whole point of using puppies (in fact, all related pup OSes too) was that a user never had to worry about either setting up a "swap" and/or using one?
I guess it depends on how big your pup is, and how small your ram is - but remembering at all times that we don't just have the pup sitting idle in memory - we DO stuff with it.

eg: browser cache has to increase, calculating space has to be allocated for spreadsheets, word processing etc etc.

Then there's ripping of music and videos, and especially processing of videos - these can easily outstrip our available free ram.

What if your pup was 200MB, your savefile 512MB and your ram was 512MB. Already you have a problem. And what if you then load a decent sized Libreoffice sfs, maybe also Librecad, and then opened Chrome and did some browsing?

Uh-oh, tits up.

The worst situation is where the puppy keeps on running (ie doesn't crash) runs low on free ram and you keep on manipulating data. What gets written back to your savefile?

If you combine two issues - 1) Low ram due to no swap space and 2) long write times to usb stick - you get corruptions that are hard to explain.

I reckon that running without swap space should be limited to sessions where all data will be dumped at end of session, and no write attempts are made to usb or hard disk.

Remastering can use heaps of ram too - so i think swap space is compulsory for that type of operation also.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#35 Post by bigpup »

Why are some people so afraid to setup swap on their computers? :roll:
It is there to assist ram IF needed. :shock:
All it does is take up some space on whatever storage device you have swap on.

Most of the newer Puppies have swap usage setup to start when ram gets down to 40% free.

Why worry when that happens, just let it happen.

Do you really know what each program is doing with ram at all times?
No! :shock:
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
Burn_IT
Posts: 3650
Joined: Sat 12 Aug 2006, 19:25
Location: Tamworth UK

#36 Post by Burn_IT »

It is a bit like when you go into a store you pick up a basket to temporarily hold things. You may well put things back on the shelves before going to the checkout, paying, and tranferring to your own carrier.
"Just think of it as leaving early to avoid the rush" - T Pratchett

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#37 Post by greengeek »

Of course you can always set up a separate usb stick which has been formatted with only a swap partition - no data or boot partitions at all. That way if you run out of free ram your system can still run by using the swap space on that separate usb stick - and you can still unplug the other usb stick that contains your boot files and data.

But i think the original question remains - how to force savefile/savefolder to load into ram initially (and completely) during boot?

Pelo

Bookmarked for translation fr.

#38 Post by Pelo »

Bookmarked for translation fr.
Because of much interest.

Pelo

So you need a savefile.

#39 Post by Pelo »

savefile is the first to be installed..
Savefile=your files storage (menu.lst).
So you need a savefile. Else how to know what to load at boot ? some german users told us to remasterize your ISO before shutdown.. Easy, clever idea.. :(

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#40 Post by greengeek »

puppyluvr wrote::D Hello,
Frugal install?
Two easy ways.
1.
Make your save to a directory.
Boot in ram.
Mksquashfs the directory.
Put the .sfs in your home directory with the Puppy .sfs etc..
Edit initrd to load it at boot.
2.
Make a save to a directory
Boot in ram
Merge the directory, with the original Puppy .sfs.
Swap the new .sfs with the original
Reboot.
I have a 2gb Puppy 5.1.1 that runs in ram..
;-)
Hi Puppyluvr - i am keen to understand the method you use to achieve what you said above re: "Edit initrd to load it at boot."

How is this done? Is it easy to modify initrd so that it accepts a new sfs as the top layer?

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#41 Post by rufwoof »

Fatdog usb multi-session works well the way you want. Boot from usb, loads saves from the same usb, unplug the usb once booted. You do however have to set the Save Session Interval to zero (only save on demand, never automatically/timed). To save, re-attach USB and click the Save desktop icon.

Code: Select all

title Fatdog
kernel /vmlinuz pkeys=uk waitdev=5 basesfs=ram:uuid:4d054dbd-ff6f-48d7-94ac-e9023c62d0f1:/fd64.sfs savefile=direct:multi:uuid:2d5fb1e2-5276-4950-bc8c-0b3c1ec9cfa6::
initrd /initrd
I've also set up a 16GB encrypted swap partition on HDD for the times when I do something like downloading a massively large iso or music/video file into /root. I don't save that however, move it elsewhere (HDD/server). When swap does get used it runs fine. I did comment out a swapoff in /etc/rc.d/rc.local however as with that left in it could stall during shutdowns/reboots.

Mostly I just boot, use, shutdown (no saving). Except when a new Chrome version comes out when I boot, install chrome, save. So clean system and browser at each reboot. For bookmarks I use tilda drop down terminal (F1 toggles showing/hiding it) and tilda highlights all urls (just click a url to open chrome on that web page). So I have tilda auto-loaded with editing a text file containing my bookmarks so that they're easily accessible at any time (press F1 to show/hide) and easily edited.

I have previously experimented with setting up swap early - within initrd and prior to the saves being loaded, so even with large saves if you have the swap space it would load into ram + swap. Worked OK, but was like a full install i.e. HDD read/write delays rather than running totally in ram.

I've yet to get a Puppy working in a manner where you can boot from usb/load saves from usb/unplug usb once booted. The way Fatdog does that is its like a CD/DVD multi-session, but using usb instead. And instead of save files it uses sfs's. Each new save creates another sfs and on bootup they get loaded into /aufs/pup_multi, whilst changes get stored in /aufs/pup_save. A trick is to boot, delete all of those save sfs's and then run a save action, which in effect re-writes the /aufs/pup_multi content to a single new sfs save file - sort of like defragmenting multiple save sfs's into one . When there are multiple save sfs you can use boot parameters to not load n number of previous saves, or just simply delete/rename them.

Multi-saves are nice when you want to change things, reboot and try them out, but then rollback to undo that (i.e. delete the most recent save sfs and reboot again).

That boot main sfs and saves from usb/unplug usb feature is one of the main reasons I run Fatdog, having your MBR, grldr, vmlinuz, main sfs and save sfs's all on a disconnected usb once booted is very comforting/secure.
Last edited by rufwoof on Wed 31 Jul 2019, 09:05, edited 2 times in total.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#42 Post by Flash »

You might not have to delete the offending saved session to not use it. If Fatdog really works like a multisession DVD, there is a boot option that you can enter to make Puppy skip certain saved sessions. It's been a long time since I used it, so I forget what it is.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#43 Post by rufwoof »

Hi Flash

In Fatdog, you just append the number of last saves you want to skip being loaded to the end of the savefile kernel boot parameter, i.e. my previous example grub4dos (menu.lst) boot code of

savefile=direct:multi:uuid:2d5fb1e2-5276-4950-bc8c-0b3c1ec9cfa6::

becomes

savefile=direct:multi:uuid:2d5fb1e2-5276-4950-bc8c-0b3c1ec9cfa6::2

if you want to skip loading of the two last saves.

I believe the last two colons in the savefile parameter aren't actually required when the values they separate are null (empty) i.e. it could be just

savefile=direct:multi:uuid:2d5fb1e2-5276-4950-bc8c-0b3c1ec9cfa6

But I leave the two colons there purely as a reminder of where the skip n saves value should be added.

I used uuid's for disk identification as that's more static (uuid's are revealed by running "blkid" command). Using sda1 or sda2 or whatever type names can otherwise see those change at bootup if other block devices such as a usb have been inserted. If for example your HDD is usually /dev/sda1, but you have a usb inserted during another boot, then the kernel could allocate that usb as being /dev/sda1 and your hdd as /dev/sdb1. That's random, and at another reboot it might be back to the hdd being sda1 and usb as sdb1. Even uuid's can change however, but tend to do so less rarely under usual/general usage.
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#44 Post by rufwoof »

drunkjedi wrote:Savefolder works great with Fatdog.
Here's my syslinux.cfg entry for Fatdog to load the folder from my hdd to RAM, the base sfs is also loaded in ram but in expanded state which makes it slower to boot but faster in work, Libreoffice, gimp start in an instant and work fast.

Code: Select all

label fatdog
linux /fd64/vmlinuz
initrd /fd64/split/initrd
append rootfstype=ramfs waitdev=0 basesfs=expand:device:sda7:/FD64-710/fd64.sfs savefile=ram:device:sda7:/fd64save 
menu label Fatdog64 
text help
Start Fatdog normally with small initrd.
endtext
(Belated) thanks drunkjedi

If you're less concerned about the filesize of fd64.sfs, then swapping it to use lz4 compression knocks quite a bit off the boot time.

unsquashfs fd64.sfs
mv fd64.sfs fd64.old.sfs
mksquashfs squashfs-root fd64.sfs -comp lz4
rm -rf squashfs-root

Under grub4dos/menu.lst, booting from usb (small initrd - with no fd64.sfs contained within that) with multisession saves back to usb, but with swap and fd64.sfs on hdd

Code: Select all

title Fatdog 
kernel /vmlinuz rootfstype=ramfs pkeys=uk waitdev=5 basesfs=expand:uuid:4d054dbd-ff6f-48d7-94ac-e9023c62d0f1:/fd64.sfs savefile=direct:multi:uuid:2d5fb1e2-5276-4950-bc8c-0b3c1ec9cfa6::  
initrd /initrd
Boots reasonably quickly, htop shows low memory utilisation, and once booted the usb and hdd can both be unmounted (ensure save session interval is set to zero).

Now making that my default boot settings for my fatdog usb multisession :)
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

Post Reply