Full RAM memory Slackware 12.1.
Hello!
How can I make Slackware 12.1 recognize (and make use of) my 4Gb of RAM memory? If I run vmstat, it seems to recognize only 3Gb. Thanks in advance, Glore2002.- |
Recompile kernel with 64gb ram support
|
I'm afraid you'll have to recompile your kernel with the HIGHMEM64G option enabled.
|
Recently I had to do this.
There are three memory usage options when compiling the kernel: CONFIG_NOHIGHMEM CONFIG_HIGHMEM4G CONFIG_HIGHMEM64G The first option limits using up to 1GB. The second option limits using up to but not including 4GB. That is, a 4GB box will only use 3GB or so. The last option will recognize 4GB or more. The BIOS might recognize 4GB at boot, but without recompiling, the Linux kernel will not. |
Recompile? Is that easy or risky?
Hello back and thanks for your answers.
So, in order to recompile kernel, What steps should I follow? Will that mean losing some or all of my insalled programs? If Slackwar recognizes my full 4Gb, Will that be an advantage or not? If I run free -m at command line now, I get this: total used free shared buffers cached Mem: 3285 606 2678 0 61 370 -/+ buffers/cache: 173 3111 Swap: 0 0 0 I have 4Gb of RAM installed. Thanks again, Glore2002.- |
See here for a great kernel compiling guide.
Quote:
Quote:
|
Hi,
'Linux Kernel in a Nutshell' is a must read! And a great desktop reference. This link and others are available from 'Slackware-Links'. More than just Slackware® links! |
Quote:
This looks nice T3slider! (at least, it looks easier!). Would it have the same effect as re-compiling kernel? This is how my /boot/config-generic-smp-2.6.24.5-smp looks like now: : : # CONFIG_NOHIGHMEM is not set CONFIG_HIGHMEM4G=y # CONFIG_HIGHMEM64G is not set CONFIG_PAGE_OFFSET=0xC0000000 CONFIG_HIGHMEM=y : : So, What should I do? (detailed explanation will be appreciated!). Thanks again! Glore2002.- |
Something else...
By the way, next time I install Slackware from scratch ¿Where and when during installation should I tell Slackware my amount of RAM to set everything correctly?
Thank you! Glore2002.- |
Quote:
It's a nice problem to have, having more memory than what your system to knows what to do with. Thankfully it is easily fixable as mentioned previously. Edit: Quote:
make menuconfig Go to "Processor Type and Features" -> "High Memory Support" and select 64GB. Exit and then make, and do the rest of the steps in the guide. |
Quote:
You still need to recompile the kernel to incorporate the edit you made to the .config file. After editing the .config file to activate the HIGHMEM64 option, you will need to move/copy/save this .config file into your kernel source folder, then execute: Code:
make clean As well as reading the man page for `lilo` the links provided by other users above should give you all the info you need about building a new kernel. If you proceed and get stuck or lost, tell us what you have done so far and we will guide you further. SVA EDIT - this assumed you ARE using the LILO bootloader. If you are using something else, then the LILO instruction I gave will not apply, but something else will. |
Hard to decide Isn't it?
Thanks for such a valuable information.
For me, it's hard to decide what to do: On one side, by rebuilding the Kernel, I would gain full access to my 4Gb. But (on the other side), by reading the guide I also see that some packages may need to be re-compiled (alsa?) to match the new kernel (I don't clearly understand this point). The guide is really good but, as a newbie, I think I need to have all the detailed and exact steps I should follow in order to access 4Gb without losing any of my packages and lilo. This to make sure I don't make mistakes because of misunderstanding the guide. What I find really hard to believe is that one is not able to install Slackware from scratch enabling HIGHMEM64G. Well, I'll keep on reading. As always, your help is very welcome. Thank you! Glore2002.- |
No problem! Your patience and willingness to read are commendable, and the right way to go about things. Rather than simply doing stuff without knowing why it is how it is, you will hopefully *understand* what it is you are doing.
The way it is now, without the 64G option, your kernel uses the top 1/4 of your memory to map the lower 3/4 of the memory. So, it isn't technically "missing", but rather the kernel has access to it and you don't. Chances are VERY HIGH (ridiculously high) that you will not lose (or need to recompile) any packages by rebuilding your kernel, especially if you are rebuilding the exact same version of the kernel. In fact, the only way you would lose packages is... Well, I don't really know :p but I suppose it is possible somehow.. Anything's possible. :D As far as enabling the 64G option while installing, the installation process would need to compile the kernel on the fly, during installation. Slackware does not do this, but instead provides some compiled kernels which are intended to suit the majority of general needs. An example of a Linux that DOES (or CAN) compile a kernel on the fly, is Gentoo; Gentoo is compiled from scratch AND installed during installation. As you might guess, a distro that compiles EVERYTHING from scratch as it installs takes a longer time to install, AND needs more user input to do it. Best of success with the reading. You will get there! Sasha |
Let's see if I can do it. Now it became a challenge!
OK. Let's see if I can do it myself:
Please, help me, writing down the needed steps. I will add questions when in doubt. Question #0: Should I always be root? (During the whole process that follows I mean). My answer would be YES. a) I edit my /boot/config-generic-smp-2.6.24.5-smp and change: CONFIG_X86_CPUID=m # CONFIG_NOHIGHMEM is not set CONFIG_HIGHMEM4G=y # CONFIG_HIGHMEM64G is not set CONFIG_PAGE_OFFSET=0xC0000000 CONFIG_HIGHMEM=y To make it look as: CONFIG_X86_CPUID=m # CONFIG_NOHIGHMEM is not set #CONFIG_HIGHMEM4G=y CONFIG_HIGHMEM64G=y (****) CONFIG_PAGE_OFFSET=0xC0000000 CONFIG_HIGHMEM=y Is this OK? b) I should copy this newly /boot/config-generic-smp-2.6.24.5-smp to where the Kernel source resides (and change its name to .config). Question #1: Do I have to copy it to /usr/src/linux or to /usr/src/linux-2.6.24.5 ? I don't have to download any kernel source because I need to re-build the same Kernel I am using right now. Is that ok? c) Here is where I get lost. What follows? :confused: Yes, I know, I didn't get too far but at least I am trying to make some little steps. :-) Thanks again! Glore2002.- |
Quote:
Just copy that to your kernel source directory as .config and use, for example, make menuconfig, instead. |
OK. Let's see what's next.
So, let's see if I have it until now.
a) I should copy /boot/config-generic-smp-2.6.24.5-smp to /usr/src/linux with no changes (I don't have to edit it). b)I should run make menuconfig. There I choose to enable 64Gb support. c) What should I do now? (is it to type make clean, make and make modules_install?) as GrapefruiTgirl suggested? d) ? Thanks! |
Here are the steps that I use;
copy (or untar) the kernel source somewhere under your home folder (you can compile a kernel as root, but I choose not to.) "cd" into the top of the source tree, make mrproper (like "make clean" but more aggressive, and will delete the .config file, if present) cp /boot/config-generic-smp-2.6.24.5-smp ./.config make menuconfig set the "Local version" to "-custom" (for example) to keep your new modules from clobbering any modules from another kernel. make any other desired changes to the .config make (you need to be root for these next steps) make modules_install cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.24.5-custom cp System.map /boot/System.map-2.6.24.5-custom cp .config /boot/config-2.6.24.5-custom now run the mkinitrd command (if you need one). Place a stanza for your new kernel in /etc/lilo.conf and run /sbin/lilo. If all went well, you can reboot into your new kernel. Any third party kernel modules you have will now need rebuilding. The only module included in Slackware that will need to be rebuilt is "svgalib_helper" (at least this is the only one I'm aware of) and you most likely will never need it. I ran my custom kernel for almost a year before I realized it was missing. :) You can now run "make clean" on the kernel tree to save some disk space, (don't run "make clean" if you're going to be building any kernel modules you'll likely have to run "make" again in order to build them.) but don't delete or move it. Any modules you build in the future will need it, and they'll know where to look for it even if its under your /home directory. I also highly recommend the book linked to by onebuck in post #7 |
To add to what wadsworth posted,
Keep in mind that the kernel source for Slackware has a small patch. So, a vanilla 2.6.24.5 kernel source is not quite the same. Newer 2.6.24 kernels include the security fix this patch has, but they might also have other features as well. It's also fine to compile your kernel as root if you want to. This is what official SlackBuilds do. There are ways to compile as a normal user while still having the source under /usr by the way. There is some info about this in the kernel docs. For your situation I recommend copying the Slackware kernel source to a different directory under /usr/src such as Code:
cp -a /usr/src/linux-2.6.24.5 /usr/src/linux-2.6.24.5-custom See /boot/README.initrd for some documentation on your initrd. There is also a thread active here about switching from the huge to generic kernel that would probably be of use. When you edit your lilo.conf leave the old Slackware entry. Just copy it and modify it for your new boot entry. Leaving the original boot entry gives you more than one kernel you can boot from in case you have a problem with your new one. I recommend you create a rc.modules file for your new kernel (eg. /etc/rc.d/rc.modules-2.6.24.5-custom). When your system boots it will look for a file in this order /etc/rc.d/rc.modules.localMost people don't use rc.modules.local unless they want it called regardless of what kernel they boot. You can just copy your current rc.modules file to your new one and modify it as needed. If you are not missing any modules after you boot you probably don't need to modify it. By the way, in case anyone is curious, the SlackBuild for compiling the kernel is at slackware-12.1/kernels/compile_kern.sh. There are other slackBuilds for setting up the kernel packages in the src directory. |
Hi,
Following various comments here, I am able to re-compile my kernel to support 4GB of RAM in my laptop now: Code:
root@example:~# free -m |
thanks for your help!
Thanks to all of you for your valuable help.
REIKYV, since you've just compiled your kernel to recognize 4Gb RAM, Could you please write down the steps you exactly made to do it? This to see if they match the ones I think. Thank you very much! Glore200.- |
Quote:
First, I am using existing kernel source, i.e. /usr/src/linux-2.6.24.5. So my steps here: Code:
# cd /usr/src/linux Cheers! |
Quote:
Also, it is not required to change the symlinks under /boot (System.map, config, vmlinuz). What matters is that lilo can find the files it points to. |
Thank you!!!!
I will try this as soon as I get home tonight and will tell you what happened. :D
Thanks friends. |
As Pat says, "Have fun!"
|
Quote:
Thanks and more thanks! Glore2002.- |
Quote:
Although I don't really get what you meant, but it sounds bad, am I already corrupted my previous modules? And you suggest to do a "make bzImage" again? Thanks. |
Hi,
I like to modify the '/usr/src/linux/Makefile' variable 'EXTRAVERSION = ToSomeUniqueValue'. That way you won't have a problem with other areas of concern. Your compile session will be unique as to the 'EXTRAVERSION = ' setting. |
reikyv, your sequence of events suggests that you accidentally compiled using a stock kernel configuration and not the configuration matching Slackware's default kernel. `make mrproper` actually deletes the .config file in that directory, so you would be starting from scratch. Unless you accidentally posted your sequence out of order, you're lucky that your kernel worked -- but I would suggest recompiling to get the original Slackware configuration with only the one option changed. Your sequence should have run `make mrproper` BEFORE copying the .config file to the source directory, OR running `make clean` instead of `make mrproper`, since `make clean` does not delete the .config file (but does basically the same thing as `make mrproper` otherwise).
If you want to restore your modules to their previous state (because you probably overwrote the original modules), you could delete the /lib/modules/2.6.24.5-smp directory and issue `upgradepkg --reinstall /path/to/kernel-modules-smp-2.6.24.5_smp-i686-2.tgz`, where /path/to/kernel-modules-smp-2.6.24.5_smp-i686-2.tgz is the location of the kernel-modules-smp-2.6.24.5_smp-i686-2.tgz package (which is located on the install media or available at your favourite mirror in the a/ series). Normally I would not suggest deleting the /lib/modules/2.6.24.5-smp directory entirely before issuing the upgradepkg command, but since `depmod -a` (run by the doinst.sh install script when you install the package) detects all of the modules in that directory, any extra modules will also be added -- which would not restore your system to its original state. |
Here is the complete method of rebuilding the kernel just to enable this one feature. It's the easiest way (though not my favourite way -- I personally build kernels in my home directory, but this will do if you don't want to do that. It's also the most straightforward).
Code:
# cp -a /usr/src/linux-2.6.24.5 /usr/src/linux-2.6.24.5-custom Code:
# make bzImage modules Code:
image = /boot/vmlinuz-2.6.24.5-custom Code:
# /sbin/lilo -v |
T3sliders post is mostly fine.
You don't need to download and use the patch or "make clean" or "make mrproper" if you use the original Slackware kernel sources. As I said previously the original Slackware kernel sources have already been patched and cleaned. You only need to patch your sources if using a vanilla kernel, and you only need to clean them if you already mucked around with them. If you did mess with the original sources (instead of working with a copy) you can reinstall the kernel-source package and then make a new copy. Don't forget to mkinitrd (I think this was missing in T3sliders post). I think you should be able to figure it out from here, glore2002, without me recopying all of these directions. Don't be afraid to break something or you will never move forward. Even if your new kernel flops you still have the old one as a standby. |
As a side note, if you want to get really technical, you don't even need to rebuild the modules as far as I know, since you're only changing one option which doesn't affect any modules (as far as I know --but I could be wrong). You could probably get away with a simple
Code:
# cp /usr/src/linux-2.6.24.5 /usr/src/linux-2.6.24.5-custom Code:
# make bzImage However, if you want to be sure, you should just build the whole thing, as explained previously. Quote:
Code:
# cp -a /usr/src/linux-2.6.24.5 /usr/src/linux-2.6.24.5-custom |
I'm confused, I thought that 4gb of memory was not possible with a 32bit operating system, only with a 64bit OS?
|
Go 64 bit
I just skimmed this while looking for something else and thought I should
mention it in case no one else did: have you considered going 64 bit? While Slackware itself doesn't yet, its clones do: I'm using SlamD64 (.com) very happily; it's also the only one that has 32 bit compatibility libraries. In your particular case, going 64 bit means you'll have direct (without PAE aka paging) access to all the memory in your system no matter how big you get it (at least for the next dozen years or so, LOL!). Other than the occasional non-FOSS package that's 32 bit only like Flash or most games, the transition has been very smooth for me and my system runs noticeably faster, particularly in the I/O department. YMMV, of course. Mike |
This is not a piece of cake!
Hello back!
Well, I was going to re-build my kernel following reikyv steps. Then, when I've got home, I entered the forum and saw Shadowsnipes reply. Then, I stopped. Now, I am getting a bit confused and I am not sure what to do. For instance, I don't know if I have to rebuild my kernel or if it is preferable to download a new kernel and update the one I have installed. That's why I will really appreciate if someone could write all the needed steps in order (as Reikyv did) to rebuild my Kernel enabling 64Gb support without losing what I have installed and being able to boot my O.S. Your replies and suggestions are very important to me and I really appreciate that because you are the ones that know a lot about Slackware but if I can see all the instructions together, it would be much clarifying to me. Maybe you can modify and or optimize Reikyv set of instructions. At the same time and following your advices, I am starting to read Slackware Linux Essentials, Slackware Linux Basics and also The article from http://slackwiki.org/Kerne26Compilation. They are great sources of information tools. But, and I don't want to bother with this, a refined list of needed steps will be very useful not just for me (it course it will) but for many other Slackware users who are starting to understand how Slacware and Linux work. Sorry for such a long Thread. It wasn't what I meant when starting it. Believe me. I thought it was easier but now I wont stop until I reach my goal :-) Thank you friends! :cool: Glore2002.- |
As I said previously T3sliders directions (1st set) are mostly fine. Basically I am just recopying most of that.
As root Code:
cp -a /usr/src/linux-2.6.24.5 /usr/src/linux-2.6.24.5-custom Enter -custom "Processor Type and Features" -> "High Memory Support" and select 64GB. Exit and Save Code:
make Quote:
After everything is all good you can optionally Code:
cd /usr/src/linux-2.6.24.5-custom |
The thing is, it IS pretty easy and I think my reply is fairly detailed. If you omit a few steps, as shadowsnipes explained, it will also work. We really can't spell it out any clearer. Following my steps makes it impossible to destroy your current kernel and modules, so you have nothing to lose. If you follow my steps but omit a few steps, as explained by shadowsnipes, you still have nothing to lose since your original kernel sources and modules will still be intact. If you follow my second, shorter set of instructions without building the modules, you still have nothing to lose -- though I can't 100% guarantee that it'll work.
Just try it out. If it doesn't work, reboot back into your old kernel and try again. |
Just be sure to tell us what you actually did especially if you run into problems.
|
Hi,
I would like to add 'Linux Kernel in a Nutshell' as a must read. This link and others are available from 'Slackware-Links'. More than just Slackware® links! |
Quote:
Well, I followed these steps one by one. The mkinitrd I've got after using the script you told me and the one I used was: mkinitrd -c -k 2.6.24.5-smp -f ext3 -r /dev/sda3 -m mbcache:jbd:ext3 -o /boot/initrd.gz (by the way, should it be -smp or -custom?) When rebooting, I chose option Custom at the Slackware menu. The system started to boot and then it stopped showing the following messages: ---------------------------------------------------------------- No kernel modules found for linux 2.6.24.5-custom mount: mounting /dev/sda3 on /mnt failed: No such device ERROR: No sbin/init found on rootdev (or not mounted). Trouble ahead. You can try to fix it. Type 'exit' when things are done /bin/sh: can't access tty; job control turned off. --------------------------------------------------------------- Here it is part of my lilo.conf just to verify that I've added things correctly: --------------------------------------------- # Windows bootable partition config begins other = /dev/sda1 label = Windows table = /dev/sda # Windows bootable partition config ends # Custom bootable partition config begins image = /boot/vmlinuz-2.6.24.5-custom initrd = /boot/initrd.gz root = /dev/sda3 label = Custom read-only # Partitions should be mounted read-only for checking # Custom bootable partition config ends # Linux bootable partition config begins image = /boot/vmlinuz root = /dev/sda3 label = Linux read-only # Linux bootable partition config ends ---------------------------------------------- Please, let me know if you need any other kind of information to guide me. Thanks my friends! |
Quote:
Code:
mkinitrd -c -k 2.6.24.5-custom -f ext3 -r /dev/sda3 -m mbcache:jbd:ext3 -o /boot/initrd.gz Code:
mkinitrd -c -k 2.6.24.5custom -f ext3 -r /dev/sda3 -m mbcache:jbd:ext3 -o /boot/initrd.gz Looking through the default Slackware configuration, it does indeed look like the dash (-) is needed in LOCALVERSION to get the ideal syntax. You may be able to omit it as described above though. If not, you could recompile with the LOCALVERSION set to "-custom". |
In my directions I had said to use -custom, so the '-' would be included. So, T3slider's first mkinitrd command should work.
I know I had mentioned creating/editing /etc/rc.d/rc.modules-2.6.24.5-custom earlier, but I forgot to mention it in my last set of directions. Thanks for mentioning this T3slider. |
Quote:
I've just tried with (dash included): mkinitrd -c -k 2.6.24.5-custom -f ext3 -r /dev/sda3 -m mbcache:jbd:ext3 -o /boot/initrd.gz and then copying: cp /etc/rc.d/rc.modules-2.6.24.5-smp /etc/rc.d/rc.modules-2.6.24.5-custom without recompiling. Just wrote the two set of instructions above and restart the computer. The same error messages appear when rebooting. So, I am sure I am doing something wrong. Thank you! |
Hi Glore2002,
Actually it is really not that difficult to re-compile your kernel. At least I've tried many times these two days, from the slackware kernel to those vanilla kernel (just pay attention to those instruction you received here, and Alien's wiki page, the steps are actually not much different... and also read those documentations come with your slackware distribution, I am pretty shame that this is my first time that I really study all those documentations, lol). And I just re-built my laptop to have fully encrypted file system now (although it takes me more than 12 hours to dump my harddisk with /dev/random file ;-p) Anyway it is awesome now. I pretty enjoying breaking thing. Good luck. |
Quote:
Also, make sure rc.modules-2.6.24.5-custom is executable. Code:
chmod +x /etc/rc.d/rc.modules-2.6.24.5-custom Based on your errors, it is as if either the initrd is not working or you need more/different modules in it. You are using ext3 for your root file system, right? If not, that is your problem. Also, verify that Code:
/lib/modules/2.6.24.5-custom/kernel/fs/ext3/ext3.ko Other than that I don't know, as of right now, what needs to be done. Based upon the commands you have run it should be working (assuming your root fs is ext3). |
Almost, almost. We are almost getting it!
Well, after checking what Shadowsnipes suggested, I reboot and the same ERROR message appeared. Then (as he also said), I re-run lilo and restart. This was a big change. The booting process didn't show up the message. I was expecting X to start (with a smile on my face)...But it stopped don't letting me press any key. So, I've restarted the computer and change /etc/inittab to boot into command prompt (3) instead of directly into X (4). Then I restarted.
When the system booted up and at the command prompt $ I typed startx and the following error message showed up (I will write down the most important lines): ------------------------------------------------------------- : : Using config file: "/var/log/Xorg.0.log" Using config file: "/etc/X11/xorg.conf" Module "ramdac" already built in FATAL: Module nvidia not found Nvidia(0): Failed to load Nvidia kernel module! Nvidia(0) ***Aborting*** Scree(s) found but none have a usable configuration FATAL server error: no screens found giving up : : ------------------------------------------------------------- I think we are almost there friends! Just one more help, pleeeeaaaasssseeee :) Thanks!!! |
You have to rebuild the nvidia module if you compile a kernel. I would suggest using the SlackBuild at slackbuilds.org (if you are already using it, you should probably revert to the old X drivers before recompiling the nVidia module using nvidia-switch).
|
Yes, yes yes!!!!!!
$>free -m
total used free shared buffers cached Mem: 4051 283 3768 0 17 163 -/+ buffers/cache: 103 3948 Swap: 0 0 0 Yes! Thanks friends!!! I am running now Slackware 12.1 recognizing my 4Gb RAM. The last thing I've done is to download the NVIDIA drivers: wget http://us.download.nvidia.com/XFree8...43.05-pkg1.run Give it executable permissions: chmod 777 NVIDIA-Linux-x86-96.43.05-pkg1.run Installing drivers: sh NVIDIA-Linux-x86-96.43.05-pkg1.run I didn't let the installer create a new xorg.conf since I already had one working fine. Now, my system boots fine. I have to test it but I am sure it works OK (well. It's too soon to say so but I am an optimist :-) T3Slider, I've just read your recommendation about installing nvidia driver from slackbuilds.org. You think I should do that or is it the same? You've also mentioned about reverting to the old X drivers. How should I do that? One more question (Will it be the last one? :-) : After testing the new kernel compilation. If I see everything works fine How can I get rid of the old kernel files? Would you recommend that to me? Do these instructions do what I want? (I took this from one of Shadowsnipes previous replies): cd /usr/src/linux-2.6.24.5-custom make clean Thanks to you all! I am very sorry because of the time you spent helping me. I really appreciate what you did and I've learnt a lot from you. |
Quote:
Quote:
Quote:
|
OK. Solved!
OK T3slider, I'll leave everything the way it is. It will be safer, you're right.
The only thing I will do is comment those lines in lilo since I don't need them anymore (but this is just a detail). Thank you! :) Thanks to all of you who help during this thread. Glore2002.- |
Gotta like it, seeing someone stick with it till the happy ending; congrats Glore ;)
Sasha PS - Quote:
|
All times are GMT -5. The time now is 07:20 AM. |