Fix Corrupted Veritas Filesystem VXFS

A Vertitas filesystem can sometimes become corrupted. This specially happens when your replicating a filesystem. So how do you fix that !? Well lets begin.

Say your importing a  diskgroup called app-dg

vxdg import app-dg

#VxVM vxdg ERROR V-5-1-10978 Disk group app-dg: import failed:
Disk is in use by another host

Now lets list all the disk groups on the system

vxdisk -o alldgs list

So how do you fix it ? You have to clear the host ID attached with that disk group

vxdg -f -C import app-dg

vxvol -g app-dg startall

Now lets mount it

mount /local/zones/app/appmount
UX:vxfs mount: ERROR: V-3-21268: /dev/vx/dsk/app-dg/appmount  is corrupted. needs checking.

Oops so now we begin the real fixing.

fsck -F vxfs -o full /dev/vx/dsk/app-dg/appmount
log replay in progress
pass0 – checking structural files
pass1 – checking inode sanity and blocks
pass2 – checking directory linkage
pass3 – checking reference counts
pass4 – checking resource maps
OK to clear log? (ynq)y
flush fileset headers? (ynq)y
set state to CLEAN? (ynq)y

Now you have repaired the file system now mount it again

mount /local/zones/app/appmount

And voila ! 😉

Advertisements

Reboot or Shutdown a Solaris System

The best and safest command to do a clean shutdown or a reboot of a Solaris server is the 2 commands below. There are many commands with which you can achieve this. But if you have many scripts in init.d for application like Oracle DBand Oracle RAC. Then shutdown command is the way to go, also it prompts the users to save and shutdown their sessions.

To Reboot

shutdown -y -i6 -g0

To shutdown

shutdown -y -i5 -g0

Create Virtual Interface Solaris 10

Ocassionally you need to create a quick one node RAC setup for testing and one of the requirements is a private virtual interface. Virtual interfaces allow a single ethernet interface to listen on additional IP addresses. You can quickly do it in Solaris 10 so that the grid infrastructure setup can see the private virtual interconnect. You can do as below

After adding entry for private interconnect in etc/hosts file you can proceed.

Given an ethernet interface bge0 (use ifconfig -a to identify the names of your interfaces), you can create a subinterface called bge0:1 with the following command:

— Configure Virtual Interface Solaris 10–

Virtual interfaces allow a single ethernet interface to listen on additional IP addresses.

Given an ethernet interface bge0 (use ifconfig -a to identify the names of your interfaces), you can create a subinterface called bge0:1 with the following command:

# dladm show-dev
bge0 link: up speed: 1000 Mbps duplex: full
bge1 link: unknown speed: 0 Mbps duplex: unknown
bge2 link: unknown speed: 0 Mbps duplex: unknown
bge3 link: unknown speed: 0 Mbps duplex: unknown

# dladm show-link
bge0 type: non-vlan mtu: 1500 device: bge0
bge1 type: non-vlan mtu: 1500 device: bge1
bge2 type: non-vlan mtu: 1500 device: bge2
bge3 type: non-vlan mtu: 1500 device: bge3

ifconfig bge0:1 plumb

You can set the IP address of the interface to 10.90.1.102 and turn on the interface with the following command:

ifconfig bge0:1 10.90.1.102 up

ifconfig -a

lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
bge0: flags=1000843 mtu 1500 index 2
inet 172.*.*.* netmask ffffff00 broadcast 172.*.*.*
ether 0:14:4f:95:e1:38

Unless you do some additional nonstandard things in your network, all of the subinterfaces on a physical interface need to be in the same subnet.

To make the virtual interface persist following a reboot, you can add the ip address or hostame from /etc/hosts in the file /etc/hostname.bge0:1

more /etc/hosts

#
# Internet host table
#
::1 localhost

10.90.1.102 hostname-priv

vi /etc/hostname.bge0:1

Add the entry hostname-priv from the host file to the virtual interface suncsftst-priv. And now it will persis after a reboot also.