Powered By Blogger

Friday, December 2, 2011

LVM commands

pvs Displays physical volumes
vgs Displays volume groups
lvs Displays logical volumes
pvdisplay Displays detailed informationon physical volumes
vgdisplay Displays detailed informationon volume groups
lvdisplay Displays detailed informationon logical volumes
pvcreate Creates a new physical volume
vgcreate Creates a new volume group
lvcreate Creates a new logical volume
vgextend Extends an existing volume group
lvextend Extends a logical volume
lvresize Resizes a logical volume
lvreduce Reduces a logical volume
lvrename Renames a logical volume
pvmove Moves/migrates data from one physicalvolume to another
vgreduce Reduces a volume group
pvremove Removes a physical volume
vgremove Removes a volume group
lvremove Removes a logical volume

Some of the PRCTL commands

Most of the times, we get email from oracle team to modify some of the project setting. Following are the some of the commands:

Command to check value for project.max-shm-memory
# prctl -n project.max-shm-memory -i projectuser.oracle
Command to increase memory to 96 GB memory for running Process
# prctl -n project.max-shm-memory -r -v 96GB-i project user.oracle
Command to Make it permanentby updating /etc/project file
# projmod -sK "project.max-shm-memory=(privileged,103079215104,deny)"user.oracle
Command to check all parametersfor current user
# prctl $$
Command to check all parametersused for Oracle user
# prctl -i project user.oracle

Saturday, October 29, 2011

Mounting ISO to the solaris zones

# lofiadm -a /path/to/the/iso/file.iso
# mount -F hsfs -o ro /dev/lofi/1 /mnt
# mount -F lofs /mnt /zones//root/mnt

Steps to increase SWAP cap for solaris zones

# /bin/prctl -n zone.max-swap`pgrep -z init`
# prctl -n zone.max-swap-r -v 10GB `pgrep -z init`
# /bin/prctl -n zone.max-swap`pgrep -z init`

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)

Welcome to the UNIX world