Friday, August 20, 2010

Command to delete file by inode number

To find the inode number:

$ ls -il

Output:
781956 drwx------  3 viv viv 4096 2006-01-27 15:05 gconfd-viv
781964 drwx------ 2 viv viv 4096 2006-01-27 15:05 keyring-pKracm
782049 srwxr-xr-x 1 viv viv 0 2006-01-27 15:05 mapping-viv
781939 drwx------ 2 viv viv 4096 2006-01-27 15:31 orbit-viv
781922 drwx------ 2 viv viv 4096 2006-01-27 15:05 ssh-cnaOtj4013
Command to delete file by inode number:

$ find . -inum 781922 -exec rm -i {} \;

Sunday, August 15, 2010

Solaris Run Level

Default Solaris Run Level

  • init S : Single user state (useful for recovery)
  • init 0 : Access Sun Firmware ( ok> prompt)
  • init 1 : System administrator mode
  • init 2 : Multi-user w/o NFS
  • init 3 : Multi-user with NFS
  • init 4 : Unused
  • init 5 : Completely shutdown the host (like performing a power-off @ OBP) [ thanks to Marco ]
  • init 6 : Reboot but depend upon initdefault entry in /etc/inittab

To find out current runlevel use who command:

$ who -r

Wednesday, August 4, 2010

To add a new disk and migrate the new disk and remove old

There are many ways to do. I have preferred this way.
  • cfgmgr
  • extendvg vgname newdisk
  • mirrorvg vgname newdisk
  • unmirrorvg vgname olddisk
  • reducevg vgname olddisk
  • rmdev –Rdl olddisk
Other way
  • cfgmgr
  • extendvg vgname newdisk
  • migratepv olddisk newdisk
  • rmdev –Rdl olddisk

Monday, August 2, 2010

JFS2 MAJOR MINOR DEVICE NUMBER

errpt command show the error message complaining about filesystem is full (df command shows some 10 filesystems is being 100% used). . The detailed report gives the major/minor device number: 000A 000F.

The characters: 000A 000F on the message are hexadecimal numbers. convert them to decimal numbers( 10 and 15) respectively. So, go to directory /dev and issue the command:

For instance,

#cd /dev
#ls -al | grep 10, 15

crw-rw---- 1 root system 10, 15 Apr 22 08:27 rtemplv
brw-rw---- 1 root system 10, 15 Apr 22 08:27 templv


Look on the 5th and 6th columns for an entry such as: 10, 15 and that will be the device with the issue

From this we can come to know which filesystem is full.


Questions and suggestions are welcome. Thanks


Monday, July 26, 2010

Procedure to grow the veritas filesystem in solaris Environment

1. Once the LUN is added, we need to configure the new LUN

devfsadm –c disk (will configure the new LUN)
then label the disk by executing the command format, it will prompt to label the disk (enter yes)

2. Once the disk is configured we have to initialize the disk in veritas

vxdisksetup –i diskname
for eg. vxdisksetup –i c0t1234567888d94

3. Now add the disk to the diskgroup in veritas

vxdg –g dgname adddisk mediaaccessname=diskname
for eg. vxdg –g oradg adddisk ora001=c0t1234567888d94

4. To grow the filesystem

vxresize –g dgname volumename size mediaaccessname.
for eg. vxresize –g oradg oravol +100M ora001

Questions and suggestions are welcome. Thanks

Saturday, July 24, 2010

To disable telnet/rexec services on Aix servers

1. Take a backup of /etc/inetd.conf(before editing the file better to to a backup)
cp -p /etc/inetd.conf /etc/inetd.conf_backup

2. Edit /etc/inetd.conf file and comment out telnet,rexec, services
vi /etc/inetd.conf
comment out (enter # ) the telnet, rexec services




3. Restart the inetd service
refresh -s inetd

Sendmail configuration

1. cp -p /etc/sendmail.cf /etc/sendmail.cf.backup
2. vi /etc/sendmail.cf
3. Search for #DSmailer:relayhostname
4. Add hostname
5. refresh -s sendmail
6. echo " hi " | mail -s " testmail" yourmailid@zzz.com