Akamit Blog

Enterprise sysadmin's blog

  • You are here: 
  • Home
  • 2010 March

Resizing VxFS

Posted on March 30th, 2010

Very handy feature of vxfs is an ability to dynamically shrink or expand the file system.

bash-3.00#  df -h /oracle/PRD/sapdata2
Filesystem             size   used  avail capacity  Mounted on
/dev/vx/dsk/oradg/sapdata2
                        14G   5.9G   7.6G    44%    /oracle/PRD/sapdata2
bash-3.00# /etc/vx/bin/vxresize -g oradg sapdata2 +4g
bash-3.00#  df -h /oracle/PRD/sapdata2
Filesystem             size   used  avail capacity  Mounted on
/dev/vx/dsk/oradg/sapdata2
                        18G   5.9G    11G    35%    /oracle/PRD/sapdata2
bash-3.00# /etc/vx/bin/vxresize -g oradg sapdata2 -2g
bash-3.00#  df -h /oracle/PRD/sapdata2
Filesystem             size   used  avail capacity  Mounted on
/dev/vx/dsk/oradg/sapdata2
                        16G   5.9G   9.5G    39%    /oracle/PRD/sapdata2
bash-3.00#

Filed under Veritas SF | No Comments »

Labeling large number of LUNs in Solaris

Posted on March 29th, 2010

You have added number of luns for use with VxVM, so you need to place a VTOC on every new disk.

# cfgadm -al -o show_FCP_dev
# vxdisk scandisks new

First command force Solaris to discover new FC devices. Second informs VxVM that new disks has appear.

# echo label > /tmp/cmd.txt
# echo quit >> /tmp/cmd.txt
# for i in `ls /dev/rdsk/*s2*`; do format -f /tmp/cmd.txt $i; done

Filed under Solaris | 1 Comment »

Making dual boot disk configuration with Solaris SVM

Posted on March 26th, 2010

We need to create RAS configuration for boot disks in the Solaris 10 U8 using SVM.
The server is Sun M4000 with 2 internal 146G SAS disks.
Installing Solaris we choose the following file system layout

sh-3.00# df -h
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0t0d0s0       16G   4.3G    11G    28%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   113G   1.8M   113G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
fd                       0K     0K     0K     0%    /dev/fd
/dev/dsk/c0t0d0s3       16G   426M    15G     3%    /var
swap                   113G    32K   113G     1%    /tmp
swap                   113G    72K   113G     1%    /var/run
swap                   113G     0K   113G     0%    /dev/vx/dmp
swap                   113G     0K   113G     0%    /dev/vx/rdmp
/dev/dsk/c0t0d0s5      7.9G   8.0M   7.8G     1%    /space2
/dev/dsk/c0t0d0s4      9.6G   1.1G   8.4G    12%    /opt
/dev/dsk/c0t0d0s7       65M   1.0M    57M     2%    /space
/dev/odm                 0K     0K     0K     0%    /dev/odm

We are going to create boot disk mirror.

bash-3.00# umount /space
bash-3.00# umount /space2
bash-3.00# metadb -a -f -c 2 c0t0d0s7
bash-3.00# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2
fmthard:  New volume table of contents now in place.
bash-3.00# metadb -a -c 2 c0t1d0s7

Avoid problems with metadb quorum during panic reboots with 2-disks boot mirror.

echo set md:mirrored_root_flag=1 >> /etc/system

Create the volumes:

bash-3.00# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0t0d0s1   32,9      16 182150384 182150384
bash-3.00# metainit -f d10 1 1 c0t0d0s0
d10: Concat/Stripe is setup
bash-3.00# metainit -f d11 1 1 c0t0d0s1
d11: Concat/Stripe is setup
bash-3.00# metainit -f d13 1 1 c0t0d0s3
d13: Concat/Stripe is setup
bash-3.00# metainit d20 1 1 c0t1d0s0
d20: Concat/Stripe is setup
bash-3.00# metainit d21 1 1 c0t1d0s1
d21: Concat/Stripe is setup
bash-3.00# metainit d23 1 1 c0t1d0s3
d23: Concat/Stripe is setup
bash-3.00# metainit d0 -m d10
d0: Mirror is setup
bash-3.00# metainit d1 -m d11
d1: Mirror is setup
bash-3.00# metainit d3 -m d13
d3: Mirror is setup
bash-3.00# metaroot d0
bash-3.00# cp /etc/vfstab /etc/vfstab.tmp
bash-3.00#  cat /etc/vfstab.tmp | \
>      sed s,/dev/dsk/c0t0d0s1,/dev/md/dsk/d1, | \
>      sed s,/dev/dsk/c0t0d0s3,/dev/md/dsk/d3, | \
>      sed s,/dev/rdsk/c0t0d0s3,/dev/md/rdsk/d3, > /etc/vfstab
bash-3.00# ls -l /dev/rdsk/c0t1d0s0
bash-3.00# ls -l /dev/rdsk/c0t0d0s0
lrwxrwxrwx   1 root     root          64 Mar 10 17:59 /dev/rdsk/c0t1d0s0 -> ../../devices/pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@1,0:a,raw
lrwxrwxrwx   1 root     root          64 Mar 10 17:59 /dev/rdsk/c0t0d0s0 -> ../../devices/pci@0,600000/pci@0/pci@8/pci@0/scsi@1/sd@0,0:a,raw
bash-3.00# init 0

