Surviving "How To"

Hard drive is dying! No chance to replace the drive!

The process includes identifying bad blocks, saving them on a file, and then feeding the file to fsck to check and fix any issues.

To identify bad blocks: # badblocks /dev/hdb9 | tee ./badblocks.hdb9

Then try to use fsck to fix issues: # fsck -t ext4 -l ./badblocks.hdb9 /dev/hdb9

Also, S.M.A.R.T. can be used to check your drives:

smartctl -t long /dev/hdb ## [wait until test completes, then]
smartctl -l selftest /dev/hdb

Prepairing kernel source package for building modules

Unpack kernel srcpkg to /usr/src directory. Rename the unpacked %%.srcpkg to linux-`uname -r`. Then use the following:

cd /usr/src/linux-`uname -r`
gunzip -c /proc/config.gz >./.config
make oldconfig && make prepare && make scripts

After that, try to build your module… Ha-ha! Got "ld: arch/powerpc/lib/crtsavres.o: No such file: No such file or directory"? Don't worry, me did too :) Just return to kernel source tree and build crtsavres.S:

cd /usr/src/linux-`uname -r`
make arch/powerpc/lib/crtsavres.o

Now you will be able to build kernel modules using these kernel sources.

I'm out of RAM/swap! I do have twice the real memory apps do want! Kernel just kills all my apps!

[1318424.727218] Out of memory: Kill process 14012 (genautomata) score 371 or sacrifice child
[1318424.727237] Killed process 14012 (genautomata) total-vm:302224kB, anon-rss:300840kB, file-rss:88kB

If you did 'free' and got zero swap, you would do 'swapon -a' first, and then, if it prints something, 'blkid -c /dev/null'
and also 'ls -l /dev/disk/by-uuid'. Then you do need to edit your /etc/fstab file to match value(s) reported by blkid utility.

Or, just pass in the swap device directly in /etc/fstab without any uuid, that's the simplest solution.

About OOM kernel-killer see also: VM Overcommit and Linux memory overcommit.

shm_open() failed: Permission denied

If you get the "shm_open() failed: Permission denied" error message, there is a simple solution. Just add the following line to your /etc/fstab file:

shm        /dev/shm    tmpfs    nodev,nosuid,noexec    0    0

After that use (as root):

# mount shm

After these steps the error should disappear.

Unless otherwise stated, the content of this page is licensed under GNU Free Documentation License.