04 December, 2006

Linux Hacks

Tike these.
For instance,

Get faster file transfer by using 32-bit transfers on your hard drive
Just add the line:

hdparm -c3 /dev/hdX

to a bootup script.

If you use SuSE or other distros based on SYS V,

/sbin/init.d/boot.local
should work for you.
This enables 32-bit transfer on your hard drive. On some systems it can improve transfer performance by 75%.

To test your performance gain, type:

hdparm -t -T /dev/hdX

CPU Scaling

And more
Thanks to Larry Reeder

When I got my 600m, the CPU speed never went above 600 MHz, as shown by cat /proc/cpuinfo, or Gnome's CPU Frequency Scaling applet. I couldn't set the CPU frequency manually, and it wouldn't go up automatically when I was doing a long build. I was beginning to think that the 600m in "Inspiron 600m" stood for 600 MHz.

I was getting a "No speed steps could be determined" error every time I tried to run /etc/init.d/cpuspeed. After trying many things, I noticed that both scaling_max_freq and scaling_min_freq in /sys/devices/system/cpu/cpu0/cpufreq were set to 600000 (600 MHz).

I did: echo 2100000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq and then /etc/init.d/cpuspeed restart

After that the CPU would throttle up to meet demand, and I could also change the speed manually with the Gnome CPU frequency applet.
If you're trying to set various cpuspeed options, I recommend running the commands in /etc/init.d/cpuspeed manually, instead of using the cpuspeed script, which hides many possible error messages when the script has problems. Once you have the options you need, you can go back to using the cpuspeed script.

03 December, 2006

NVidia and FC6

For some reason Anaconda likes i586 kernels, and installs them by default. This upsets the system, and the NVidia compatibility in particular. I attempted to install a new driver (9629 or 9626) after installing a new kernel (2.6.18-1.2835) . There's a day of my life I want back. 9629 later turned out to have a bug that causes a "segmentation fault" upon any glx-related call. 9626 was reputed as one that should work, but refused to install (i.e. compile the kernel source). This glitch was finally fixed by touching a file called config.h (sought by the NVidia code in the kernel source tree). Namely : /usr/src/kernels/$(uname -r)-i686/include/linux/ .

Suspend to RAM

Apparently this feauture tends to break once new NVidia drivers (for 3-D support, on FC6 in my case) are installed. Here's the workaround.
(Courtesy of Firewing1)
1) Make backups of files we're going to edit and install pm-utils:
Code:

su -
yum install pm-utils
cp /etc/pm/functions-nvidia /etc/pm/functions-nvidia.backup
cp /boot/grub/grub.conf /etc/grub.conf.backup

Now, edit the /etc/pm/functions-nvidia and commend out this line:
Code:

/usr/sbin/vbetool post

in the resume_video() so that the line ends up looking like this:
Code:

### /usr/sbin/vbetool post

NOTE: I don't even own a ATi card so I can't test, but if you're seeing similar black screens on a suspend resume, then try editing all the files in /etc/pm and commenting out that line.

2) Next, we have to remove the built-in AGP support and use Nvidia's AGP driver. So, let's edit the /boot/grub/grub.conf, and add agp=off to the kernel line.
See a line like this:
Code:

kernel /vmlinuz-2.6.16-1.2096_FC5 ro root=LABEL=/ quiet

agp=off should be added to the end to look like:
Code:

kernel /vmlinuz-2.6.16-1.2096_FC5 ro root=LABEL=/ quiet agp=off

Your line may look a little different or the kernel version in the /vmlinuz-... path may not be the same. Please don't change that part, like last time this is just to show where to add the text.
3) Reboot, and you're good to go. Hitting the "suspend" button will put the computer into power-saving mode, and all your previous windows and applications will return to their previous state on resume. I tested with gnome-power-manager:
Code:
yum install gnome-power-manager --enablerepo=development
yum update gnome-power-manager --enablerepo=development

That will install / update it to the version I used successfully.