Kroko Just another WordPress weblog

January 2, 2011

Linux force reboot/shutdown

Filed under: Linux — Tags: , , , , — admin @ 1:53 am

Forcing reboot

Linux is not Windows XP and if reboot fail you usually still connect by SSH and do something. This commands will show you how to remotely hard reboot machine. Hard reboot mean that shutdown scripts will not run and machine reboot immediately without syncing hard disk drives, shutdown applications etc, it’s more like hitting the reset button.

echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger

This commands enable sysrq and after this calls fast reboot. If you want to force shutdown machine try this.

Force shutdown

echo 1 > /proc/sys/kernel/sysrq
echo o > /proc/sysrq-trigger

Pasted from
This came handy, when I had a server that had some IO error and it can no longer read from disk, only few cached binaries into memory kept it running (kernel, SSHD, bash), I could still access the machine via SSH but can no longer do anything, forcing the reboot as mentioned above was my only resort, and it worked like charm…

September 19, 2010

Xen on centos 5.5

Filed under: Linux — Tags: , , , , , — admin @ 10:49 pm

Xen Guest OS boot error looks like:

Mounting root filesystem.
mount: could not find filesystem '/dev/root'
Setting up other filesystems.
Setting up new root fs
setuproot: moving /dev failed: No such file or directory
no fstab.sys, mounting internal defaults
setuproot: error mounting /proc: No such file or directory
setuproot: error mounting /sys: No such file or directory
Switching to new root and running init.
unmounting old /dev
unmounting old /proc
unmounting old /sys
switchroot: mount failed: No such file or directory
Booting has failed.

The most common cause of this problem is a conflict of SCSI modules. In order to resolve this it is necessary to create a new initrd initialization RAM Disk without SCSI modules, and then use this to boot the guest Linux operating system. This can be achieved using the following command:

mkinitrd --omit-scsi-modules --with=xennet --with=xenblk --preload=xenblk initrd-$(uname -r)-no-scsi.img $(uname -r)
move the file to /boot

Once the new initrd image file has been generated simply refer to it in the “ramdisk” line of the Xen configuration file, for example:

kernel = "/boot/vmlinuz-2.6.18-194.3.1.el5xen"
ramdisk = "/boot/initrd-2.6.18-194.3.1.el5xen-no-scsi.img"
memory = 1024
name = "centos5"
vif = [ 'mac=00:16:36:4c:87:c3,bridge=virbr0,script=vif-bridge' ]
disk = ['tap:aio:/xen/centos.img,xvda1,w', 'tap:aio:/xen/centos.swap,xvda2,w']
root = "/dev/xvda1 ro"

December 1, 2008

Extra Packages for Enterprise Linux… CentOS !

Filed under: Linux — Tags: — admin @ 2:20 pm

Why has it taken me so long to spot this ? Looks like this draft was written on the 13th May, if I hadn’t have been just about to download FC7 then I’d have missed it !

EPEL – Fedora Project Wiki
EPEL is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs like CentOS or Scientific Linux.

About time, and thank you redhat/fedora, want fedora extra packages in centos, then install this epel-release .rpm frickin’ sweet ! 

Powered by WordPress