Livio Teixeira Filho
RESUME ( English )

CURRICULO ( Portugues )

Home


UNIX TIPS

Solaris

HP-UX

AIX

Linux


DOWNLOADS

( my publications )

File and Print Serving with Linux on IBM i5

Solaris to AIX Migration: A Guide for System Administrators

Achieving High Availability on Linux for System z with Linux-HA Release 2


PICTURES

IBM-Rochester/MN (Jan/2005)

Gustavo 1 year old Birthday (Jul/2005)

São Luis/MA (Sep/2005)

Jan to Apr/2006

Texas (Apr to May/2006)

May to Aug/2006

Sep to Dec/2006

Italy/Feb-2007

Jan to Mar/2007

Washington/VA (Jun/2007)

Chesterfield/VA (Oct/2007)

New York (Jun/2008)

Dec/2008 to Jan/2009)

Itacare/Bahia (Jan/2009)

Jan to Dec/2010

Moto trail (Ago/2010)

Orlando/FL (Jan/2011)

Flying around Campinas (2011)

Flying Avid Flyer around Tatui (Jan/2012)

Solaris Tips

1- General

1.1- Verifying the link of the "ce" NIC
1.2- Copying the vtoc (example)
1.3- Verifying the WWN of HBA SUN (driver qlc)
1.4- How to get the inode infromation
1.5- How to clean /var/sadm/pkg
1.6- Verifying which file is part of which package
1.7- List all files from a package
1.8- Difference between du and df

2- Veritas Volume Manager

2.1- Recovering a Disk Group

3- Zones in Solaris 10

3.1- Zones status
3.2- How to create a zone ( summary )
3.3- Managing zones resources
3.4- Monitoring zones resoures from the global zone

4- Service Management Facility on Solaris 10

4.1- Services status
4.2- Display explanation from a service state
4.3- All information from a service
































1.1- Verifying the link of the "ce" NIC

kstat -p |grep ^ce |grep link

1.2- 1.2- Copying the vtoc (example)

prtvtoc /dev/dsk/c0t8d0s2 | fmthard -s - /dev/rdsk/c0t0d0s2

1.3- Verifying the WWN of HBA SUN (driver qlc)

luxadm -e port |grep CON |grep -v NOT |awk '{print "luxadm -e dump_map "$1}'|sh -x

1.4- How to get the inode infromation

truss -vlstat -tlstat ls -l arquivo

1.5- How to clean /var/sadm/pkg

Solaris doesn't have a command for automatic remove of the backout patchesbut we can do it manualy:

a) Remaning the last backout:
find /var/sadm/pkg -name obsolete.Z -exec rm {} \;

b) Removing all backouts:
find /var/sadm/pkg -name obsolete.Z -o -name undo.Z -exec rm {} \;


1.6- Verifying which file is part of which package

/usr/sbin/pkgchk -lp arquivo

1.7- List all files from a package

/usr/sbin/pkgchk -l SUNWcsr | grep Pathname

1.8- Difference between du and df

lsof +L1
or
find /proc/*/fd -links 0 -type f -size +2000 -ls

2.1- Recovering a Disk Group

Find an "enabled" configuration copy on one of the disks that was in the diskgroup.
To do this, run the command /etc/vx/diag.d/vxprivutil list /dev/rdsk/c#t#d#s3 on each disk that belonged to the diskgroup.
You are looking for an "enabled" configuration copy.
Key in on the "enabled" as shown below. Do not use a "disabled" copy.

config priv 000017-000247[000231]: copy=01 offset=000000 enabled
config priv 000249-001473[001225]: copy=01 offset=000231 enabled
log priv 001474-001693[000220]: copy=01 offset=000000 enabled

Most likely you will see that all the private regions within the said disk group will be enabled. Although the private regions look alright from this stand point, the problem lies in the fact that there are duplicate entries for volumes and/or plexes within the private regions. You will see this later in the dumpconfig process.

Once you've found a disk, dump the configuration using the command

/etc/vx/diag.d/vxprivutil dumpconfig /dev/rdsk/c#t#d#s3 > /var/tmp/dc

To get a list of the disks that were part of this diskgroup, run the command

cat /var/tmp/dc | vxprint -D - -md | /usr/xpg4/bin/grep -e \"^dm\" -e \"last_da_name\" > /var/tmp/disklist

This will fail on the vxprint command due to the duplicate entries of volumes or plexes. In order to get the command to work you must first vi the /var/tmp/dc file and look for all duplicate entries and remove them.
Once you have taken out the duplicate entries re-issue the above command.

This file will show you the correlation of the disk access name to the disk media name. Armed with this information, you need to recreate the diskgroup and add these disks into the diskgroup with the same disk media names they previously had. For example, if the /var/tmp/disklist file looks like this:

dm ckdg05
last_da_name=c3t5d1s2
dm ckdg06
last_da_name=c3t5d3s2

Then add the disk 'c3t5d1s2' into the dg as 'ckdg05', and add the disk 'c3t5d3s2' in as 'ckdg06'.

Before proceeding, you must initialize all the disks. You only need to do this for VxVM 3.x. Be *VERY* careful using the procedure here, as the disk controller number MIGHT have changed. You would not want to initialize the wrong disks, or you'll lose data. Also, some newer versions of VxVM, like 3.1.1 and 3.2, use a different default private-area length, so re-initializing a disk previously initialized on an older version may overwrite data.

To initialize the disks, run

cat /var/tmp/dc | vxprint -D - -md | grep \"last_da_name\" |
awk -F= \'{print $2}\' | awk -Fs \'{print $1}\' > /var/tmp/disks
ksh
For disk in $(cat /var/tmp/disks)
do /etc/vx/bin/vxdisksetup -i $disk
done

To create the diskgroup, use the first disk listed: vxdg init

ckdg05=c3t5d1s2

For each subsequent disk in the diskgroup, add it using the command:

vxdg -g adddisk ckdg06=c3t5d1s2

If the diskgroup in question is 'rootdg', you simply need to run 'vxinstall' to "re-create" the rootdg with these drives. Again, make SURE you use the same disk names for each device. Once all the disks have been added to the new diskgroup, you can regenerate the volume/plex/subdisk configuration using the command:

cat /var/tmp/dc | vxprint -D - -hmvps > /var/tmp/vxmakefile
vxmake -g -d /var/tmp/vxmakefile

You should now have your configuration back again. Try starting all the volumes in the diskgroup by running

vxrecover -g -s -b. If this does not work, force start the volumes one at a time using
vxvol -g -f start

3.1- Zones status

zoneadm list -vc

3.2- How to create a zone ( summary )

Exemplo:

zonecfg -z zone_name
create
set zonepath=/export/zone_name
set autoboot=true
add fs
set dir=/dir
set special=/dev/dsk/c1t1d0s0
set raw=/dev/rdsk/c1t1d0s0
set type=ufs
end
add net
set phisical=eri0
set address=192.168.100.2
end
add attr
set name=comment
set type=string
set value="test zone"
end
info
verify
commit
exit
zoneadm -z zone_name install
zoneadm -z zone_name boot

3.3- Managing zones resources

zonecfg -z zone_name
add rctl
set name=zone.cpu-shares
add value (priv=privileged,limit=90,action=none)
end
commit
exit

3.4- Monitoring zones resoures from the global zone

prstat -Z

4.1- Services status

svcs -a

4.2- Display explanation from a service state

exemplo: svcs -xv svc:/network/nfs/client

4.3- All information from a service

exemplo: svcs -l svc:/network/nfs/status:default