Does a "NOSWAP" boot param make sense?

Using applications, configuring, problems
Post Reply
Message
Author
PaulBx1
Posts: 2312
Joined: Sat 17 Jun 2006, 03:11
Location: Wyoming, USA

Does a "NOSWAP" boot param make sense?

#1 Post by PaulBx1 »

I was looking at the init script in initrd.gz, and it looks as if we don't have a NOSWAP parameter.

As I am running with an encrypted pup_save, and don't want to deal with an encrypted swap, and have lots of memory, I'd like to be able to boot without any swap. Right now I am booting with a "swapoff" command in my rc.local, but that still allows swap to be used during boot which seems less secure. Is it possible for my pup_save passphrase to end up in swap that way? I'm guessing that nothing will be swapped out in that short period, so it probably is OK as is. What do you think?

I also got the impression the Windows swap files could be used under certain circumstances; could that be a concern here?

There may be other reasons to have a NOSWAP parameter...

User avatar
Gn2
Posts: 943
Joined: Mon 16 Oct 2006, 05:33
Location: virtual - Veni vidi, nihil est adpulerit

#2 Post by Gn2 »

If you read through this: http://www.puppyos.com/development/howpuppyworks.html
Much will be clear - As to use of Swap:
You stated having "ample" RAM - that will be dependent more on how the system is used > I.E. will you want more additions
than only included default Apps/utilities ?

YOUR time is only way to know > through emperical use - & will dictate how much RAM is sufficient - (to not use any swap)

Please see how swap is mounted/used:
I differ from many - (prefer to use /mnt/tmpfs) but in practical useage - have NEVER used Swap
Even when huge copies are backgrounded while the CPU is in 98% load (multiple concurrent compiles)
Running "top" is standard way to check Ram useage - but NOTE:
because of "busybox" in Puppy - many CLI commands are not fully implemented.
Example my swap partitions (3 >> max 2gig ea.) are not shown in top !
( I checked it out, used "swapon/swapoff" )
How much RAM is "enough"? Puppy is happiest on a PC with at least 128M RAM. 128M is a good size -- it is enough for image.gz
(uncompressed) and usr_cram.fs to both be in the ramdisk. For the normal Puppy that is -- we have some fatter custom Puppies, notably Chubby
Puppy (it has OpenOffice) that is 90M and that needs a 256M PC to run in RAM.

But, what if your PC has only 64M, 48M, or even only 32M RAM? Well, usr_cram.fs is not going to fit in the ramdisk. Just ball-park figures,
image.gz uncompressed is about 10M, usr_cram.fs is about 50M.
Puppy does have a card up his sleeve, so to speak -- if the PC has a Linux swap partition Puppy will automatically use that, which is used
to increase the effective size of the ramdisk. If you have ever installed another Linux distro on the PC, chances are it created a swap
partition, so it is already sitting there ready for Puppy to use. If your PC has 128M of RAM, Puppy 0.9.8 will allocate 62M of that to
ramdisk (version 1.0.2+ allocates 70M), however if the PC also has a 250M (for example) swap partition, then the effective size of the
ramdisk becomes 62+250 = 312M!
However, I made a decision with the startup logic of Puppy, only to copy usr_cram.fs into ramdisk if there is at least 62M of physical RAM
allocated to the ramdisk. So, for PCs with less physical RAM than 128M, usr_cram.fs will never be copied into ramdisk, even if there is a
swap partition.
Above is for running live in RAM - hard drive installs are vastly different.
HTH

PaulBx1
Posts: 2312
Joined: Sat 17 Jun 2006, 03:11
Location: Wyoming, USA

#3 Post by PaulBx1 »

I have 320MB ram in my laptop. I tend not to have lots of big apps running, being of a "one-track" mind. :lol: If I do run out of memory, I will just buy more - I tend to be hardware-oriented.

At some point I assume we will be able to run with an encrypted swap; I've seen recipes on the Internet about doing that. Then I can feel more secure about having swap on. But for the moment, I'd rather just keep it off.

From reading that init script it looks as if NOSWAP would be very easy to implement. Just leave all the swap calculations alone, and make it operate only on the line that turns swap on. Heck, even I could figure out how to do it. :)

User avatar
Gn2
Posts: 943
Joined: Mon 16 Oct 2006, 05:33
Location: virtual - Veni vidi, nihil est adpulerit

#4 Post by Gn2 »

Ahh -To each his own & let no-one try to convince otherwise !

For a hard drive install I noticed even 128MB never used Swap partition.
But that was before I messed about in UML mode -"Linux within"

Now my computer has more than ample headroom - it was first needed when running other large LiveCD's in "toram"

Puppy is far more Mem efficient, but am addicted to KDE - Tried the "minimalist" route -
Am relatively comfortable in either - but unless forced to - (for me) - why ?

A simile may be back packing - builds confidence & is fun... but limiting in "druthers"

Must be a carry-over from being a field service HD engine mechanic -
(No mechanic is entirely comfortable without lugging around well-chosen tools).

For me three rules always applied -
~ If you need something once only -make do
~ If same need arises -start shopping
~ Wince but - Buy best quality available - it's cheaper in long term

Anyway glad you found own solution -thnx for the "ear"

Post Reply