Task: On RHEL 6 64-bit, perform online resize of filesystem /journal from 50GB to 100GB. That filesystem is part of multipath device brc001_journal_pv.
August 28, 2012
Serial console in RHEL 6
There are changes between RHEL5 and RHEL6 about how to setup serial console. In RHEL 6 you no longer specify it in /etc/inittab, but leave it on upstart daemon work.
And initialize console with:
# initctl start ttyS0
Add serial and terminal lines to menu.lst as above plus append "
1. If you DONT WANT to have serial console as your default console:
# cat /boot/grub/menu.lst default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1 terminal --timeout=10 serial console hiddenmenu title Red Hat Enterprise Linux (2.6.32-131.0.15.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-131.0.15.el6.x86_64 ro root=/dev/mapper/rootvg-rootvol rd_LVM_LV=rootvg/rootvol rd_LVM_LV=rootvg/swapvol rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto quiet console=ttyS0,9600n8 console=tty0 initrd /initramfs-2.6.32-131.0.15.el6.x86_64.img # grep ttyS0 /etc/securetty ttyS0 # cat /etc/init/ttyS0.conf start on runlevel [345] stop on runlevel [S016] respawn instance /dev/ttyS0 exec /sbin/agetty ttyS0 9600 vt100-nav
And initialize console with:
# initctl start ttyS0
2. If you DO WANT to have serial console as default console:
Add serial and terminal lines to menu.lst as above plus append "
console=tty0 console=ttyS0,9600" to kernel line in /boot/grub/menu.lst
Thats all, as upstart will automatically start serial login process on last specified console parameter extracted from kernel line (in this case ttyS0).
July 30, 2012
How to create ultra small Linux machine on Amazon EC2
If you are using amazon aws services, you know that by default Amazon will let you use virtual machine with 8GB root filesystem. But sometimes you are using under 2GB of actual space, so why not to shrink this machine and pay only for 2GB instead of 8GB? This mini-tutorial is for that.
June 22, 2011
Set outgoing IP address in Solaris 10
root@sol3 # route get default
route to: default
destination: default
mask: default
gateway: 192.168.168.2
interface: e1000g0:1
flags:
recvpipe sendpipe ssthresh rtt,ms rttvar,ms hopcount mtu expire
0 0 0 0 0 0 1500 0
root@sol3 # ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g0: flags=9040843 mtu 1500 index 2
inet 192.168.168.31 netmask ffffff00 broadcast 192.168.168.255
groupname prodgr
ether 0:c:29:20:e6:9
e1000g0:1: flags=1000843 mtu 1500 index 2
inet 192.168.168.41 netmask ffffff00 broadcast 192.168.168.255
e1000g0:2: flags=1000843 mtu 1500 index 2
inet 192.168.168.51 netmask ffffff00 broadcast 192.168.168.255
e1000g1: flags=69040843 mtu 1500 index 3
inet 192.168.168.32 netmask ffffff00 broadcast 192.168.168.255
groupname prodgr
ether 0:c:29:20:e6:13
root@sol3 # route delete default 192.168.168.2
delete net default: gateway 192.168.168.2
root@sol3 #
root@sol3 # route add default 192.168.168.2 -setsrc 192.168.168.51
add net default: gateway 192.168.168.2
root@sol3 # route get default
route to: default
destination: default
mask: default
gateway: 192.168.168.2
setsrc: 192.168.168.51
interface: e1000g0:1
flags:
recvpipe sendpipe ssthresh rtt,ms rttvar,ms hopcount mtu expire
0 0 0 0 0 0 1500 0
route to: default
destination: default
mask: default
gateway: 192.168.168.2
interface: e1000g0:1
flags:
recvpipe sendpipe ssthresh rtt,ms rttvar,ms hopcount mtu expire
0 0 0 0 0 0 1500 0
root@sol3 # ifconfig -a
lo0: flags=2001000849
inet 127.0.0.1 netmask ff000000
e1000g0: flags=9040843
inet 192.168.168.31 netmask ffffff00 broadcast 192.168.168.255
groupname prodgr
ether 0:c:29:20:e6:9
e1000g0:1: flags=1000843
inet 192.168.168.41 netmask ffffff00 broadcast 192.168.168.255
e1000g0:2: flags=1000843
inet 192.168.168.51 netmask ffffff00 broadcast 192.168.168.255
e1000g1: flags=69040843
inet 192.168.168.32 netmask ffffff00 broadcast 192.168.168.255
groupname prodgr
ether 0:c:29:20:e6:13
root@sol3 # route delete default 192.168.168.2
delete net default: gateway 192.168.168.2
root@sol3 #
root@sol3 # route add default 192.168.168.2 -setsrc 192.168.168.51
add net default: gateway 192.168.168.2
root@sol3 # route get default
route to: default
destination: default
mask: default
gateway: 192.168.168.2
setsrc: 192.168.168.51
interface: e1000g0:1
flags:
recvpipe sendpipe ssthresh rtt,ms rttvar,ms hopcount mtu expire
0 0 0 0 0 0 1500 0
February 10, 2010
rTorrent patch - almost linear downloading
Are you rTorrent user? Want to play .avi files as soon as possible, while downloading? Then maybe this patch will you find handy. Info: tested on rtorrent/libtorrent 0.8.5/0.12.5 All changes are affecting only one file: libtorrent-0.12.5/src/download/chunk_selector.cc
Update, May 2010: Patch applicable to rtorrent 0.8.6/0.12.6
Update, May 2010: Patch applicable to rtorrent 0.8.6/0.12.6
November 23, 2009
IP multipathing with RHEL 5
In this page you can find sample working configs, which do following:
- setup two bond interfaces (bond0, bond1) with 802.3ad support
- setup two aliases for bond0
- setup two VLANs on bond1
- setup custom routes for these VLANs
- setup default gw trought bond0
All this we make on RedHat Linux 5.4, server is SunFire x4150 with 4x onboard ethernet devices.
- setup two bond interfaces (bond0, bond1) with 802.3ad support
- setup two aliases for bond0
- setup two VLANs on bond1
- setup custom routes for these VLANs
- setup default gw trought bond0
All this we make on RedHat Linux 5.4, server is SunFire x4150 with 4x onboard ethernet devices.
IO multipathing with RHEL 5
In this post, we describe working IO multipathing configuration. Used technologies: RedHat Linux 5.4 64bit, 2x SunFire x4150, Sun StorageTek 2540, 2x Qlogic FC HBA.
November 22, 2009
Turn on word wrapping in "pre" tag
On Blogger, you need to edit template to turn on wrapping of tag "pre", otherwise long lines are not showing correctly. So paste this to your template:
pre {
white-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */
white-space: -pre-wrap; /* Opera 4 - 6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS3 */
word-wrap: break-word; /* IE 5.5+ */
background: #dddddd;
display: block;
padding: 0.5em 1em;
border: 1px solid #bebab0;
}
November 4, 2009
Redhat 5 + serial console setup
Here is quick setup of serial console for RedHat 5. It works for other linux distros too.
# grep agetty /etc/inittab S0:12345:respawn:/sbin/agetty ttyS0 9600 vt100-nav # grep SAFE /etc/sysconfig/kudzu SAFE=yes # grep ttyS0 /etc/securetty ttyS0 # cat /boot/grub/menu.lst default=0 timeout=5 hiddenmenu serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1 terminal --timeout=10 serial console title Red Hat Enterprise Linux Server (2.6.18-164.2.1.el5) root (hd0,0) kernel /vmlinuz-2.6.18-164.2.1.el5 ro root=/dev/VolGroup00/rootvol console=tty0 console=ttyS0,9600n8 quiet initrd /initrd-2.6.18-164.2.1.el5.img
August 22, 2008
Installing geoip netfilter module under fedora 9
Just few tips, after you have patched current kernel sources and iptables, you want now compile geoip module (not whole kernel).
So in kernel sources dir, where is also Makefile, execute this commands:
So in kernel sources dir, where is also Makefile, execute this commands:
make modules_prepare
make -C $(pwd) M=net/netfilter/ modules
cp net/netfilter/xt_geoip.ko /lib/modules/`uname -r`/extra/
depmod -a
modprobe xt_geoip
April 29, 2008
Using .htaccess files easy way
If you have configured .htaccess file in your public_html like this...
... you will have problem to allow guest to read subdir without entering password. Thats why this .htaccess file will help you:
cat ~/public_html/private/.htaccess
AuthType Basic
AuthUserFile /path/to/homedir/public_html/private/.htpasswd
AuthGroupFile /dev/null
AuthName AnyNameYouLike
require valid-user
... you will have problem to allow guest to read subdir without entering password. Thats why this .htaccess file will help you:
cat ~/public_html/private/guestok/.htaccess
AuthName AnyNameYouLike
Allow from all
Satisfy any
Tags:
htaccess
April 6, 2008
Setup Debian Etch on NSLU2 for torrent downloading
Hi, if you don't already have cheap, small, power efficient and silent file server at home, meet NSLU2. This is way of setting up Debian after its installing for more or less torrent downloading.
Tags:
nslu2
March 6, 2008
Shape application easy way
Want to limit bandwidth for some specific program in userspace? Use trickle!
Example for shaping scp download to 100KB/s:
Example for shaping scp download to 100KB/s:
trickle -d 100 scp remote.host.ip:big_file.iso .
February 15, 2008
Make kernel module 2.6
To make kernel module under kernel 2.6, just rename module and execute make.
# cat Makefile
obj-m := ptpatch2008.o
KDIR := /lib/modules/`uname -r`/build
PWD := `pwd`
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
February 7, 2008
Subscribe to:
Posts (Atom)