Archive for January, 2013

SBDavid

GRUB 2 boot prompt

GRUB 2 boot prompt

If improperly configured, GRUB 2 may fail to load and subsequently drop to a boot prompt. To address this issue, proceed as follows:

1. List the drives which GRUB 2 sees:

grub2> ls

2. The output for a dos partition table /dev/sda with three partitons will look something like this:

(hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1)

3. While the output for a gpt partition table /dev/sda with four partitions will look something like this:

(hd0) (hd0,gpt4) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)

4. With this information you can now probe each partition of the drive and locate your vmlinuz and initramfs files:

ls (hd0,1)/

Will list the files on /dev/sda1. If this partition contains /boot, the output will show the full name of vmlinuz and initramfs.

5. Armed with the location and full name of vmlinuz and initramfs you can now boot your system.

SBDavid

Sharing Write Permission

Sharing Write Permission

For more than one user to be able to write to the same directory it will be necessary to grant write permission to a group they share in common. The following example grants shared write permission to /var/www to the group “webmasters”.

sudo chgrp -R webmasters /var/www
sudo find /var/www -type d -exec chmod g=rwxs “{}” \;
sudo find /var/www -type f -exec chmod g=rws “{}” \;

EXAMPLES

chgrp staff /u
Change the group of /u to “staff”.

chgrp -hR staff /u
Change the group of /u and subfiles to “staff”.

SBDavid

Super Grub2 Disk

Super Grub2 Disk

The primary purpose of Super GRUB2 Disk is to help you boot into an OS whose bootloader is broken.

Second, and almost as important, is to be a tool to learn more about GRUB2 and the booting process.

Difference between Super GRUB Disk and Super GRUB2 Disk

GRUB2 is a complete rewrite of GRUB, and Super GRUB2 Disk is a complete rewrite as well.
As Super GRUB2 Disk uses GRUB2, the differences between GRUB Legacy and GRUB2 also apply to the different versions of Super GRUB Disk.

Perhaps the most notable difference between Super GRUB Disk based on grub legacy and Super GRUB2 Disk is that Super GRUB2 Disk does not write to the disk at all, and so cannot rewrite the MBR. Super GRUB2 Disk can only be used to boot a broken system, it cannot fix it directly. Though once a system is booted, re-installing grub is usually just a matter of running “grub-install /dev/sda”.

SBDavid

Finding zombie processes

Finding zombie processes

If you have a server which is not working very well, it is possible that the process that you want to use is in a zombie state. You can see that there is a zombie process with top for example.

But with top you can’t not always see which process it is.

If we use the following command we can see which process are zombies.

ps -el | grep ‘Z’

With a normal ps -el command you see an output with in the second column the state of the process.

Here are some states:

S : sleeping
R : running
D : waiting
Z : zombie (defunct)

How to generate a crash dump on Redhat Linux

The Red Hat Crash Utility is a kernel-specific debugger. It is usually used for performing postmortem system analysis when the system panicked, locked up, or appears unresponsive.

Starting with the Red Hat Enterprise Linux 3 release, the crash utility is automatically installed during the system installation if the Development Tools package set is selected.

Test that Diskdump works. The following commands will crash your machine:

# echo 1 > /proc/sys/kernel/sysrq
# echo c > /proc/sysrq-trigger

Make sure that you run the above two commands in console (press Ctrl + Alt + F1), so that we can see what is happening when your system crashes. You have to perform this so that you can have a vmcore file to follow the rest of the paper. It will be located at /var/crash.

Next »