Tuesday, February 12, 2008

Clear Zombie Process

This script for clear or kill zombie process for solaris 9 and solaris 10.
------------------------------------------------------------------------------------------
#!/bin/ksh
trap '' 1 2 15
while :
do
for x in `ps -el | awk '$2 ~ /Z/ {print $4}'`
do
preap $x
done
sleep 86400 # every 24 Hrs.
done
trap 1 2 15

Friday, January 4, 2008

Make and Mount ISO images for CD and DVD

  • Make ISO CD Image
# mkisofs -help
# mkisofs -l -o /export/cdimage.iso /export/original/
15.30% done, estimate finish Fri Jan 4 14:59:07 2008
30.62% done, estimate finish Fri Jan 4 14:59:07 2008
45.89% done, estimate finish Fri Jan 4 14:59:09 2008
61.22% done, estimate finish Fri Jan 4 14:59:08 2008
76.49% done, estimate finish Fri Jan 4 14:59:08 2008
91.81% done, estimate finish Fri Jan 4 14:59:08 2008
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 20480
Path table size(bytes): 154
Max brk space used 14000
32686 extents written (63 MB)

  • Mount ISO CD Image
# lofiadm -a /export/cdimage.iso

# fstyp /dev/rlofi/1
hsfs

# mount -F hsfs -o ro /dev/lofi/1 /mnt
# ls /mnt
jakarta_tomcat_5_0_30.tar
jre_1_5_0_11_solaris_amd64.sh
jre1_5.0_11

  • Make ISO UDFS DVD Image

# mkisofs -udf -o /export/dvd.iso /export/dvdfile/

15.30% done, estimate finish Fri Jan 4 14:59:07 2008
30.62% done, estimate finish Fri Jan 4 14:59:07 2008
45.89% done, estimate finish Fri Jan 4 14:59:09 2008
61.22% done, estimate finish Fri Jan 4 14:59:08 2008
76.49% done, estimate finish Fri Jan 4 14:59:08 2008
91.81% done, estimate finish Fri Jan 4 14:59:08 2008
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 20480
Path table size(bytes): 154
Max brk space used 14000
32686 extents written (63 MB)

  • Mount UDFS Image

# lofiadm -a /export/dvd.iso /dev/lofi/2
# fstyp /dev/rlofi/2
hsfs
udfs
Unknown_fstyp (multiple matches

# mount -F udfs -o ro /dev/lofi/2 /mnt2
# ls /mnt2
Video1.VOB Video2.VOB Video3.VOB

  • Cancel Mount and Images

# umount /mnt

# umount /mnt2

# lofiadm -d /dev/lofi/1

# lofiadm -d /dev/lofi/2