Monthly Archives: November 2008

How to enable the serial port on XEN servers

0
Filed under HOWTO\'s

XEN uses /dev/ttyS0 for it’s own internal console, which is a neat way to manage the XEN server and access the console from another machine.

But, this also means that you won’t be able to use the computer / server’s serial port to access for instance a network switch or serial UPS from Linux.

If you would rather use the serial port to access serial devices, then you need to modify the grub menu file (/boot/grub/menu.lst) as follows:

Original grub menu:
[sourcecode language='sh']

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/System/root
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-92.1.18.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-92.1.18.el5
module /vmlinuz-2.6.18-92.1.18.el5xen ro root=/dev/System/root rhgb quiet
module /initrd-2.6.18-92.1.18.el5xen.img

[/sourcecode]

Modified Grub menu:

[sourcecode language='sh']
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/System/root
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-92.1.18.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-92.1.18.el5
module /vmlinuz-2.6.18-92.1.18.el5xen ro root=/dev/System/root rhgb quiet xencons=tty6
module /initrd-2.6.18-92.1.18.el5xen.img
[/sourcecode]

As you can see, I have added the line xencons=tty6 after the “module /vmlinuz-2.6.18-92.1.18.el5xen” line to tell XEN to use /dev/tty6 console instead.

Other options are:

xencons=off disable console at all
xencons=ttyX attach console to /dev/ttyX
xencons=ttySX attach console to /dev/ttySX
xencons=xvcX attach console to /dev/xvcX

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

Looking for large files on your Linux server

0
Filed under Hot Tips

I often need to find out what’s using up a lot of space in a user’s folder, or on a backup server.

The easiest way is to use Linux’s “du” or Disk Usage command.

The following command will show you the sizes of the different folders, and will only display it on that level – i.e it won’t show you the sub-folders:

[sourcecode language='sh']
du -h –max-depth=1 ./
[/sourcecode]

Alternatively you can use find, as such:

[sourcecode language='sh']
find / -size +2G -print
[/sourcecode]

This will find all files larger than 2GB

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

How to recover (and even rename) a broken LVM volume

0
Filed under Hot Tips

I was looking for a way to rename a Logical Volume on a Linux system, and found the following website useful.

Unfortunately my attempt to rename a LVM based Linux installation failed miserably, and it never booted. So, I’ll have to retry it sometime later again.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

How to change file & folder permissions recursively in Linux

0
Filed under Linux, cPanel

Often times it’s necessary to change the permissions on many files & folders recursively – i.e. change the permisssions on every file & folder.

Todo so, login to your Server via SSH, and run the following commands as root.

1
2
3
 
find /home/username/public_html/ -type d -exec chmod 755 {} \;
find /home/username/public_html/ -type f -exec chmod 644 {} \;

The first line will change all folders (the “d” specifies directory) to mode 755
The second line will change all files to mode 644.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis