Category Archives: Uncategorized

Journaled file systems structure



Superblock : File System size and indentification, Free list, fragment size, nbpi.

Inodes: File size, ownership, permissions, pointers to data blocks.

Blocks: Data blocks contain data and Indirect block contain pointers to data blocks.

Journaled file systems are built within logical volumes. Because journaled file systems exist within logical volumes, the size of the file system always multiples of the logical partition size for that logical volume (for example, 4 MB). An individual file within a file system will by default have units allocated to it in blocks of  4096 bytes. (This may change if you have implemented fragmentation or large files – to be discussed later.)
Some unix commands often report file sizes in units of 512 bytes to remain compatible with other UNIX file systems. This is independent of the actual unit of allocation. The first addressable logical block on the file system is the superblock. The superblock contains information such as the file system name, size, number of inodes, date/time of creation.
The superblock is critical to the file system and if corrupted, prevents the file system from mounting. For this reason a backup copy of the superblock is always written in block 31. Uempty Immediately following the superblock are inodes which contain identifying information for files such as the file type, size, permissions, user/group/owner, create/modification and last
access dates. They also contain pointers to the data block for fragment addresses which hold the data. For larger files the system creates sets of indirect blocks filled with data block addresses to point to the data block or fragments which hold the data.

Find and remove Files in Unix older than the specified number of days

For finding the files older than 31 days

find . -name “filename.ext” -mtime +no_of_days -exec ls -ltr {} ; e.g   find . -name “*req” -mtime +31 -exec ls -ltr {} ;

Verify the timestamp of all the files.They must be older than 5 weeks For Deleting files older that 31 days :

find . -name “*req” -mtime +31 -exec rm {} ;

Verify after execution of the above.

Execute:  find . -name “*req” -mtime +31 -exec ls -ltr {} ;

Linux: iSCSI Initiator installation & configration

Installation Instructions:

Red Hat Supplied iSCSI Initiator:

Find the RPM on the Red Hat Media, then install it using the rpm –ivh command as follows:

# rpm –ivh iscsi-initiator-utils-

NOTE: This is the version for Enterprise Linux AS 5. Your version may be different.

An alternative to installing this package manually in Red Hat Enterprise Linux (ES or AS) 5 or greater is to use the “Add/Remove Applications” menu item in the “System Settings” menu. In the details for the “Network Servers” package list, the iscsi-initiator-utils is one of the packages listed. This same choice is available in the same location during the initial install of Red Hat, so this can also be done at that time.

Once installed, there will be a file in the /etc directory named iscsi.conf. If this file does not exist this may indicate a problem with the installation. This file can be created with the following minimal entries:



This needs to be set to the Group IP Address of your UIT Array.


For the initiator to receive Vendor Specific async events from the target.


To globally specify that all discovery sessions be kept open.

Within the iscsi.conf file itself there are many more options available that can be set. You can look through the iscsi.conf file for information on what these variables are and what they are used for.

Once these values are either placed in a newly created /etc/iscsi.conf file, or the respective lines are uncommented and edited where necessary, the iscsi service can be started:

# service iscsi start

To verify that the iscsi service will be started at boot time, the chkconfig command can be used as follows:

# chkconfig –list iscsi

iscsi 0:off 1:off 2:off 3:off 4:off 5:off 6:off

By default, the newly added iscsi initiator is not enabled at boot which is the reason for each of the run levels listed to have the service set to off. To enable this at boot, again use the chkconfig command as follows:

# chkconfig –add iscsi

# chkconfig iscsi on

The above two commands first checks to be sure there are the necessary scripts to start and stop the service, then it sets this service to be on for the appropriate runlevels.

Then check to be sure the changes took effect:

# chkconfig –list iscsi

iscsi 0:off 1:off 2:on 3:on 4:on 5:on 6:off

To verify that you can see your iscsi devices, you can run the following command:

# iscsi-ls


SFNet iSCSI Driver Version … 6.2 (27-July-2009 )



TARGET ALIAS : pat-rhel5-vol2


BUS NO : 0






SESSION ID : ISID 00023d000001 TSIH 06


To see greater details of the devices, you can run the above command with the –l option:

# iscsi-ls –s


SFNet iSCSI Driver Version … 6.2 (27-Jun-2009 )



TARGET ALIAS : pat-rhel5-vol2


BUS NO : 0






SESSION ID : ISID 00023d000001 TSIH 06



LUN ID : 0

Vendor: EQLOGIC Model: 100E-00 Rev: 2.1

Type: Direct-Access ANSI SCSI revision: 05

page83 type3: 0690a018007082143638c4d6ef067098

page80: 3036393041303138303037303832313433363338433444364546303637303938

Device: /dev/sdc


As can be seen in the example iscsi-ls –l output above, the device in question is mapped to the /dev/sdc device.

Linux-iscsi Sourceforge Initiator:

If you are not running the required update of Red Hat Linux to have their precompiled iSCSI Initiator, you can try to compile the iSCSI Initiator supplied by the Sourceforge linux-iscsi project.

Beyond the required kernel revision as noted above, all development packages need to be installed for the compiling of the initiator as well as the kernel sources. The easiest way to install these items is to us the “Add/Remove Applications” in the “System Settings Menu” from within the Desktop GUI. Depending on the version of Red Hat you are running will determine what you select to be installed:

Red Hat AS 3:

Development Tools (Default packages have all required packages)

Kernel Development (Again, default is fine)

Red Hat AS 4:

Development Tools (Default packages have all required packages)

NOTE: If there is no Kernel Development choice, the Kernel Source files need to be found and installed prior to compilation.

Once these OS packages are installed, it should be as easy as getting the source package from the Sourceforge linux-iscsi project, then making the initiator. Refer to the README file that comes with the source for detailed instructions on how to make the initiator. If there are problems compiling the initiator, check the linux-iscsi Sourceforge project for assistance. You are able to search and post to their mailing lists to get information and assistance with this product.

Persistent Device naming:

Devices using the Red Hat software initiators do not have a persistent naming scheme, but a few ways to setup Persistent Naming for the different versions of Red Hat are as follows:

Red Hat Enterprise Linux (ES or AS) 3:

Devlabel (see the devlabel man page):

This will only work on Red Hat kernel’s 2.4.x.

Use devlabel to setup symlinks from known names to the current device name.

A basic add command to setup a devlabel link is as follows:

# devlabel add –d -s

An example:

sdc –s /dev/iscsi/vollink

# ls –l /dev/iscsi/vollink

lrwxrwxrwx 1 root root 8 Dec 1 16:31 newvol -> /dev/sdc

Red Hat Enterprise Linux (ES or AS) 4:

Use the udev facility (man udev, man scsi_id):

This is only available on Red Hat EL 4/Kernel 2.6.*

This creates device links to the device files when the device nodes are created. Udev uses a rules file (see man udev) to determine what the link names or device names it should create for different devices.

This is the least elegant of the solutions to configure and there is no straightforward example to provide on how this needs to be setup.

Red Hat may be able to provide additional information on persistent device naming for iSCSI devices using their iSCSI initiator with udev.

Both Red Hat Enterprise Linux 3 and 4:

Use filesystem LABELs (see the e2label man page):

This will work on all ext2/3 filesystem partitions.

Place an ext2/3 filesystem label on your filesystem partition. Once the Label has been added, use the LABEL identifier to identify the filesystem you want to mount in the fstab (man fstab and/or man mount). Following is an example of using the e2label command and what a resulting line in the fstab file would look like:

# e2label /dev/sdc1 EMC

# mkdir /EMC

# echo “LABEL=EMC /EMC ext3 _netdev,defaults 0 0” >> /etc/fstab

NOTE: _netdev delays the mounting of this filesystem until after the Network has been started and ensures that the filesystem is unmounted before stopping the Network.

# mount –a

# df –k | grep EMC

/dev/sdc1 5166332 43072 4860816 1% /EMC

Red Hat Linux iSCSI Configuration

Supported iSCSI Initiators:

Enterprise Linux (ES or AS) 3 Update 6:

Disc 2 of 4:


linux-iscsi 3.4.x: Minimum kernel release: 2.4.21

linux-iscsi 3.6.x: Minimum kernel release: 2.4.21

NOTE: Versions of the linux-iscsi Initiator above 3.x are not compatible with the 2.4.x and below kernel release.

Enterprise Linux (ES or AS) 4 Update 2:

Disc 4 of 4:



4.0.2 – Mnimum kernel release: 2.6.10

4.0.1 – minimum kernel Release: 2.6.0

NOTE: Versions of the linux-iscsi Initiator below 4.x are not compatible with the 2.6.x and higher kernel release.

Solaris: Steps to install a zone

