I did a "mkswap /dev/sda2"
swapon -a
and it said swapfile active. but top reports 0k usage. all apps are slow.
Help!!!!
Devon Hading
How much physical memory have you got? Post the output of 'free'.
Tony
How has it been setup in the first place (what configuration
have you used)? Do the leases have a suitable timeout period
and have you got enough to cover the machines that require
DHCP leases??
> >and it said swapfile active. but top reports 0k usage.
> >all apps are slow.
> >
> How much physical memory have you got? Post the output of 'free'.
If you have enough physical memory the OS probably won't ever touch
the swap. Apps going slow is more usual if you are using lotsa
swap and haven't got enough memory to cope, not the other way
round.
If there is alot of disk activity check that lotsa messages aren't
being logged to /var/log/messages or some similar place - maybe if
your dhcpd (or something else) is generating alot of errors all the
time it may be slowing the machine down.
Andy
--
"You're not too tired for this life, and it's not going
to matter if you fall down twice" - Lisa Loeb 'Snow Day'
What does /proc/swaps show, and what does /etc/fstab contain, and why
are you cross-posting this to groups that this clearly doesn't have
anything to do with?
-hpa
--
PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD 1E DF FE 69 EE 35 BD 74
See http://www.zytor.com/~hpa/ for web page and full PGP public key
I am Bahá'í -- ask me about it or see http://www.bahai.org/
"To love another person is to see the face of God." -- Les Misérables
James
> When I run "top" it shows 0K of my swapfile being used. My dhcpd no longer
> leases ip addressed. What could be the problem?
>
> I did a "mkswap /dev/sda2"
>
> swapon -a
>
> and it said swapfile active. but top reports 0k usage. all apps are slow.
You forgot to add it to /etc/fstab, like this:-
/dev/sda2 swap swap defaults 0 0
swapon(8) reads /etc/fstab, it doesn't just go around reading devices
to look for swap-signatures :-)
--
ACTUALLY reachable as @free-lunch.demon.(whitehouse)co.uk:james+usenet
However, I created 13 partitions (logical partitions of a single extended
one),
each one with slightly less than 128Mb. I mkswap each of them, updated my
/etc/fstab and included swapon -a in my /etc/rc.d/rc.local.
Each partition works fine if loaded (swapon) separetely, or if loaded with
others up to the total size of 1Gb. But if I try to load any combination that
sums to more than 1Gb, the ones exceeding 1Gb are not loaded. I get an
error message: swapon: /dev/sda13: Operation not permitted.
I thought it could be a problem with my partition table, 1024 boundaries,
disks larger than xGb, etc, etc. Therefore, I created 13 files with 128Mb
each (using "dd if=/dev/zero of=/swap-i bs=1024 count=1310720") and
tried the same. When I load (swapon) the last one I get the same error
message: swapon: /swap-13: Operation not permitted.
Then, my question is: Is there any limitation on the total size of the swap
partitions, namely 1Gb?
Here is the more detailed stuff:
fdisk on /dev/sda:
Device Boot Begin Start End Blocks Id System
/dev/sda1 1 1 981 7879851 83 Linux native
/dev/sda2 982 982 1125 1156680 5 Extended
/dev/sda5 982 982 997 128488+ 82 Linux swap
/dev/sda6 998 998 1013 128488+ 82 Linux swap
/dev/sda7 1014 1014 1029 128488+ 82 Linux swap
/dev/sda8 1024 1030 1045 128488+ 82 Linux swap
/dev/sda9 1024 1046 1061 128488+ 82 Linux swap
/dev/sda10 1024 1062 1077 128488+ 82 Linux swap
/dev/sda11 1024 1078 1093 128488+ 82 Linux swap
/dev/sda12 1024 1094 1109 128488+ 82 Linux swap
/dev/sda13 1024 1110 1125 128488+ 82 Linux swap
bash# swapon /dev/sda5
bash# swapon /dev/sda6
bash# swapon /dev/sda7
bash# swapon /dev/sda8
bash# swapon /dev/sda9
bash# swapon /dev/sda10
bash# swapon /dev/sda11
bash# swapon /dev/sda12
bash# swapon /dev/sda13
swapon: /dev/sda13: Operation not permitted
bash# swapoff /dev/sda12
bash# swapon /dev/sda13
bash#
bash# free
total used free shared buffers cached
Mem: 247412 62564 184848 38196 6500 21376
-/+ buffers/cache: 34688 212724
Swap: 1027872 0 1027872
bash#
Thanks
guilherme
[...]
: However, I created 13 partitions (logical partitions of a single extended
: one),
: each one with slightly less than 128Mb. I mkswap each of them, updated my
: /etc/fstab and included swapon -a in my /etc/rc.d/rc.local.
: Each partition works fine if loaded (swapon) separetely, or if loaded with
: others up to the total size of 1Gb. But if I try to load any combination that
: sums to more than 1Gb, the ones exceeding 1Gb are not loaded. I get an
: error message: swapon: /dev/sda13: Operation not permitted.
For the 2.0 kernels (don't know about the 2.1 series), the maximum
number of swap partitions/files is a fixed number. The standard value
is 8, and 8*128MB is 1GB. If you want more, you can edit the file
swap.h from the kernel source, and change the value on the line that
says
#define MAX_SWAPFILES 8
Then you have to recompile your kernel and you should be set.
HTH,
Eric
--
E.L. Meijer
Eindhoven Univ. of Technology
Lab. for Catalysis and Inorg. Chem.
Recent 2.1 kernels have removed the 128MB-per-swapfile limit.
There is still a limit of total swap, IIRC 2 GB. This is because the
address space of a 386+ is 32 bits, or 4 GB, and Linux splits this into
max total real memory and max total swap, with a default split of 2+2.
You can change the split in a header file somewhere. (Grep is your
friend.)
I remember some talk not so long ago about the fact that Pentium Pro's
(and II's) actually have a 36-bit address space ... but the conclusion
was that actually taking advantage of it wouldn't be worth the
necessary changes to the mm subsystem, which could be nasty.
--
Peter Samuelson
<sampo.creighton.edu!psamuels>
> When I run "top" it shows 0K of my swapfile being used. My dhcpd no longer
> leases ip addressed. What could be the problem?
I might get this wrong, in which case forget about my comment here:
If "top" gives you a line like: Swap: xxxxxxK av, 0K used, ...
with "xxxxxxx" not being 0 (zero), then you don't really have a swap
problem. Your Linux box simply has nothing swapped out at the moment,
and hence the "0K used" info.
Dietmar
So: how to create swap partitions bigger than 128MB with mkswap.
Jens
--
Jens Brauckhoff Email : jens.br...@sap-ag.de
SAP AG
Basis Development Phone : ++49 6227 7 45234
P.O.Box 1461 Fax : ++49 6227 7 43027
69185 Walldorf
Germany
To be on the safe side you might use 127+ MB partitions
as the first 4K of each swap partition is used to map the
pages in use, so you can't get actual 128MB partitions
(unless they changed something in the new 2.1 kernels
I don't know about, which is eminently possible.)
Just fyi. :)
Mike
"Genius gives birth, talent delivers."
- Jack Kerouac
(remove NOSPAM from address, if present, to reply)
> I remember some talk not so long ago about the fact that Pentium Pro's
> (and II's) actually have a 36-bit address space ... but the conclusion
> was that actually taking advantage of it wouldn't be worth the
> necessary changes to the mm subsystem, which could be nasty.
That address space is segmented.
Do you *really* want to see segments, far pointers and all that tosh
again, even if only at the kernel level?
I know I don't.
--
`Anyone who says you can have a lot of widely dispersed people hack
away on a complicated piece of code and avoid total anarchy has never
managed a software project.' - Andy Tanenbaum in 1992 on comp.os.minix
> So: how to create swap partitions bigger than 128MB with mkswap.
Get a newer mkswap.
I quote from the Documentation/Changes file as patched in 2.1.132pre2:
Current Minimal Requirements
****************************
[...]
- Util-linux 2.9 ; chsh -v
[...]
Among other changes in the 2.1.x development, the 128 meg limit on
IA32 swap partition sizes has been eliminated. To use larger swap
spaces, you need the new mkswap found in util-linux. You also need
to upgrade this to get the latest version of mount.
(Note that `chsh -v' doesn't work in Debian; to check your util-linux
version just type `dpkg -l util-linux'.)
--
Peter Samuelson
<sampo.creighton.edu!psamuels>