dufault.info

Ramblings of a phone weenie, Linux sysadmin, and other things geeky

Hotswap a SCSI, SAS, or SATA drive in Linux

There seems to be not a lot of information on Google about this, thus, I post.
At my work, the majority of our servers have hot-swappable drive bays — however, Linux doesn’t usually automatically notice the drive is gone. Worse, sometimes it doesn’t even notice new drives hooked up.
Now, SCSI and SAS both support hot-plugging [...]

Installing libtidy in PHP5 on a CentOS cPanel server

To install libtidy in PHP5, it’s really quite easy.
Make sure your /tmp directory doesn’t have something like noexec set on it, otherwise this would be more difficult.
Here’s the install command:
pecl install http://pecl.php.net/get/tidy-1.2.tgz
Find where your main php.ini file is:
root@server [~]# php -i|grep php.ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini

Add the module to your [...]

The Linux Magic SysRq key

I find it shocking how many people don’t know about this neat Linux key combination that let’s you execute various low level commands regardless of the system’s state (as long as it’s running and hasn’t panicked.)
From the Wikipedia page:
It is often used to recover from freezes, or to reboot a computer without corrupting the filesystem.
How [...]

Forcibly Triggering a Kernel Panic on Linux

This might sound strange, as people usually want to fix or prevent these from happening, I’m trying to test/ create a method of logging kernel panic messages to a remote logging server. All of the existing tutorials I found on the net were for Linux 2.4, or were incomplete.
My method involves creating a Linux [...]

Installing a grsec-patched kernel on a CentOS 5 or RHEL 5 server

Here’s my little guide for upgrading a CentOS server to a grsec-patched kernel. At the time of this writing, this was the latest stable grsec patch available.
Fetch the sources:
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.5.tar.bz2
wget http://grsec.linux-kernel.at/grsecurity-2.1.11-2.6.24.5-200804211829.patch.gz
Extract:
tar xjf linux-2.6.24.5.tar.gz
gzip -d grsecurity-2.1.11-2.6.24.5-200804211829.patch.gz
Patch the kernel:
patch -p0 < grsecurity-2.1.11-2.6.24.5-200804211829.patch
cd linux-2.6.24.5 && make clean && make mrproper
Copy the previous kernel config to use:
cp [...]