LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   No HD swap with a home-compiled kernel. (https://www.linuxquestions.org/questions/linux-hardware-18/no-hd-swap-with-a-home-compiled-kernel-305002/)

Linux.tar.gz 03-23-2005 05:31 AM

No HD swap with a home-compiled kernel.
 
I compiled both 2.6.10 and 2.6.11 kernel on a P166, with hd swap support, but top shows me there's 0 bit of available swap. Then i got an unstable system (apps crashing etc...).
If i boot on stock 2.4.29 kernel, then all is ok. I hesitate to put .config here, because i configured this kernel as usual.

rnturn 03-23-2005 10:48 PM

Re: No HD swap with a home-compiled kernel.
 
Quote:

I compiled both 2.6.10 and 2.6.11 kernel on a P166 ...
Well, I'll say this: You're certainly a patient soul. :)

I could barely tolerate a simple install of 2.6 on a P166 let alone a kernel compile.
Quote:

top shows me there's 0 bit of available swap. Then i got an unstable system (apps crashing etc...).
Perhaps these are dumb questions on my part: Have you defined a swap partition? What does "swapon -s" report? And, last but not least: There's a kernel config option for swapping? (I mean, if not a hard disk, where? :) )

Anyway, I'm rather hoping that you don't come back and tell us that the top display's 4th line reads something like "Swap: 0k total, 0k used". If it does, you're going to have to create a partition to be your swap device/area. Alternatively, you may be able to use a regular file as a swap space but there are restrictions on doing that. However, if you have no unused space on your disk(s) to define a dedicated swap partition, a swap file would be the way to go. See the manpages for "swapon(8)", "mkswap(8)", and "fstab(5)" for some additional information on that. The biggest swap file gotcha seems to be that the file cannot have any "holes" in it, which I take to mean that the file must be contiguous. While ext2/ext3 filesystems (and probably Reiser and the others as well) aren't supposed to fragment, I'm not sure how you'd guarantee that other than follow the advice in the mkswap(8) manpage. Then I always worry about a performance hit if swap space was located in a filesystem (but maybe I'm just superstitious about that).
Quote:

If i boot on stock 2.4.29 kernel, then all is ok.
The 2.4.x kernels could often run without any swap. The 2.6.x kernels pretty much require it (or so I recall reading back when 2.6 was initially released).

Post any questions. Good luck... (I may be slow in replying since LQ hasn't been able to use my email address to send notifications on replies. For the last year or so. (grumble, grumble).)

Linux.tar.gz 03-28-2005 08:36 AM

I use P166 as a server, so i can let him compile quiet!

Yes i have defined a swap partition. When i use the default kernel, top is ok.
I compiled new kernel with swap option, like i do on other computers (i compile a LOT of kernel), but the output of top is different. It shows 0k.

Swapon don't work.

I'll continue to search. Thx.

puffinman 06-06-2005 09:59 PM

I'm having this same problem with the 2.6.11.11 kernel on my HP ze4430us running slackware 10.1. Swap works fine with default 2.4.29 kernel. Has anyone figured this out?

puffinman 06-07-2005 04:57 PM

I finally figured it out. Turns out that one time I was playing with the suspend-to-disk option of the new kernel, but never got it working and just forgot about it. The suspend to disk writes the RAM image to the swap partition, and then the kernel needs to be run with appropriate parameters to check for the presence of this data in the swap partition on reboot. If you don't run the kernel with this option (or run an older kernel that does not have suspend/resume capability), then the kernel will see all this data on the swap partition as corruption and won't mount the partition at all. Problem was solved by re-initializing the swap partition with
Code:

mkswap /dev/hda1
(insert your swap partition in place of hda1).


All times are GMT -5. The time now is 02:19 PM.