Prerequisites to configuration

  1. create a directory for the root of your non-global zone, mkdir /export/zones/dzone1.
    chown root:root /export/zones/dzone1; chmod 700 /export/zones/dzone1
  2. create a 1G partition for the non-global zone root file system
  3. add filesystems to any volumes you have created from steps above
  4. mount your additional space for the root of your new zone (add to vfstab in global zone 0)


  1. zonecfg –z dzone1
  2. create
  3. set zonepath=/dzone1
  4. set autoboot=true
  5. add inherit-pkg-dir
  6. set dir=/opt
  7. end
  8. add net
  9. set address=[IP-ADDRESS]
  10. set physical=hme0
  11. end
  12. (could add a device here, but don’t believe it necessary for right now, we’ll see what we get by default)
  13. add rctl
  14. set name=zone.cpu-shares
  15. add value (priv=privileged,limit=20,action=none)
  16. end
  17. add attr
  18. set name=comment
  19. set type=string
  20. set value=”First test zone”
  21. end
  22. verify
  23. commit
  24. exit


    1. zoneadm –z dzone1 verify
    2. zoneadm –z dzone1 install
      1. if you get an error message during install check the state
      2. zoneadm –z dzone1 list –v
      3. if state is “configured” make corrections specified in the messateg and install the zone again
      4. if state is “incomplete” remove the zone
      5. zoneadm –z dzone1 uninstall
      6. make corrections and install the zone again
    3. style=”MARGIN-TOP: 0in” type=a>
    4. should report the zone is “installed”
  1. y
  2. zoneadm list –v

    1. should report the zone is “ready”
  3. –z dzone1 boot
  4. zoneadm list –v

    1. should report the zone is “running”

2 style=”MARGIN: 12pt 0in 3pt”>font>

  1. zlogin –C dzone1
    1. hit return
    2. select 3 DEC VT100
    3. enter hostname for the zone
    4. hit esc-2 to continue
    5. hit esc-2 to continue
    6. be sure NO is checked for kerberos security
    7. hit esc-2 to continue
    8. hit esc-2 to continue
    9. select DNS for name service
    10. esc-2 to continue
    11. enter for domain
    12. esc-2 to continue
    13. enter [IP-ADDRESS] for the first IP
    14. enter [IP-ADDRESS] for the second IP
    15. esc-2 to continue
    16. enter for search domain
    17. esc-2 to cont
    18. confirm information
    19. esc-2 to cont
    20. choose NO for new name service information
    21. esc-2 to cont
    22. select americas for time zone
    23. esc-2 to cont
    24. select united states
    25. esc-2
    26. select central time
    27. esc-2
    28. confirm information
    29. esc-2
    30. enter root password
    31. esc-2 to continue
    32. zone should reboot

  2. style=”MARGIN: 0in 0in 0pt; mso-list: l11 level1 lfo3; tab-stops: list .5in”>to disconnect from the console use “~.”

MARGIN: 12pt 0in 3pt”>Additional zonecfg

  1. following zone initialization to add additional filesystem resources and resource controls follow the following instructions
  2. create the directories in the zone you are going to modify
  3. zonecfg –z dzone2
  4. add fs
  5. set dir=/export/home
  6. set special=/dev/md/dsk/d51
  7. set raw=/dev/md/rdsk/d51
  8. set type=ufs
  9. set options=logging
  10. end
  11. verify
  12. commit
  13. exit
  14. bounce the zone

12pt 0in 3pt”>Login

  1. zlogin –C zone
  2. zlogin –l c1196 zone


  1. ps with –Z
  2. ipcs, pgrep, ptree, prstat with –z zonename option


  1. zoneadm –z myzone halt


  1. zoneadm –z myzone boot


  1. zoneadm –z myzone reboot

face=Arial>Grow FileSystem

  1. from the global machine
  2. growfs –M /zoneroot/root/filesystem /dev/md/rdsk/device

Arial>updating resources on the fly for a zone

  1. must run the following command from the global zone
    1. prctl –n zone.cpu-shares –v <value> -r –i zone <zone number>

h2 style=”MARGIN: 12pt 0in 3pt”>=Arial>Notes

  1. You can install apps either at a global or non-global level.  Caveat, user’s will be unable to install packages to /usr/local at a non-global level unless we create /usr/local as a filesystem to mount. 
    But then, we must effectively cover anything in the global /usr/local.  Just be aware.



-irow: 3; mso-yfti-lastrow: yes”>


Command Line

Create a disk group

vxdg init diskgroup diskname=device

Add a disk to disk group

vxdg -g diskgroup adddisk

Remove a disk from disk group

vxdg –g diskgroup rmdisk diskname

Deport, import or destroy a disk group

vxdg {deport|import|destroy} diskgroup

List disk groups

vxdg list [diskgroup]

Show free/spare space pool

vxdg –g diskgroup {free|spare}

Upgrade disk group version

vxdg [-T version] upgrade diskgroup

Rewrite disk headers, configuration copies, and kernel log copies in a disk group.

vxdg flush diskgroup targetdg object


vxdctl enable (for all disk groups)

Move an object between disk groups

vxdg move sourcedg targetdg object

Split objects between disk groups

vxdg split sourcedg targetdg object

Join disk groups

vxdg join sourcedg targetdg

List objects affected by a disk group move operation

