Page 2 of 4

Posted: Tue 31 Aug 2010, 16:19
by jpeps
RetroTechGuy wrote:
The one thing I didn't like about the tool was that it, by default, did not name the file pupswap.swp (IIRC that's the default pup swap filename).
You can name it a anything you want to
edit: .swp is used by vim, so probably not a good idea. Also, you don't want to leave it in "/", so it's not really "default".
Also, I think the default size was a little strange (did I miss read it, or was it 10 MB?) -- and it would probably be better if it used MB as the size measurement (I doubt anyone wants to fine-tune the swap size to kilobytes, or bytes...).

I'm guessing that if someone is adding a swap file, they probably want 256MB or 512 MB, so I would be inclined to make one of those sizes the "default" choice (the user can still change the size manually).
It's set at 100M, which was the recommended desired size noted in posts on several of the Puppy threads. KB appears to be the standard way of setting size, although it reads the rounded MB size after setting it (see posted pic).

Posted: Tue 31 Aug 2010, 18:14
by RetroTechGuy
jpeps wrote:
RetroTechGuy wrote:
The one thing I didn't like about the tool was that it, by default, did not name the file pupswap.swp (IIRC that's the default pup swap filename).
You can name it a anything you want to
edit: .swp is used by vim, so probably not a good idea. Also, you don't want to leave it in "/", so it's not really "default".
Well, it is "default", just not a good one. ;)
(no, not negative criticism, this is a useful tool -- I'd just like to make it more newbie friendly).

A better default location choice would be /mnt/home/ (which would dump it onto the boot media, which is the user's most probably desired location)
Also, I think the default size was a little strange (did I miss read it, or was it 10 MB?) -- and it would probably be better if it used MB as the size measurement (I doubt anyone wants to fine-tune the swap size to kilobytes, or bytes...).

I'm guessing that if someone is adding a swap file, they probably want 256MB or 512 MB, so I would be inclined to make one of those sizes the "default" choice (the user can still change the size manually).
It's set at 100M, which was the recommended desired size noted in posts on several of the Puppy threads. KB appears to be the standard way of setting size, although it reads the rounded MB size after setting it (see posted pic).
KB is certainly the standard (OLD) way of setting sizes. This may be why all of the tools now include "-h" for "human readable", since few intuitively think in KB any more. And Puppy and memory now operate on the MB scale, so that might be more "newbie friendly" choice (let us further note that the experts probably don't need this sort of tool).

For a pupswap, I generally suggest the user get approximately 512MB of space. If they have 256MB RAM, then they need another 256MB swap. Some people have odd-ball sizes. Perhaps the tool could look at physical RAM available, and recommend a swap size based on that value... Hmmm... Now that would be a rather cool, newbie friendly tool.

OK guys, what are your recommendations? When you set up a machine with insufficient RAM, what memory level do you shoot for? Or, similarly, how much RAM to swap? (I have historically used the 2x rule for swap -- the swap should be twice the RAM)

Posted: Tue 31 Aug 2010, 21:49
by jpeps
RetroTechGuy wrote: Well, it is "default", just not a good one. ;)
(no, not negative criticism, this is a useful tool -- I'd just like to make it more newbie friendly).

A better default location choice would be /mnt/home/ (which would dump it onto the boot media, which is the user's most probably desired location)
Doesn't work for me, because I don't have sufficient space in /mnt/home
However, I uploaded one to your specs if it works better for others. I didn't add .swp, because anyone who uses vim probably batch removes them on a regular basis. :D
I'm guessing that if someone is adding a swap file, they probably want 256MB or 512 MB, so I would be inclined to make one of those sizes the "default" choice (the user can still change the size manually).
Ver 2.0 defaults at 512, with input for M, if that makes it more friendly. The optimal size is probably debatable, but easily altered. Hope this works. I also included a rounding function, something bash isn't very good at (the 99M thingy was getting to me)

Deleting existing swap file

Posted: Sat 30 Oct 2010, 05:10
by Frank Cox
The method posted on the first page of this thread to get swapoff to function failed when I tried it. After typing swapoff -a /mnt/sda4 the lock was still there. {just happed to have swapfile on save partition}

Swapoff {and swapon} are in sbin so I open a terminal ,cd to sbin and typed swapoff -a . In Gparted it still showed the lock and still gave the error message but then it disappeared and I was able to delete it.
Weird. but at least its gone.

Thanks for the program!

Posted: Sat 04 Jun 2011, 15:11
by darkcity
Thanks for the program. Is it possible for two different installations of Puppy to share a Swap file (at different times of course)?

Posted: Sat 04 Jun 2011, 15:28
by jpeps
darkcity wrote:Thanks for the program. Is it possible for two different installations of Puppy to share a Swap file (at different times of course)?
Just add file /root/.swapfile which shows where swapfile is:
eg, "/mnt/sda2/swapfile"

Posted: Sun 05 Jun 2011, 11:44
by darkcity
Thanks for the reply, I've added the wizard to the Wiki
http://puppylinux.org/wikka/SwapFileManager

Puppy 5.2.5 seems to automatically a swap file is you have low memory, do you know what version this started at?

Posted: Sun 31 Jul 2011, 07:17
by jpeps
Added swappiness; version 3.0

Posted: Mon 01 Aug 2011, 09:07
by jpeps
Version 3.5: Added option to save settings (for reboot). Rewrote code to refresh labels to immediately reflect changes. More friendly windows setup (close child windows, etc.)

Posted: Tue 20 Sep 2011, 22:47
by jpeps
Update: Uses gtimer process widget if installed. (gtimer requires =>gtkdialog 0.7.21

Posted: Sat 24 Sep 2011, 08:37
by jpeps
Version 4.1 Better integration of gtimer; streamlined some code.

Posted: Sun 11 Dec 2011, 18:52
by jpeps
Version 4.2 Automatically defaults to gtkdialog4 but reverts to gtkdialog3 if not available. Added version name to work with pet uninstaller.

swapfile error

Posted: Fri 30 Dec 2011, 17:45
by PenguinPupLin
In urxvt,I get swapfile error:Malformed setting :"vm.swappiness=".
What I did was:
1) In WinXP, fsutil file createnew c"\Wary-511\pup,swp 528244000;then reboot
2) in Wary511,urxvt,
a) mkswap /mnt/home/Wary-511/pup.swp,
b) swapon /mnt/home/Wary-511/pup.swp;
3) use Geany,open roo/.etc/rc.d/rc.local and appended "swapon /mnt/home/Wary511/pup.swp" (without quotes) and saved it to make swapon automatic.
Then I came across the swapfile manager.4.2.pet and installed it,run the program and just set the swappiness at 10 without creating another swapfile as I already have one. Now I get this error message every time I open rxvt.
What should I do ? Any help greatly appreciated.
Another question, I intend to use swapfilemanager in Classic Pup214X-TOP9 to add a swapfile in the same partition where Wary-511 subfolder is located but this time in root where the 214X pupsave resides. Any problem if I do this? Kindly advise(still a noob in Linux).
Edited: Latest development - I deleted the created puppy.swp and use swapfilemanager to created a new swapfile. The swappiness problem is resolved but now I get "..,swapon failed: Device or resource busy" . Need help on this, thank you.

