≡ Menu


Red Hat Enterprise Linux 5.2 Released

Red Hat enterprise Linux version 5.2 has been released and available via a Red Hat Network subscription. This update brings broad refresh of hardware support and improved quality, combined with new features and enhancements in areas such as virtualization, desktop, networking, storage & clustering and security.

Virtualization of very large systems, with up to 64 CPUs and 512 GB of memory, is now possible. Virtualization support for NUMA-based architectures is provided, as well as security, performance, manageability and robustness improvements. CPU frequency scaling support for virtualized environments also allows for reduced power consumption.

Red Hat Enterprise Linux 5.2 provides enhanced capabilities for several hardware architectures, covering x86/x86-64, Itanium, IBM POWER and IBM System z, which provide improved performance, power usage, scalability and manageability. For example, support for Intel's Dynamic Acceleration Technology permits power saving by quiescing idle CPU cores, and offers performance gains by potentially overclocking busy cores within safe thermal levels. Other hardware enhancements include extensive device driver updates, covering storage, network and graphics devices, and certification of IBM's new Cell Blade systems.

Red Hat Enterprise Linux becomes a certified operating system for IBM's new high-performance blade server based on Cell Broadband Engine (Cell/B.E) Architecture.

Desktop version includes latest cutting edge softwares:

  • Evolution 2.12.3
  • Firefox 3
  • OpenOffice 2.3.0
  • Thunderbird 2.0

Red Hat Cluster Suite, which is included in Red Hat Enterprise Linux 5 Advanced Platform, now has a Resource Event Scripting Language that enables sophisticated application failover capabilities. It also newly supports SCSI-3 reservation fencing support for active/active and active/passive DM/MPIO (multipathing), which widens the range of storage devices that can be used in clusters.

Improved iSCSI support allows users to set-up diskless systems with a root volume on the iSCSI server, a common requirement in high-density Blade environments.

How do I upgrade my system?

First, make sure you backup existing configuration and data. Next, simply type the following two commands:
# yum update
# reboot

Verify that everything is working fine including all services:
# netstat -tulpn
# netstat -nat
# tail -f /var/log/messages
# egrep -i 'error|warn' /var/log/messages
# egrep -i 'error|warn' /path/to/apps/log/file

Alternatively, you can click on the "Red Hat Network Alert Notification GUI Tool" - which is a notifier that appears on the panel and alerts users when software package updates are available for the systems. This is point and click method.

If you are CentOS Linux user wait for some time to get all updates. More information available at Red Hat web site.

HowTo Use rsync For Transferring Files Under Linux or UNIX

How do you install and use rsync to synchronize files and directories from one location (or one server) to another location? - A common question asked by new sys admin.
[click to continue…]

Connecting Linux or UNIX system to Network attached storage device

Network attached storage (NAS) allows using TCP/IP network to backup files. This enables multiple servers in IDC to share the same storage for backup at once, which minimizes overhead by centrally managing hard disks. NAS is scalable, high performance network solution. The main advantage is more hard disk storage space added to a network that already utilizes servers without shutting them down for maintenance and upgrades.

Please note that NAS are not just common in IDC or offices but you can use it for file sharing and backup at home. You can purchase 200+GB NAS for less than $200 these days. Personally, I am using Maxtor ShareStorage 200GB Network Attached Storage at home. This is a step-by-step guide on connecting Linux or UNIX systems to SAN for backup or sharing files.

The protocol used with NAS is a file-based protocol such as NFS or Microsoft's Common Internet File System (CIFS). Both of them allow storing backups using UNIX and Linux servers or Windows 2003 server.

However many new Linux or UNIX sys admin find it difficult to use NAS backup. Here are quick handy tips most newbie will find useful.

(A) Use IP address of NAS. If you do not have properly configured SAMBA server it is difficult to resolve hostnames. IP address will save your time.

(B) If you are using IPTABLES or PF firewall then make sure the following UDP/TCP ports are open between your firewall and the NAS Backup Server:

  1. TCP 21 (ftp)
  2. TCP 20 (ftp-data)
  3. TCP/UDP 137 (NETBIOS Name Service aka netbios-ns)
  4. TCP/UDP 138 (NETBIOS Datagram Service aka netbios-dgm)
  5. TCP/UDP 139 (NETBIOS session service aka netbios-ssn )
  6. TCP/UDP 445 (Microsoft Naked CIFS aka microsoft-ds )

Sample network diagram

Following is sample network diagram for our setup:

+-------------+               +-------------+
|             |               |             |
|   N A S     |<=============>|   Linux/    |
|             |               |   UNIX      |
IP:              IP:

Iptables configuration

