Wednesday, November 15, 2023

RHEL 8 AppStream

RHEL 8 AppStream contains two types of content. 

  1. Module
  2. RPM packages
A module bundles a set of packages together. The module can contain one or more streams to have multiple versions of applications. Each stream can receive updates independently.

To list out all the available modules. Below is the list of mariadb module  

myserver#yum module list  | grep mariadb

Name                 Stream          Profiles                                 Summary

mariadb              10.3 [d][e]     client, galera, server [d]               MariaDB Module                                                                                                                  
mariadb              10.5            client, galera, server [d]               MariaDB Module        

In the above output there are two streams for mariadb 10.3 and 10.5 where 10.3 is the default as marked as "d"

To enable 10.5 stream

myserver# yum module enable mariadb:10.5/server   

To install specific version

myserver#yum module install mariadb:10.5/server

Other commands worth to try

# yum module info mariadb
# yum module list mariadb 
# yum module remove -y mariadb 
                                                                                                     


Thursday, March 25, 2021

Removing a storage device from OS layer

Before removing access to storage device certain precaution needs to be taken. 


1. Check if the system is under memory pressure as I/O flush will add to the load

2. Free memory should not be less than 5 %

3. Swapping should not be active - (check si and so in vmstat output)

4. Close all applications using the file systems.

5. Unmount the file systems

6. Remove the device from volume groups (follow the volume manager software specific procedure)

7. Flush any outstanding I/O if device is used as raw device(blockdev --flushbufs device)

8. Remove any reference of disk based path /dev/dsk or /dev/dsk/by-path or major:minor from application and script

9. Remove each path from SCSI subsystem. 

10. echo 1 > /sys/block/device-name/device/delete

If the device is under multipath control and need to remove few paths. 

take the path offline echo offline > /sys/block/sda/device/state - This would ensure that subsequent I/O is sent to another alternate path.

then remove the device. 

echo 1 > /sys/block/device-name/device/delete





Monday, October 30, 2017

Setting VSFTP with Chroot option.

Today I  have got a requirement to setup a sftp user and restricting its access to a specific directory. My current running OS version Oracle Linux 5.11 which has latest openssh version openssh-4.3p2-82.el5. Now, initial plan to setup chroot to home directory using the below configuration which is quit straightforward.

1. Create a group called sftponly

        #groupadd sftponly
2.  Update /etc/ssh/sshd_config file with the below entries

AllowGroups root sftponly
Match Group sftponly
        ChrootDirectory /home/newuser
        ForceCommand    internal-sftp
        AllowTcpForwarding      no

While restarting sshd,

Starting sshd: /etc/ssh/sshd_config: line 123: Bad configuration option: Match
/etc/ssh/sshd_config: terminating, 1 bad configuration options [FAILED]

After googling for a while found that this feature is supported only with openssh 5 or above so not possible in my case

For an immediate workaround, I have decided to go for vsftp with chroot option. Here is what i have followed to set it up.