style=”MARGIN: 2pt -0.4pt 2pt 6.9pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: page; mso-element-left: 111.65pt; mso-element-top: 4.8pt; mso-height-rule: exactly”>vxdg listmove sourcedg targetdg object

Display bootdg

Display defaultdg

Set defaultdg

style=”MARGIN: 6pt 0in 1pt 9pt; mso-element: frame; mso-element-frame-hspace: 9.0pt; mso-element-wrap: around; mso-element-anchor-vertical: paragraph; mso-element-anchor-horizontal: page; mso-element-left: 111.65pt; mso-element-top: 4.8pt; mso-height-rule: exactly”>

vxdg bootdg

vxdg defaultdg

vxdctl defaultdg diskgroup

Manually back up the disk group configuration

Perform precommit analysis of a restore

Restore the disk group configuration

vxconfigbackup diskgroup

vxconfigrestore -p diskgroup

vxconfigrestore -c [-l directory] diskgroup

Vi Editor Basics refernce card

Moving around the file

h cursor left i cursor right

k cursor up j cursor down

^&B Beginning of line

$ end of line

) Next sentance

( Previous sentance

} Next Paragraph

{ Previous Paragraph

end of file

w one character forward

W one word forward

:20 go to Line no 20 or whatever number you give

Adding new line

o add a new line below the current line

O adds a new line above the current line.

deleting the text :

x deletes text above the text

X deletes text character on right of cursor

20d deletes line 20

dd deletes current line

D delete till end of current line.

Replacing a character & word

r replace the character above the cursor.

R replces characters until Esc is pressed.

cw replaces the word from cursor to the end indicated by $ sign .

C replaces till end of line.

Displaying file info.

^g give name of the file current line and total lines of a file at the bottom .


s subistutes current charcater.

S substitutes entire line.

Inserting and appending text :

i inserts text to the left of cursor

I inserts in the beginning of line

a appends text to right of cursor

A appends to the end of line

Repeating last command

repeats the last text.

Undo the last change

u undo last change.

U undo changes to the current line.


:/name & return searches for the word name in the file

n continues search forward.

N searches backwards.

Copy and pasting lines

yy copy the current line into buffer.

5yy copies 5 lines from the current line.

p pastes the current buffer.



Recovering a unsaved vi file.

vi -r filename restores a unsaved / crashed file from buffer.


:w saves the text does not quit.

:wq saves & quit the editor .

ZZ save

:q! Quit without saving.

Movies: How to download hulu movies

Hulu, a streaming video site created by NBC Universal and News Corp., for yourself. The U.S.-only site features a few full-length movies,and a good number of clips and full episodes of shows like Family.

Now, How to download hulu movies ?

RipTiger is an very good program that allows you to download videos from But not only download, it helps to convert videos so I can share it with my friends. RipTiger can copy all your downloaded videos to iPod and any other portable player!

How I use it:

1. Install and launch RipTiger (better Ultimate edition, because it can convert downloaded video).

2. Open in Internet Explorer and RipTiger automatically starts downloading.

3. When downloading is finished, Riptiger Ultimate starts conversion to MPEG4 (because I want to put the video into my iPod).

4. When clicking to iPod icon videos are copied to iPod.

News: Steve McNair and Sahel Kazemi Photos

TMZ acquired five photos of former NFL QB Steve McNair vacationing with Sahel Kazemi, the woman who likely murdered him and then killed herself early Saturday.

Former Titans Quarterback Steve McNair and Sahel Kazemi, who were shot dead in what appears to be a murder/suicide, had been dating for five months and had been planning to tie the knot as soon as the 36 year-old got a divorce from his wife Mechelle McNair.

Steve and Sahel were often seen together, they spent several mini-vacations together (photos below) and they were reportedly smitten with each other. We can clearly see in these photos, the couple had great chemistry and were having a good time.

Solaris: Virtual Interface Creation / Deletion

To add virtual interface

1. Add entry in /etc/hosts

# ifconfig eri0 addif broadcast up

3. Create /etc/hostname.eri0:xx with domain name as its content (where xx is next available no for virtual NIC, verify that using ifconfig -a command)


1. Add statement to /etc/hostname.ce5 file

2. # ifconfig hme0 addif ip_address netmask + broadcast + up

To remove virtual interface

1. # ifconfig hme0 removeif ip_address_of_virtual_interface

2. # edit /etc/hostname.<driver> file to remove the entry

To remove virtual interface which is not up or have been used with same IP address


ge0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet netmask ffffff00 broadcast

ge0:77: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4< mtu 1500 index 2
inet netmask ffffff00 broadcast

To remove interface ge0:77 which is not up

ifconfig ge0:77 unplumb