FTP outgoing client request using iptables (assuming that your server IP is and NAS IP is Append following iptables rules to your script:

iptables -A OUTPUT -p tcp -s --sport 1024:65535 -d --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -s --sport 21 -d --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s --sport 1024:65535 -d --dport 1024:65535 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp -s --sport 1024:65535 -d --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

NETBIOS/CIFS outgoing client request

Please add following rules to your iptables script:

iptables -A OUTPUT -p udp -s --sport 137 -d 0/0 --dport 137 -j ACCEPT
iptables -A OUTPUT -p udp -s --sport 138 -d 0/0 --dport 138 -j ACCEPT
iptables -A OUTPUT -p tcp -s --sport 1024:65535 -d --dport 139 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp -s --sport 137 -d --dport 137 -j ACCEPT
iptables -A INPUT -p udp -s --sport 138 -d --dport 138 -j ACCEPT
iptables -A INPUT -p tcp -s --sport 139 -d --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

Please note that when configuring a firewall, the high order ports (1024-65535) are often used for outgoing connections and therefore should be permitted through the firewall. It is prudent to block incoming packets on the high order ports except for established connections. This is what you are doing in above FTP and CIFS client request.

How do I access NAS server using FTP?

You need to use Internet file transfer program (FTP) that comes with UNIX/Linux or windows. Most service provider will provide you:

  • NAS Server IP (e.g. / nas.myserviceprovider.com)
  • NAS FTP Username (e.g. nixcraft)
  • NAS FTP Password (e.g. mySecret)

Let us assume you have file called mysqldump.tar.gz. You can put this file to NAS backup server using following ftp command:

$ ftp nas.myserviceprovider.com


$ ftp


Username: nixcraft
Password: mySecret
ftp> bin
200 Type set to I.
ftp> prom
Interactive mode off.
ftp> put mysqldump.tar.gz
ftp> quit

How do I access NAS server using SAMBA client?

Make sure you have samba client installed. Use apt-get or up2date command to install SAMBA client.

a) Create a directory

# mkdir /backup

b) Mount remote NAS share (NOTE: you must type following command on a single line)

# mount -t smbfs -o username=nixcraft,password=mySecret // /backup


# smbmount -o username=nixcraft,password=mySecret // /backup

You can skip password option for security reason (samba will prompt you for password).

c) Copy files using cp command:

# cp sitebackup.tar.gz /backup

d) You can use /backup directory to dump backup using mysql script or backup shell script.

A note for FreeBSD user

If you would like to access NAS server from FreeBSD use following command (NOTE: you must type following command on a single line):

# mkdir /backup
# mount_smbfs -I //nixcraft@ /backup



Related previous articles

Updated for accuracy.

How Do I Make Linux / UNIX Filesystem Backup With dd?

dd command is all in one tool to Copy a file, converting and formatting according to the options. Since Linux (and other UNIX versions) understand everything as a file dd works like wonders. Please note dd is not created specifically for a backup purpose but it is real handy tool. Few months back I was new to HP-UX and I was unable to understand the HP-UX tape devices then I used dd to create backup. Later when I got information of tape device name I switched to age old tar and other dump commands

dd command syntax

The syntax of dd is as follows:


dd command examples

So to backup /dev/hda3 under Linux command should be as follows i.e. linux filesystem backup with dd:
# dd if=/dev/hda3 of=/backup/myhostname-15-nov-05-hda3.bak.dd
However if you are running planning to run dd in background and if you wish to kill it or want to sending a SIGUSR1 single to a running dd process then you need to start dd as follows (this is really useful stuff):
# dd if=/dev/hda3 of=/backup/myhostname-15-nov-05-hda3.bak.dd; dpid=$!
Now use kill command as follows:
# kill -USR1 $dpid; sleep 5; kill $dpid

dd command to backup boot loader / MBR

dd can be use to backup your boot loader too (if you install a Windows after Linux it will destroy grub/lilo boot loader):
# dd if=/dev/hdX of=/backup/mbr.bak bs=512 count=1
You can restore MBR with the following dd command:
# dd if=/backup/mbr.bak of=/dev/hdX bs=512 count=1
Note replace hdX with your actual device name. However I prefer to use grub-install.

Please note that dd is also capable of reading tapes that were created on other UNIX or written in a format other than Unix (like Windows 2000 server).

Here is one more practical example for Solaris UNIX:

To copy all but the label from disk to tape i.e. copy data in 512 KiB blocks between a disk and a tape, but do not save or restore:
# (dd bs=4k skip=1 count=0 && dd bs=512k) </dev/rdsk/c0t1d0s2 >/dev/rmt/0
Copy from tape back to disk, but leave the disk label alone (restore):
# (dd bs=4k seek=1 count=0 && dd bs=512k) < /dev/rmt/0 >/dev/rdsk/c0t1d0s2

Backing up entire disk/partition with dd command

Backup /dev/hda to /dev/hdb:
# dd if=/dev/hda of=/dev/hdb conv=noerror,sync

  • /dev/hda: Source disk
  • /dev/hdb: Target disk
  • sync: Use synchronized I/O for data and metadata
  • noerror: Continue copy operation after read errors

Above command will only work if the both disks are the same size and C/H/S geometry. I strongly suggest using partition level backup. dd is an easy to use (real life saver) command. Read the man page of dd for more information.
$ man dd