1. Install package vsftpd (#yum install vsftp*)

2. Change  anonymous_enable=NO

3. Add the below line

 chroot_local_user=YES

4. Add a user as below and set shell to /bin/false to restrict user not to login via shell

testuser:x:54332:54335::/home/testuser:/bin/false


NOTE: Ensure /bin/false is listed in the /etc/shells file




Friday, September 29, 2017

lock/nolock option for NFS mount option

lock/nolock option for NFS Share

I have explored internet for detailed information on nolock NFS mount option, there are very limited details are available. I have tried to consolidate all the details in this single page as below.

This option to enable whether to use NLM sideband protocol to lock files on the server. If neither option is specified(or if lock is specified), NLM locking is used for this mount point. When using nolock option, application can lock files, but such locks provide exclusion against other applications running on the same client. Remote applications are not affected by these locks. In other words when nolock option is used. This prevents the exchange of lock information between the NFS server and this client. The server is not aware of file locks on the client, and vice versa.

The failure to maintain proper locking between a write operation on one host and a read operation on another host may reader to get incomplete or inconsistent date.

Mount option for any share can be updated without really impacting the application. However, for this option, as this is going to change the behavior of locking mechanism for a mount and at the same if the mount is being  used as an application file system(such as weblogic domain) which is usually are  actively used, its always recommended to do it with a proper downtime, means bring down the application and perform the activity.  





Sunday, January 26, 2014

Install Source RMP on Centos/Redhat

1. Prepare the build environment and get the dependencies. Do those following command under your root home directory :
2. Put the source rpm file at the root of your home directory and then run this command to rebuild the rpm under your system :
(*replace  including ‘< >’ with your package name. you can put the source package under /rpmbuild/SOURCES as well to archive it.)
3. Install the RPM :

Shell
1
2
cd /rpmbuild/RPMS
rpm -i <package-0.0-0.x86_64.rpm>

Friday, January 24, 2014

Restore file and directory permission to default vaule

As we know umask value controls which permission are set for  files and directories  when they are created.

By default root has umask value of 022 and all ordinary users has umask value of 002.

So for ordinary user file permission would be 664 and directory permission would be 775 and for root users it would be 644 and 744 respectively.

So we know the default permission of files and directories when are created which can be restored using the following commands.

find . -type d \! -user root  -print -exec chmod 775 {} \; - for all files owned by ordinary users excluding root

find . -type f \! -user root  -print -exec chmod 644 {} \; - for all directory owned by ordinary users excluding root

find . -type f  -user root  -print -exec chmod 644 {} \; - For all files owned by root

find . -type d  -user root  -print -exec chmod 744 {} \; - For all directory owned by root

If you have any user which has different umask value other than the defualt one then change the command accordingly. The above procedure is used to restore the permission only to default value.

Wednesday, January 15, 2014

Allowing only root user to login through ssh

This can be done in two ways, not sure whether it's possible in another ways. Here are the two possible ways.

1. Configuring /etc/ssh/sshd_config file

AllowUsers root - which will allow only root user to login through ssh

2. Using PAM.

Add "Account pam_access.so" to /etc/pam.d/sshd 

Adding the above the line make login process to check /etc/security/access.conf for access

-:ALL EXCEPT root:ALL

Monday, January 13, 2014

Linux Commands

-->
chown:

Regular users cannot change the ownership of a file, root can only do that. Group can be changed by regular user to the group which the users belongs to.

Example : chown filename
To allow non-root users to change the owner of a file, change the suid of the chown command as given below

chmod u+s chown


Editing a file inline
--------------------------

sed -i 's/suman/siddhanth/g' testfile

perl -i.bak -pe 's/suman/siddhanth/g' testfile


Saturday, January 11, 2014

Linux Package management

Package management using yum
----------------------------------------------

I have multiple repository configured on my CentOS. Few online repositories and one local repository with all the packages from CD

Below command is to install package from one specific repository

yum --disablerepo="*" --enablerepo="ius" list available

 yum --disablerepo="*" --enablerepo="local" groupinstall "KDE desktop" local

where "local" is the repository name.

Skip dependency -

yum --disablerepo="*" --enablerepo="local" groupinstall basic-desktop desktop-platform x11 fonts --skip-broken 

Saturday, August 17, 2013

IO performance improvement by setting up a proper block size

Performance tuning is one of the major activities for a Unix Administrator. Today i will show you a practical scenario where performance can be tunned by setting up

proper block size while creating filesystem. When a file is created, system allocates set of blocks to store the files. Filesystem with larger block size containing

only smaller files, will have lot of space un-utilized.

In database where files are of bigger size, for optimal performance its better to create filesystem of larger block size.

So before creating a filesystem, find out what would be the average size of the files to be stored in the filesystem, based on that decide on that size of filesystem

blocksize

Check the block size of the filesystem

[root@linuxserver ~]# dumpe2fs /dev/sda1 | grep -i "Block size"
dumpe2fs 1.41.12 (17-May-2010)
Block size:               1024
[root@linuxserver ~]# dumpe2fs /dev/sda2 | grep -i "Block size"
dumpe2fs 1.41.12 (17-May-2010)
Block size:               4096


In this demo i am going to create a 2 filesystem with blocksize of 1024 and 4096 and create 20 files of 10MB size

[root@linuxserver /]# mkfs -t ext3 -b 1024 /dev/sdc1 - /app1 - mountpoint


#!/bin/sh
no=0
while [ $no -le 20 ]
do
dd if=/dev/zero of=test$no bs=10M count=1
no=`expr $no + 1`
done

Below is the time required to create 20 files of 10MB size

real    0m8.162s
user    0m0.005s
sys     0m1.881s

[root@linuxserver /]# mkfs -t ext3   /dev/sdb1 - /app - mountpoint

By default it creates filesystem using blocksize of 4096 bytes

#!/bin/sh
no=0
while [ $no -le 20 ]
do
dd if=/dev/zero of=test$no bs=10M count=1
no=`expr $no + 1`
done

real    0m1.268s
user    0m0.014s
sys     0m1.239s





Wednesday, March 6, 2013

Exporting ZFS filesystem to non-global zone

There are 2 ways zfs filesystem can be assigned to a non-global zone. 

Method 1:

1. Create a zfs filesystem on global zone 
     
        zfs create orapool/app

Where orapool - is the zpool name and app is the zfs filesystem name

2. Export the above the zfs filesystem to non-global zone called appzone

zonecfg -z appzone

[root@server1]# zonecfg -z appzone
zonecfg:appzone> add fs
zonecfg:
appzone:fs> set type=zfs
zonecfg:
appzone:fs> set special=orapool/app
zonecfg:
appzone:fs> set dir=/zonefs
zonecfg:
appzone:fs> end
zonecfg:
appzone> commit
zonecfg:
appzone> exit

In  the above method, non-global zone administrator does not have any control over the exported the filesystem, means can not set any attribute for the filesystem


Method 2:

In this method , the non-global zone administrator has complete control over the filesystem


[root@server1]# zonecfg -z appzone
zonecfg:
appzone> add dataset
zonecfg:
appzone:dataset> set name=orapool/app
zonecfg:
appzone:dataset> end
zonecfg:
appzone> commit
zonecfg:
appzone> exit

Once its exported, you can login to non-global zone and go ahead with the creating any no of filesystem on the exported the dataset

For example on orapoo/app you need orapool/app/test , orapool/app/test1,  orapool/app/tes3

Use the following command to create the above filesystem on non-global zone


#zfs create  orapool/app/test
#zfs create orapool/app/test1
#zfs create orapool/app/test2

So second approach is always best when you need to create multiple mountpoints on a dataset on non-global zone.

Other info:
 
Realtime issue faced:

I came across this issue when i was trying to set the mountpoint properties of previously exported dataset from global zone. I was getting error message as "Dataset is busy , its already exported"

Reason:

 When you export a dataset from a global zone, it sets  dataset's zone attribute,  which does not get turned off even if you remove the dataset from zone configuration using zonefcg command. You can view all the attributes of zone using

#zfs get orapool/app

Solution:

Turn of the zone attribute

#zfs set zone=off orapool/app


 

 







Monday, March 4, 2013

Persitent Binding for HBA Card

Persistent binding : As the name implies persistent binding enables LUNs zoned from a Storage frame will be assigned with a specific target ID. Now next question which may pops up in your mind "Why do we need that"?

I don't have any strong answer for it. After googling, got few clarifications which are not much convincing.


Below are the few points which i feel could be a reasonable answer for the above question.


1. In a cluster environment where the same LUN is assigned to multiple machine should be configured with persistent target ID.


2. Its a recommended steps for emulex branded HBA card where drivers software are provided by Emulex and same applies for Q Logic branded card.


Here in this, i would be taking only Emulex and Qlogic card as these cards are the most commonly used card on Solaris Box.


NOTE : You do not need to configure persistent binding for Sun Branded Emulex and Qlogic card. 
So HBA cards are categorized as Sun-branded and Sun-non-branded.

Below are the tips to identify the sun-branded and non-branded qlogic and emulex card.

Emulex Card:

LPxxxxxx-S are SUN Emulex HBA Cards  (ie has a “-S” for Sun at end).

For Solaris 10 fcinfo hba-port would provide you the details and for previous version of solaris prtpicl command can be used to get the HBA details

If you see any of the following references they are NON-SUN HBA Cards:

NON-SUN Qlogic:
  • qlaxxxx
  • QLGC,qla
  • QLGC,qlc
  • SUNW,qla

NON-SUN Emulex:
  • emlx (emlxs is SUN)
  • lpfc

    Click on the below link for the detailed explanation.

    Identify HBA card

    So we have got some idea on HBA cards identification now lets go ahead and configure the persistent for emulex card. As i have previously mentioned that persistent binding is needed only for SUN non-branded emulex card.

    To configure persistent binding, there are 2 files needed to be modified.

    /kernel/drv/lpfc.conf
    /kernel/drv/sd.conf

    lpfc.conf - Kernel configuration file for lpfc driver modules
    sd.conf - kernel configuration file for sd driver module

    lpfc.conf file is where you configure the persistent binding and sd.conf is where you should add enough entry to allow OS to scan for more devices.

    For persistent binding you need to find the HBA card instance you can easily determine this by using lputil commands

    Here is an example

    bash-3.00# /usr/sbin/lpfc/lputil
    LightPulse Common Utility for Solaris/SPARC. Version 2.0a13 (1/3/2006).
    Copyright (c) 2005, Emulex Corporation

    Emulex Fibre Channel Host Adapters Detected: 3
    Host Adapter 0 (lpfc3) is an LP11002-E (Ready Mode)
    Host Adapter 1 (lpfc4) is an LP11002-E (Ready Mode)
    Host Adapter 2 (lpfc2) is an LP9802 (Ready Mode)


    As you can see above there are 3 cards. LP11002-E looks like a dual port card that can be confirmed by looking at /etc/path_to_inst file . Here is extract from the the file


    "/pci@1c,600000/lpfc@1,1" 1 "emlxs"
    "/pci@1c,600000/lpfc@1,1" 1 "lpfc"
    "/pci@1c,600000/lpfc@1,1/fp@0,0" 1 "fp"
    "/pci@1c,600000/fibre-channel@1" 3 "lpfc"
    "/pci@1c,600000/fibre-channel@1,1" 4 "lpfc"
    "/pci@1d,700000/lpfc@2" 2 "emlxs"
    "/pci@1d,700000/lpfc@2" 2 "lpfc"
    "/pci@1d,700000/lpfc@2/fp@0,0" 2 "fp"

    From the above 
  •  
  • "/pci@1c,600000/fibre-channel@1" 3 "lpfc"
    "/pci@1c,600000/fibre-channel@1,1" 4 "lpfc"


    See the physical path of the lpfc which is same with the instance as 3 and 4 so its a single HBA card having dual port so lpfc3 and lpfc4 is the instance of dual port HBA card.

    Sample sd.conf file:

    name="sd" parent="lpfc" target=0 lun=0 hba="lpfc0";
    name="sd" parent="lpfc" target=0 lun=1 hba="lpfc0";
    name="sd" parent="lpfc" target=0 lun=2 hba="lpfc0";
    name="sd" parent="lpfc" target=0 lun=3 hba="lpfc0";
    name="sd" parent="lpfc" target=0 lun=4 hba="lpfc0";
    name="sd" parent="lpfc" target=0 lun=5 hba="lpfc0";
    name="sd" parent="lpfc" target=0 lun=6 hba="lpfc0";
    name="sd" parent="lpfc" target=0 lun=7 hba="lpfc0";

    name="sd" parent="lpfc" target=1 lun=0 hba="lpfc1";
    name="sd" parent="lpfc" target=1 lun=1 hba="lpfc1";
    name="sd" parent="lpfc" target=1 lun=2 hba="lpfc1";
    name="sd" parent="lpfc" target=1 lun=3 hba="lpfc1";
    name="sd" parent="lpfc" target=1 lun=4 hba="lpfc1";
    name="sd" parent="lpfc" target=1 lun=5 hba="lpfc1";
    name="sd" parent="lpfc" target=1 lun=6 hba="lpfc1";
    name="sd" parent="lpfc" target=1 lun=7 hba="lpfc1";





    Now in the above output assigning lun no is a tricky one. You need to work with storage team for it. Get the HEX code for each LUN and convert it to decimal which needs to be specified as lun no.

    Another example of /etc/path_to_inst

    > grep -i lpfc /etc/path_to_inst
    "/pci@1e,600000/pci@0/pci@1/pci@0/pci@8/fibre-channel@1" 0 "lpfc"
    "/pci@1e,600000/pci@0/pci@1/pci@0/pci@8/fibre-channel@1,1" 1 "lpfc"
    "/pci@1e,600000/pci@0/pci@8/fibre-channel@0" 4 "lpfc"
    "/pci@1e,600000/pci@0/pci@8/fibre-channel@0,1" 5 "lpfc"
    "/pci@1f,700000/pci@0/pci@2/pci@0/pci@8/fibre-channel@2" 2 "lpfc"
    "/pci@1f,700000/pci@0/pci@2/pci@0/pci@8/fibre-channel@2,1" 3 "lpfc"
    "/pci@1f,700000/pci@0/pci@9/fibre-channel@0" 6 "lpfc"
    "/pci@1f,700000/pci@0/pci@9/fibre-channel@0,1" 7 "lpfc"

    From the above you can find out that there 4 emulex dual ports HBA cards









Persitent Binding for HBA Card

Persistent binding : As the name implies persistent binding enables LUNs zoned from a Storage frame will be assigned with a specific target ID. Now next question which might pops up in your mind "Why do we need that"

I don't have any strong answer for it. After googling, got few clarifications which is not much convincing.

Below are the few points which i feel could be a reasonable answer for the above question.

1. In a cluster environment where the same LUN is assigned to multiple machine should be configured with persistent target ID.

2. Its a recommended steps for emulex branded HBA card where drivers software are provided by Emulex and same applies for Q Logic branded card.

Here in this, i would be taking only Emulex and Qlogic card as these cards are the most commonly used card on Solaris Box.

NOTE : You do not need to configure persistent binding for Sun Branded Emulex and Qlogic card.

Wednesday, January 9, 2013

Physical to Virtual server migration(P2V)

First create a flar image of the source system  . 

Following are the various option for flarcreate command

1. flarcreate -n archive1 -c archive1.flar ---------- create flar archive which is a exact duplicate of master system and and compressed

2. flar info -l archive1.flar - To check the structure of flar archive

Create an archive that contains large files

-------------------------------------------------

The default archiving utiltiy in flar is cpio which cannot handle large file of more than 4G . Instead of that -L pax copy to be invoked when any individual file is larger than 4 G

#flarcreate -L pax -n archive1 -c archive1.flar

To check : #flar info -l archive1.flar

Create an archive from alternate root filesystem.

-------------------------------------------------------


#flarcreate -n archive1.flar -c -R /x/yy/zz archive1.flar


 



# flarcreate -n archive3 -i 20000131221409 -m pumbaa  -e "Solaris 8 Print Server" -a "Mighty Matt" -U "Internal Finance"  -T server archive3.flar - provide description

flarcreate -S -n archive1 -L cpio archive1.flar - best command -S option will avoild disk size checking


P2V

Oracle Solaris Zones Physical-to-Virtual (P2V)
A new feature for Solaris 10 9/10.This feature provides the ability to build a Solaris 10 images from physical
system and migrate it into a virtualized operating system environment
There are three main steps using this tool

1. Image creation on the source system, this image includes the operating system and optionally the software in which we want to include within the image.
2. Preparing the target system by configuring a new zone that will host the new image.
3. Image installation on the target system using the image we created on step 1.

Once the image is ready and zone is configured then performs the below steps.


#zoneadm -z solaris10-up9-zone install -u -a /var/tmp/solaris_10_up9.flar - which will perform sys-unconfig. To preserve the sysidcfg setting use the below command

#zoneadm -z solaris10-up9-zone install -p -a /var/tmp/solaris_10_up9.flar
 

Thursday, December 20, 2012

ssh-keygen to generate 2048 bits host key

There are many posts available on  the internet regarding the importance of HostKey.(check HostKey parameter in sshd_config file) Just to brief you about it, it is to provide more security while connecting to the server using ssh. When you connect to the server you will be prompted to verify the fingerprint of the key on the server. Compare the fingerprint with the one which is on the server and then go ahead with the connecting to the server

You can check the fingerprint on the server

ssh-keygen -lf /etc/ssh/ssh_host_rsa_key


By default while installing the ssh package, it generates 1024 bits length of rsa and dsa keys.

To generate these keys of different length. e.g 2048


#ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key


#ssh-keygen -t dsa -b 2048 -f /etc/ssh/ssh_host_dsa_key

Wednesday, September 19, 2012

Replacing a disk in Veritas Volume Manager

Replacing a disk in VxVM
--------------------------------------------------------

This has always been a difficult task while replacing a disk. The main worry which runs in our mind that data should not be lost while performing the activity, it should be intact otherwise you know the pain of facing other team.


Here i will be explaining very simple steps which will make you comfortable in doing such critical activities.


I will be talking about concatenated volume where you don't have redundant copies of data later i will cover the mirrored volume.


Disk replacement in concatenated volume


Here is the vxprint -htq output


bash-3.00# vxprint -htq

Disk group: appdg

dg appdg        default      default  4000     1347953587.80.vcs1

dm disk03       disk_3       auto     65536    2027168  -
dm disk04       disk_4       auto     65536    2027168  -

v  appvol       -            ENABLED  ACTIVE   3121152  SELECT    -        fsgen
pl appvol-01    appvol       ENABLED  ACTIVE   3121152  CONCAT    -        RW
sd disk03-01    appvol-01    disk03   0        2027168  0         disk_3   ENA
sd disk04-01    appvol-01    disk04   0        1093984  2027168   disk_4   ENA


In the above appdg diskgroup first subdisk is
disk03-01 which is associated with disk03 and the plex is a concatenated type.

In the above scenario, if in case disk03 which is the first disk added to diskgroup and on which the Veritas has created the first subdisk for "appvol" volume. There is no way to replace the disk, if you try to do so, you will end up in corrupting the filesytem and the data.


But if you want to replace the second disk(flag - failing disk status)  which is absolutely possible without data loss but during this activity volume would not accessible. 

First we will use vxdiskadm to replace the disk, later we will try with only command prompt.


Connect the new disk in an empty slot and initialize it.


Run vxdiskadm from the command prompt, it will open up a list of menu items.



-> Select option no 4 - Remove a disk for replacement


Select the correct disk which you want to replace


(Caution - Do not select first the disk in the disgroup)


Once you have removed the disk it will prompt to select a disk with which you want to replace.  Select the disk which you have initialized.http://www.blogger.com/blogger.g?blogID=7967882172610062116#editor/target=post;postID=2988077713332921354


Once you are done with the above steps, you will find the plex is in disabled and recover steps


# vxprint -htqv

Disk group: appdg

v  appvol       -            DISABLED ACTIVE   3121152  SELECT    -        fsgen
pl appvol-01    appvol       DISABLED RECOVER  3121152  CONCAT    -        RW
sd disk03-01    appvol-01    disk03   0        2027168  0         disk_3   ENA
sd disk04-01    appvol-01    disk04   0        1093984  2027168   disk_5   ENA
#


You need to correct the above


Below sequence of commands needs to executed to fix the abovfe


#vxmend -g appdg fix stale appvol-01


#vxmend -g appdg fix clean appvol-01


#vxvol -g appdg start
appvol

That's it you are done. Mount the volume and you are ready to use the volume.


Replacing a failed disk in mirrored volume

Here is my volume status

# vxprint -htqg mir
dg mir          default      default  4000     1348198265.15.vcs1

dm mir01        disk_3       auto     65536    2027168  -
dm mir02        disk_4       auto     65536    2027168  -

v  appvolmir    -            ENABLED  ACTIVE   1024000  SELECT    -        fsgen
pl appvolmir-01 appvolmir    ENABLED  ACTIVE   1024000  CONCAT    -        RW
sd mir01-01     appvolmir-01 mir01    0        1024000  0         disk_3   ENA
pl appvolmir-02 appvolmir    ENABLED  ACTIVE   1024000  CONCAT    -        RW
sd mir02-01     appvolmir-02 mir02    0        1024000  0         disk_4   ENA


Where appvolmir is mirrored volume in mir diskgroup, having 2 plexes appvolmir-01 and appvolmir-02

Change the plex status to offline

#vxmend -g mir off appvolmir-02

# vxprint -htqg mir
dg mir          default      default  4000     1348198265.15.vcs1

dm mir01        disk_3       auto     65536    2027168  -
dm mir02        disk_4       auto     65536    2027168  -

v  appvolmir    -            ENABLED  ACTIVE   1024000  SELECT    -        fsgen
pl appvolmir-01 appvolmir    ENABLED  ACTIVE   1024000  CONCAT    -        RW
sd mir01-01     appvolmir-01 mir01    0        1024000  0         disk_3   ENA
pl appvolmir-02 appvolmir    DISABLED OFFLINE  1024000  CONCAT    -        RW
sd mir02-01     appvolmir-02 mir02    0        1024000  0         disk_4   ENA


Disassociates the offline plex from the volume

#vxplex -g mir dis  appvolmir-02

# vxprint -htqg mir
dg mir          default      default  4000     1348198265.15.vcs1

dm mir01        disk_3       auto     65536    2027168  -
dm mir02        disk_4       auto     65536    2027168  -

pl appvolmir-02 -            DISABLED -        1024000  CONCAT    -        RW
sd mir02-01     appvolmir-0 mir02    0        1024000  0         disk_4   ENA

v  appvolmir    -            ENABLED  ACTIVE   1024000  SELECT    -        fsgen
pl appvolmir-01 appvolmir    ENABLED  ACTIVE   1024000  CONCAT    -        RW
sd mir01-01     appvolmir-01 mir01    0        1024000  0         disk_3   ENA
#
 

 Remove the plex

#vxedit -g mir -r rm appvolmir-02

 # vxprint -htqg mir
dg mir          default      default  4000     1348198265.15.vcs1

dm mir01        disk_3       auto     65536    2027168  -
dm mir02        disk_4       auto     65536    2027168  -

v  appvolmir    -            ENABLED  ACTIVE   1024000  SELECT    -        fsgen
pl appvolmir-01 appvolmir    ENABLED  ACTIVE   1024000  CONCAT    -        RW
sd mir01-01     appvolmir-01 mir01    0        1024000  0         disk_3   ENA
#

Once plex is removed, removed the disk from veritas control

#vxdg -g mir rmdisk mir02 




# vxprint -htqg mir
dg mir          default      default  4000     1348198265.15.vcs1

dm mir01        disk_3       auto     65536    2027168  -

v  appvolmir    -            ENABLED  ACTIVE   1024000  SELECT    -        fsgen
pl appvolmir-01 appvolmir    ENABLED  ACTIVE   1024000  CONCAT    -        RW
sd mir01-01     appvolmir-01 mir01    0        1024000  0         disk_3   ENA
#



So disk removal is done, Now its time to attach a new disk and sync the data. Identify a new disk should be of similar or more size.

Here in this example i would be using the disk_5 as a replacement disk.

# vxprint -htqg mir
dg mir          default      default  4000     1348198265.15.vcs1

dm mirreplacedisk disk_5     auto     65536    41764864 -
dm mir01        disk_3       auto     65536    2027168  -

v  appvolmir    -            ENABLED  ACTIVE   1024000  SELECT    -        fsgen
pl appvolmir-01 appvolmir    ENABLED  ACTIVE   1024000  CONCAT    -        RW
sd mir01-01     appvolmir-01 mir01    0        1024000  0         disk_3   ENA
#


So once the new disk is initialized and added to the diskgroup , mirror the volume. Here is the vxdisk list ouput

# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
c0d0s2       auto:sliced     ibmdg01      ibmdg        online
disk_3       auto:cdsdisk    mir01        mir          online
disk_4       auto:cdsdisk    -            -            online
disk_5       auto:cdsdisk    mirreplacedisk  mir          online
disk_6       auto:SVM        -            -            SVM
disk_7       auto:SVM        -            -            SVM
disk_8       auto:ZFS        -            -            ZFS
disk_9       auto:ZFS        -            -            ZFS
disk_10      auto:ZFS        -            -            ZFS
disk_11      auto:cdsdisk    -            -            online
disk_12      auto:cdsdisk    -            -            online


"mirrreplacedisk" is the replaced disk

#vxassist -g mir make mirror appvolmir mirreplacedisk

# vxprint -htqg mir
dg mir          default      default  4000     1348198265.15.vcs1

dm mirreplacedisk disk_5     auto     65536    41764864 -
dm mir01        disk_3       auto     65536    2027168  -

v  appvolmir    -            ENABLED  ACTIVE   1024000  SELECT    -        fsgen
pl appvolmir-01 appvolmir    ENABLED  ACTIVE   1024000  CONCAT    -        RW
sd mir01-01     appvolmir-01 mir01    0        1024000  0         disk_3   ENA
pl appvolmir-02 appvolmir    ENABLED  ACTIVE   1024000  CONCAT    -        RW
sd mirreplacedisk-01 appvolmir-02 mirreplacedisk 0 1024000 0      disk_5   ENA
#
 













Friday, September 14, 2012

Driver versus firmware

The difference of firmware and drivers is the application of this piece of software.
The most electronic hardware only needs firmware to run basicly. E.G. a DVD-player needs firmware to know how to read a CD or DVD. But to have it accessed under a operating system like Windows you need a drivhttp://www.blogger.com/blogger.g?blogID=7967882172610062116#editor/target=post;postID=5967573526606548086er to access the CD or DVD or watch a movie.
To visualize: A car needs an engine to drive at all, but needs a person (driver!)to control it
Firmware is the software that runs on the device. A driver is the software that tells your operating system how to communicate with the device. Not all devices have firmware--only devices with some level of intelligence.
Read more: http://wiki.answers.com/Q/What_is_the_difference_between_firmware_and_drivers#ixzz25ieOoLEf

Thursday, September 13, 2012

ALOM reset.

1. ALOM console is hunged

I am able to access the console but not able to type in the username and password. As per my finding from the internet, ALOM can be reset by completely poweroff the box means to say remove the power cable.

Second option i could find is, it can be done at the OS level. Here is the command

#/usr/platform/`uname -i`/sbin/scadm resetrsc

Wednesday, September 12, 2012

Veritas Dyanmic Multipathing

Veritas Dynamic Multipathing:

As the name indicates, veritas dynamic multipathing provides multipathing functionality for operating system native device.
It represents a multiple path of a device using DMP metadevice also known as DMP nodes .

Important points:

You can not create veritas filessytem on DMP metadevice, only way to  have the filesystem is create VxVM volume and create VxFS filesystem on it.

VxVM volume and ZFS volume can coexist together but the device which has VxVM label can not be used in ZFS and vice versa.

Feature of Multipathing:

It provides the following feature:

1. Availability
2. Reliability
3. Performance 

It does those by using path failover and load balancing.

Two kernel thread performs the checking the status of HBA and path restoration.

1. errord
2. restored

This can be checked using #vxdmpadm stat

Support for ZFS
---------------------

By default VxVM does not support zfs. To enable it, you need to turn on dmp_native_support tunable

#vxdmpadm settune dmp_native_support=on

To check the status 

#vxdmpadm gettune dmp_native_support


Here is sequence of commands to enable VxDMP support and create a zpool followed by adding a new device to the zpool.

1.Enable the dmp_native_support

#vxdmpadm settune dmp_native_support=on

2.Check the dmp_native_support status

#vxdmpadm gettune dmp_native_support

Once the above steps are done, you can go ahead and add create zpool.

3. Bring the disk under Veritas Volume manager

#vxdctl enable or #vxdisk scandisks

4. Check the disks status

#vxdisk list

5.Now its time to create zpool using the device

#zpool create testpool <device_name>


6. Check the zpool status

#zpool status

7.Add a new device

#zpool add testpool <device name>

------------------------------------------------------------------

To see all the subpaths of the dmpnode name

#vxdmpadm getsubpaths dmpnodename=<name> 

# vxdmpadm getsubpaths dmpnodename=disk_8
NAME         STATE[A]   PATH-TYPE[M] CTLR-NAME  ENCLR-TYPE   ENCLR-NAME    ATTRS
================================================================================
c2t5d0       ENABLED(A)    -          c2         Disk         disk       

      -

where disk_8 is the dmpnodename

Now the next is when we have device details, wants to find out the corresponding dmpnodename


# vxdmpadm getdmpnode nodename=c2t5d0
NAME                 STATE        ENCLR-TYPE   PATHS  ENBL  DSBL  ENCLR-NAME
==============================================================================
disk_8  


Others useful commands

#vxdmpadm list dmpnode all

#vxdmpadm list dmpnode dmpnodename=<dmp node name>

# vxdmpadm list dmpnode dmpnodename=disk_4
dmpdev          = disk_4
state           = enabled
enclosure       = disk
cab-sno         = DISKS
asl             = scsi3_jbod
vid             = VMware,
pid             = VMware Virtual S
array-name      = Disk
array-type      = Disk
iopolicy        = MinimumQ
avid            = -
lun-sno         = 6000C29A8511F1C593A6B3235534E5EA
udid            = VMware%2C%5FVMware%20Virtual%20S%5FDISKS%5F6000C29A8511F1C593A6B3235534E5EA
dev-attr        = -
###path         = name state type transport ctlr hwpath aportID aportWWN attr
path            = c2t1d0s2 enabled(a) - SCSI c2 /pci@0,0/pci15ad,1976@10 - - -
#