Powered By Blogger

Monday, September 19, 2011

Booting from Mirror Disk (ZFS Filesystem)

Checking the system if root file system is mirrored or not

# zpool status rpool
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
c1t0d0s0 ONLINE 0 0 0
c1t1d0s0 ONLINE 0 0 0


You can see c1t1d0s0 is root mirror disk

If pool was attached later please execute following command to make it bootable

# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0


Changing use-nvramrcvalue for using eeprom feature from the system


Check the value
# eeprom use-nvramrc?
use-nvramrc?=false

Set to true

# eeprom use-nvramrc?=true

Check the value

# eeprom use-nvramrc?
Getting device Information and configure it

# ls -l /dev/dsk/c1t1d0s0
lrwxrwxrwx 1 root root 49 Feb 11 2010 /dev/dsk/c1t1d0s0 ->../../devices/pci@400/pci@0/pci@8/scsi@0/sd@1,0:a

In the above highlighted output, remove /devices and replace disk in the place sd
Like
/pci@400/pci@0/pci@8/scsi@0/disk@1,0

Enter following command to create root mirror devalias

# eeprom nvramrc="devaliasrootmirror /pci@400/pci@0/pci@8/scsi@0/disk@1,0"



Bring the system to ok Prompt and verify configuration

# init 0

ok devalias ( to verify rootmirror is created)

rootmirror /pci@400/pci@0/pci@8/scsi@0/disk@1,0
primary-vds0 /virtual-devices@100/channel-devices@200/virtual-disk-server@0
primary-vswp0 /virtual-devices@100/channel-devices@200/virtual-network-switch@0
primary-vswp1 /virtual-devices@100/channel-devices@200/virtual-network-switch@1
primary-vcc0 /virtual-devices@100/channel-devices@200/virtual-console-concentrator@0
ttya /ebus@c0/serial@0,ca0000
net3 /pci@500/pci@0/pci@8/network@0,3
net2 /pci@500/pci@0/pci@8/network@0,2
net1 /pci@500/pci@0/pci@8/network@0,1
net0 /pci@500/pci@0/pci@8/network@0
net /pci@500/pci@0/pci@8/network@0
cdrom /pci@400/pci@0/pci@1/pci@0/usb@0,2/hub@4/device@4/storage@0/disk@0:f
disk15 /pci@400/pci@0/pci@8/scsi@0/disk@f
disk14 /pci@400/pci@0/pci@8/scsi@0/disk@e
disk13 /pci@400/pci@0/pci@8/scsi@0/disk@d
disk12 /pci@400/pci@0/pci@8/scsi@0/disk@c
disk11 /pci@400/pci@0/pci@8/scsi@0/disk@b
disk10 /pci@400/pci@0/pci@8/scsi@0/disk@a
disk9 /pci@400/pci@0/pci@8/scsi@0/disk@9
disk8 /pci@400/pci@0/pci@8/scsi@0/disk@8
disk7 /pci@400/pci@0/pci@8/scsi@0/disk@7
disk6 /pci@400/pci@0/pci@8/scsi@0/disk@6
disk5 /pci@400/pci@0/pci@8/scsi@0/disk@5
disk4 /pci@400/pci@0/pci@8/scsi@0/disk@4
disk3 /pci@400/pci@0/pci@8/scsi@0/disk@3
disk2 /pci@400/pci@0/pci@8/scsi@0/disk@2
disk1 /pci@400/pci@0/pci@8/scsi@0/disk@1
disk0 /pci@400/pci@0/pci@8/scsi@0/disk@0
disk /pci@400/pci@0/pci@8/scsi@0/disk@0
scsi /pci@400/pci@0/pci@8/scsi@0
virtual-console /virtual-devices/console@1


Boot from the roor mirror

ok boot rootmirror

Boot device: /pci@400/pci@0/pci@8/scsi@0/disk@1,0 File and args:





Tuesday, May 10, 2011

Configuring Linux Bonding

Switch:

Connect cables to the switch
Make link-aggregate active in the switch for the ports

Server:

1. Create the configuration file for bondX (where X is a number, we'll use 0 to explain the steps forward)
vi /etc/sysconfig/network-scripts/ifcfg-bond0

2. Add the fallowing content to it, update IP with correct information:
DEVICE=bond0
IPADDR=192.10.10.51
NETWORK=192.10.10.32
NETMASK=255.255.255.224
USERCTL=no
BOOTPROTO=none
ONBOOT=yes

3. Update all configuration files for the network interface that will be used by the new bond, using the fallowing template (Update the red text with the right values).
for eth0:
vi /etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE=eth0
HWADDR=00:34:34:D8:45:89
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

4. Prepare the drivers adding the fallowing lines to /etc/modprobe.conf:
alias bond0 bonding
options bond0 mode=802.3ad miimon=100
5. Load bonding module
# modprobe bonding mode=802.3ad miimon=100
6. Restart network
# service network restart
7. Test the bond
ping -I bond0 192.10.10.12

Monday, May 2, 2011

Expanding LUN on Solaris

1) Unmount the filesystem
umount /testing

2) Comment the line in the /etc/vfstab

3) format
Enter disk number
format> type
AVAILABLE DRIVE TYPES:
0. Auto configure
...
Specify disk type (enter its number)[24]: 0

format> part
partition> print ( verify)
partition> label ( Label it)
partition> quit
format> label (label it)
format> verify ( to Verify)
format> quit

4) uncomment the line in the /etc/vfstab which was commented in the step 2
5) mount /testing
6) growfs -M /testing /dev/rdsk/c3t12d0s6 ( Which will grow the filesystem)

Thursday, April 21, 2011

Restricted access on Solaris Server

1) Create a group with the users who need access

sshuser::140:testuser,tomcat,apache

2) Modify /etc/ssh/sshd_config, add following line

AllowGroups sshuser

3) Restart the ssh service

#svcadm restart network/ssh:default

Tuesday, April 12, 2011

Removing bonding in LINUX

ifconfig bond0 down
echo "-eth0" > /sys/class/net/bond0/bonding/slaves
echo "-eth1" > /sys/class/net/bond0/bonding/slaves
echo "-bond0" > /sys/class/net/bonding_masters
rmmod bonding

Removing Link Aggregate on Solaris

To remove an interface from an link aggregate:
Test-Server # dladm remove-aggr -d e1000g2 1
Test-Server #
To delete an aggregate:
Test-Server # dladm delete-aggr 1
Test-Server #

Monday, April 4, 2011

Checking apache httpd.conf location

execute following command from bin directory
# ./httpd -V and look for
-D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"
Welcome to the UNIX world