next, create nvram aliases, replace “sd” by “disk”.

{0} ok nvalias bootdisk /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/disk@0,0:a
{0} ok nvalias bootmirror /pci@0,600000/pci@0/pci@8/pci@0/scsi@1/disk@1,0:a
{0} ok setenv boot-device bootdisk bootmirror 
boot-device =           bootdisk bootmirror
{0} ok boot

Create dedicated dump device not mirrored by SVM:

dumpadm -d /dev/dsk/c0t0d0s5

Attach submirrors.

bash-3.00# metattach d0 d20
d0: submirror d20 is attached
bash-3.00# metattach d1 d21
d1: submirror d21 is attached
bash-3.00# metattach d3 d23
d3: submirror d23 is attached
bash-3.00# metattach d4 d24
d4: submirror d24 is attached
bash-3.00#

Note: in the case of mirrored c0t0d0s0 there is no need to run installboot to install boot blocks on it.

Filed under Solaris | No Comments »

How to change Solaris hostname in VCS and VxVM

Posted on March 25th, 2010

Reference: http://support.veritas.com/docs/259766

1. Stop Cluster Server and all Cluster Server-monitored resources:
# hastop -all

2. Replace the old host name with the new host name in the following files on the appropriate systems:

/etc/hosts
/etc/nodename
/etc/llthosts
/etc/llttab
/etc/ticlts/hosts
/etc/ticots/hosts
/etc/ticotsord/hosts
/etc/hostname.xxxY <where xxxY is the approprite NIC device>
/etc/VRTSvcs/conf/sysname
/etc/VRTSvcs/conf/config/main.cf

Bear in mind that all the /etc/hosts files, host name.xxxY file, and /etc/nodename must contain the same value in order for Solaris to accept the new host name.

3. Reboot – note that Cluster Server will not start on the systems – it will end up with all nodes in STALE_ADMIN_WAIT. This is expected.

4. When the system is back up, on all nodes, execute the command vxdctl init – this will change the system name from the Volume Manager point of view.

5. On one node in the cluster, issue the command hasys -force – this will force Cluster Server to accept the configuration. At that point, all nodes in the cluster should build their configuration from that node.

Filed under Veritas Cluster, Veritas SF | No Comments »

Solaris 10 updates

Posted on March 22nd, 2010

Solaris 10 3/05 = Solaris 10
Solaris 10 01/06 = Solaris 10 Update 1
Solaris 10 06/06 = Solaris 10 Update 2
Solaris 10 11/06 = Solaris 10 Update 3
Solaris 10 8/07 Release = Solaris 10 Update 4
Solaris 10 5/08 Release = Solaris 10 Update 5
Solaris 10 10/08 Release = Solaris 10 Update 6
Solaris 10 5/09 Release = Solaris 10 Update 7
Solaris 10 10/09 Release = Solaris 10 Update 8

Filed under Solaris | No Comments »

How to install perl module into custom location

Posted on March 18th, 2010

You need to install Text::Wrapper into your home directory

wget http://search.cpan.org/CPAN/authors/id/C/CJ/CJM/Text-Wrapper-1.02.tar.gz
tar zxf Text-Wrapper-1.02.tar.gz
cd Text-Wrapper-1.02
 perl Build.PL
./Build destdir=$HOME install_base=$HOME
./Build destdir=$HOME install_base=$HOME install

If there is only Makefile.PL

perl Makefile.PL PREFIX=$HOME
make
make install

If you are using perl -MCPAN -e shell then you need to change makepl_arg, destdir and install_base args
in ~/.cpan/CPAN/MyConfig.pm

....
'destdir' => q[~/],
'install_base' => q[~/],
'makepl_arg' => q[SITELIBEXP=~/lib/perl5
 LIB=~/lib/perl5
 INSTALLMAN1DIR=~/share/man/man1
 INSTALLMAN3DIR=~/share/man/man3
 INSTALLSITEMAN1DIR=~/share/man/man1 NSTALLSITEMAN3DIR=~/share/man/man3],
...

If you need to use your home-dir-placed modules in apache mod_perl or perl cgi, add

SetEnv PERL5LIB /home/you/lib/perl5:/home/you/lib

presuming that you have placed your perl modules under /home/you/lib/perl5 and /home/you/lib directories
If you need custom build of some module requiring another module in non-standard location, just export PERL5LIB shell variable. For example, you need to build RRD::Simple, which requires RRDs.pm, but RRDs.pm is not distributed via CPAN, so you have downloaded rrdtool and unpacked it in some location.

wget http://search.cpan.org/CPAN/authors/id/N/NI/NICOLAW/RRD-Simple-1.44.tar.gz
tar zxf RRD-Simple-1.44.tar.gz 
gunzip -cd RRD-Simple-1.44.tar.gz | tar xf -
export PERL5LIB=/usr/local/rrdtool-1.2.19/lib/perl/5.8.7/i86pc-solaris
perl Makefile.PL
make && make install

and then dont forget to

use lib "/usr/local/rrdtool-1.2.19/lib/perl/5.8.7/i86pc-solaris";

in your perl program.

Filed under Perl | No Comments »