Posted: Sat 31 Dec 2011, 16:48
by jpeps
"swapon -s" will show you what swapfile it is pointing to. I think "swapon -p" will let you prioritize. It looks like you set up conflicting swapfiles.

Posted: Sun 01 Jan 2012, 08:30
by PenguinPupLin
swapon -s showed only one i.e initrd/mnt/dev_save/swapfile and priority -1
Will swapon -p auto prioritize it as there is only one swapfile?

Having created it in Wary511, how do I add the same swapfile ,without creating another one, in Lighthouse Puppy 5.0.3 after installing the swapfilemanager.pet? Saw yr instruction above,but my apology,being a noob,still not clear how to do it. Appreciate yr help.

Posted: Sun 01 Jan 2012, 08:54
by jpeps
The location is listed in /root/.swapfile. It's easiest to just create a new one in the same location. The other will still be there.

Your swapon -s printout looks good.

example:

Code: Select all

STATE=ON
/mnt/sda2/swapfile
SWAPPINESS=30

Posted: Sun 01 Jan 2012, 09:08
by PenguinPupLin
Thanks, I'll create another one for Lighthouse then but can I use a different name as it will be in the same drive and partition sda1(hd0,0) as for Wary511?
The one for Wary still showing the same error message:"swapon failed.Device or resource busy" despite there being only one swapfile.

Posted: Sun 01 Jan 2012, 09:53
by jpeps
PenguinPupLin wrote:Thanks, I'll create another one for Lighthouse then but can I use a different name as it will be in the same drive and partition sda1(hd0,0) as for Wary511?
The one for Wary still showing the same error message:"swapon failed.Device or resource busy" despite there being only one swapfile.
You can't delete or alter a swapfile until you turn it off with swapoff. Yours is still on.

If you use a different name, it will be a different swapfile on the same partition.

Posted: Sun 01 Jan 2012, 10:25
by PenguinPupLin
But once I boot out of Wary,wouldn't it be turned off ? Then I 'll boot into Lighthouse to create another one by a different name, leaving the other one alone as swapfile(which was the default name). Will this do? Sorry,I'm still a noob.

Anyway,I've gone ahead to create a swapfile of the same name for Lighthouse Puppy as for Wary511 since they can both share the same swapfile running at different times as I don't wish to have more than one swapfile to confuse it and hv to set priority(don't know how).

Lastly, although the message "swapon failed.Devce or resource is busy" appeared in both Lighthouse and Wary, typing "free" in terminal showed some swap memory were used. Not sure if this means the swapfile is working alright and the message has something to do with the swappiness setting.

Also noticed that with swapfile auto-on,booting time is longer.

Posted: Sun 01 Jan 2012, 16:20
by PenguinPupLin
Could you confirm that creating a swapfile of the same name and in the same harddisk partition in Lighthouse and Wary511 is alright? When I reboot or shutdown the system,is the cache in the swapfile cleared, so that when I boot into another Puppy, there is no conflict or anything? I ask because now my Lighthouse boots up and gives me a message (as far as I can remember) like "multi-user hald message: bash /etc/rc.sysctl/ no such file or directory" and stays like this for sometime before finally booting into xserver. Pardon me for nagging you as I'm trying out various puppy linux distros to see which one or two works best for my notebook and leave it at that for longterm use and also before I do the same for my friends similar notebook specs. Thanks in advance.