Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 17 Dec 2014, 19:05
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
Verify that swap is being used by Pup? Ok, sortof solved.
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 4 Posts_count   Goto page: 1, 2, 3, 4 Next
Author Message
Takilla

Joined: 28 Oct 2005
Posts: 53
Location: Lakeside and Phoenix, Arizona

PostPosted: Tue 29 Nov 2005, 03:03    Post_subject:  Verify that swap is being used by Pup? Ok, sortof solved.  

How do I verify that the swap is being mounted and used?

I am setting up a number of old computors with puppy all w/ 1G HD, roughly, (plan to add 1G slaves for /home) and partitioned as either:

hda1 puppy, primary
hda5 swap,(in hda2,extended)(MUT does see it, but not auto mounted)

or:

hda1 swap, primary (MUT does not see)
hda2 puppy, primary

Does swap work as a primary partition?
No DOS is used-just don't know enough about it-

I am sure that there is already some instructions on this basic subjuect but I have not found it.

Thanks for your help

Edited_times_total
Back to top
View user's profile Send_private_message 
Sage

Joined: 04 Oct 2005
Posts: 4833
Location: GB

PostPosted: Tue 29 Nov 2005, 07:08    Post_subject:  

My method is crude and exposes my glaring inability in Linux, but it works.
Build your HD installations on modern kit. Make and format your swap partition (which can be as small as 30Mb if you are really struggling for space). Even if swap is auto mounted, issuing 'swapon -a ' in console will do no damage.
Then swap the memory for a 32Mb stick. You can hear the swapfile being accessed when you open a large application, eg like Mozilla. [If you have your board in a posh box and fully wired, you can even see the HD light flashing). For double confirmation, swap back to a stick of 256Mb DRAM and notice the difference(s).
Bruce will be along soon to give us the proper method and tell us the latest cricket results!
Back to top
View user's profile Send_private_message 
raffy

Joined: 25 May 2005
Posts: 4798
Location: Manila

PostPosted: Tue 29 Nov 2005, 09:06    Post_subject: Partitions  

Primary partitions are numbered 1-4. Any extended partition begins numbering from 5, so even if it's supposed to be hda2 (as you described above), it will be hda5 if it's extended.

Yes, swap can be built using primary partition.

While in cfdisk (in console), make your partition type swap (82). Then format it by "mkswap /dev/hda1".

Live CD uses swap automatically, but hard disk install must use "swapon /dev/hda1", which can be put in etc/rc.d/rc.local to be loaded at startup.

_________________
Puppy user since Oct 2004. Want FreeOffice? Get the sfs (English only).
Back to top
View user's profile Send_private_message 
Sage

Joined: 04 Oct 2005
Posts: 4833
Location: GB

PostPosted: Tue 29 Nov 2005, 09:47    Post_subject:  

I don't think that was the question. Tecquila wanted to know how he could be certain that his swap file was being used. My blunt implement approach works!
Back to top
View user's profile Send_private_message 
Takilla

Joined: 28 Oct 2005
Posts: 53
Location: Lakeside and Phoenix, Arizona

PostPosted: Tue 29 Nov 2005, 14:05    Post_subject: swap  

Thanks, sage and raffy, both comments help.

I did make a mistake on the partitions, I made a hda5 extended and put the swap there as hda6, that is how other distros do it, I think. But I have not done a "mkswap" or "swapon", did not know about that. Thought that was automatic.

Sage, not sure what you mean by "swap the memory for a 32MB stick". I know what a stick is, just not "swap the memory". Sorry, could use some help on that.

Thanks for your help.
Back to top
View user's profile Send_private_message 
Ian
Official Dog Handler


Joined: 04 May 2005
Posts: 1237
Location: Queensland

PostPosted: Tue 29 Nov 2005, 19:56    Post_subject:  

If you boot Puppy from a live CD on any machine open MUT in Start/File managers/Mut media utility tool, the drives will be displayed and if you have a Linux swap partition it will be shown with the words 'Swap Off' beside it.

This means that your swap partition is mounted, you can click on the 'Swap Off' to unmount it but this is not recommended.

If the partition you designated as swap is not displayed as swap ensure that it is formatted as a Swap partition.

You can do this by running this command, at the command line,

mkswap /dev/hd(whatever the partition is)
Back to top
View user's profile Send_private_message 
Takilla

Joined: 28 Oct 2005
Posts: 53
Location: Lakeside and Phoenix, Arizona

PostPosted: Tue 29 Nov 2005, 23:00    Post_subject:  

Thanks Ian, this is starting to make sense, I'll give it a go.
Back to top
View user's profile Send_private_message 
raffy

Joined: 25 May 2005
Posts: 4798
Location: Manila

PostPosted: Wed 30 Nov 2005, 00:07    Post_subject: MUT  

I thought you're already using MUT to view Swap, as you said in your original post
Quote:
MUT does see it
Smile
Back to top
View user's profile Send_private_message 
Takilla

Joined: 28 Oct 2005
Posts: 53
Location: Lakeside and Phoenix, Arizona

PostPosted: Wed 30 Nov 2005, 02:58    Post_subject: MUT  

Yes, where I made a swap in the extended partition(hda5)MUT sees it as hda6 ext2 unmounted-then I click on "mount" and a lost+ found folder appears(empty).
Now I should, per your instruction, make "swapon/dev/hda6" or "mkswap /dev/hda6" in etc/rc.d/rc.local right? and do two these commands have the same effect to mount the swap on boot?

MUT takes 16 seconds to come up on my machine with 128MB and as much as 45 seconds to come up on the machine with 64MB(20 sec.for AbiWord)-long time-that is why I suspected that the swap was not being used.

MUT does not see the swap on the hard drives with swap on hda1 primary.

thanks
Back to top
View user's profile Send_private_message 
_raffy_
Guest


PostPosted: Wed 30 Nov 2005, 03:54    Post_subject: Commands  

This will format the swap partition:

mkswap /dev/hda5

This will use it:

swapon /dev/hda5

This last one you put in /etc/rc.d/rc/local if you have a hard disk install (not needed if using live CD).

Check your partition numbering in console by the command:

cfdisk
Back to top
Ian
Official Dog Handler


Joined: 04 May 2005
Posts: 1237
Location: Queensland

PostPosted: Wed 30 Nov 2005, 07:00    Post_subject:  

If you have a Linux swap partition, by that I mean a partition formatted as swap in Linux, Puppy will recognize it and activate it at bootup.

The instructions I gave were intended to be a specific guide to what MUT would display if you had a Swap partition, as I said if it is not formatted as Swap the instructions on how to do so were included.

You do not have to include the swapon command unlesss MUT shows that the swap partition is not active as illustrated by the 'Swap Off' flag not being displayed.
Back to top
View user's profile Send_private_message 
Takilla

Joined: 28 Oct 2005
Posts: 53
Location: Lakeside and Phoenix, Arizona

PostPosted: Wed 30 Nov 2005, 13:51    Post_subject: swap-MUT  

However, even tho' Puppy recognized that the swap existed on hda6, having been formated by cfdisk, it did not mount it-there was only the 'mount' option given by MUT. MUT did not even indicate 'swapon' or 'swapoff' until I input the specific command into etc/rc.d/rc.local. Now it does seem to automount. Maybe this is happening with all the other newbees using 1.0.6-their swap may not be automounted.

On my other HD I made, with cfdisk, hda1 the swap, according to forum instructions, and MUT did not see the swap at all. I will not use this method.

Do both 'mkswap' and 'swapon' need to be used even tho' cfdisk has written the swap to hard drive?

At any rate swap now seems to be auto mounted after entering the swapon command in etc/rc......
So I am getting there.

Thanks for all your help guys!

Thanks for your help guys
Back to top
View user's profile Send_private_message 
Ian
Official Dog Handler


Joined: 04 May 2005
Posts: 1237
Location: Queensland

PostPosted: Wed 30 Nov 2005, 20:06    Post_subject:  

Cfdisk or fdisk will rewrite the partition table to include the partition you create.
You have to format the partition as a Swap partition using the mkswap command.

Its similar to DOS fdisk and format, you create the partitions with fdisk and format with the 'format' command.

As for swapon I must apologize, I am using Chubby 1.0.4 and have not run 1.0.6 on this machine, which has a swap partition. On looking at rc.sisinit in 1.0.6 I see where Barry has made some changes since 1.0.4 and this could explain why swapon is not working.

Here are the two different sections:
1.0.4

#0.9.8R2 need to turn on swap partition, if /sbin/init found one...
if [ -e /root0/.etc/swappartition1 ];then
SWAPPART="`cat /root0/.etc/swappartition1`"
swapon $SWAPPART;check_status $?
fi
fi
fi
--------------------------------
1.0.6

#0.9.8R2 need to turn on swap partition, if /sbin/init found one...
if [ -e /root0/.etc/swappartition1 ];then
SWAPPART="`cat /root0/.etc/swappartition1`"
if [ "`echo -n "$SWAPPART" | grep "/mnt/swap"`" = "" ];then
swapon $SWAPPART;check_status $?
else #v1.0.6 only for multisession (see /sbin/init)...
SPARTTYPE="`echo -n "$SWAPPART" | cut -f 2 -d ','`"
SWAPFILE="`echo -n "$SWAPPART" | cut -f 1 -d ','`"
mount -t $SPARTTYPE /dev/hda1 /mnt/swap
if [ $? -eq 0 ];then
swapon $SWAPFILE;check_status $?
fi
fi
fi
fi
fi
Back to top
View user's profile Send_private_message 
Takilla

Joined: 28 Oct 2005
Posts: 53
Location: Lakeside and Phoenix, Arizona

PostPosted: Thu 01 Dec 2005, 00:05    Post_subject: swap  

Digesting-I can hardly follow my own shoping list, so please go easy with this nubeee.

However, I have observed that when I go to etc/rd.d/rc.local, then Xterm here, and input swapon /dev/hda6, enter, I get just a '#' on the next line with no indication that it took. I then reboot and go to MUT and the swap flag is 'use swap' but not the 'swap off' that I need.
This seems to be the issue that you are getting at with your 1.0.4 and 1.0.6 examples,but Is there a solution? This is important because I have promised to install 50 computors with a mini-linux for people with little computor knowledge and have the swap auto mount is a necessity due to the small hard drives(1G) and the small amount of RAM and PII chips, some even PI and 438s. (there are another 150 in storage in another town). See what I am facing?Sad Wish I where up to speed in my experience with linux, but Puppy still seems to be the best choice.

Thanks
Back to top
View user's profile Send_private_message 
Guest
Guest


PostPosted: Thu 01 Dec 2005, 01:19    Post_subject:  

if you type
swapon /dev/hda6
in an rxvt window, it will immediately start using the swap partition ... if it doesn't work, you will get an error message, like
swapon: /dev/hda6: No such device or address
if it works ok, you will just get a #

what you want to do is edit the rc.local file
you could type
leafpad /etc/rc.d/rc.local
put the line swapon /dev/hda6 in rc.local and save the file, then reboot ... this should automatically mount the swap partition every time Puppy boots
Back to top
Display_posts:   Sort by:   
Page 1 of 4 Posts_count   Goto page: 1, 2, 3, 4 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0830s ][ Queries: 11 (0.0045s) ][ GZIP on ]