Wednesday, March 28, 2012

How to Expand a Soft Partition

How to Expand a Soft Partition
When no other logical volumes have been built on a soft partition, you can add space
to the soft partition. Free space is located and used to extend the partition. Existing
data is not moved.
1. Read the “Background Information About Soft Partitions” on page 122.
2. Use one of the following methods to expand a soft partition:
_ From the Enhanced Storage tool within the Solaris Management Console, open the
Volumes node. Choose the soft partition you want to expand, then choose
Action->Properties, then follow the instructions on screen. For more information,
see the online help.
_ To add space to a soft partition, use the following form of the metattach
command:
metattach [-s disk-set] soft-partition size
disk-set is the name of the disk set in which the soft partition exists.
soft-partition is the name of an existing soft partition.
size is the amount of space to add.

Example—Expanding a Soft Partition
This example shows how you can attach space to a soft partition and then expand the
file system that sits on it while the soft partition is online and mounted is online:

# mount /dev/md/dsk/d20 /home2
# metattach d20 10g
# growfs -M /home2 /dev/md/rdsk/d20

Linux Check CPU Sockets Cores Threads

1. number of physical processors :

# cat /proc/cpuinfo | grep "physical id" | sort -n | uniq | wc -l

2. number of cores :

# cat /proc/cpuinfo | grep "cpu cores" | uniq

3. find if ht enabled

# cat /proc/cpuinfo | grep "ht" | uniq

if u see "ht" in flags then ht is enabled

suppose cpuinfo gives u the numbers

CPUs = 24 (0 to 23 )
siblings in each CPU = 12
CPU cores in each CPU = 6

that means each CPU is hyper threading enabled.

siblings (12 ) = cores (6) x hyper-threading (2)

number of physical CPUs = 24 / 12 = 2 !

Monday, March 19, 2012

Rescan LUNs

Solaris
he cfgadm command provides configuration administration operations on dynamically reconfigurable hardware resources. Pass the -l option to Lists the state and condition of attachment points specified. Login as root and type the following command:
cfgadm -al

Linux
echo - - - > /sys/class/scsi_host/host0/scan

Thursday, March 15, 2012

RedHat Adding Swap Space

Adding Swap Space

Sometimes it is necessary to add more swap space after installation. For example, you may upgrade the amount of RAM in your system from 128 MB to 256 MB, but there is only 256 MB of swap space. It might be advantageous to increase the amount of swap space to 512 MB if you perform memory-intense operations or run applications that require a large amount of memory.
You have three options: create a new swap partition, create a new swap file, or extend swap on an existing LVM2 logical volume. It is recommended that you extend an existing logical volume.

5.2.1. Extending Swap on an LVM2 Logical Volume

To extend an LVM2 swap logical volume (assuming /dev/VolGroup00/LogVol01 is the volume you want to extend):
  1. Disable swapping for the associated logical volume:
    # swapoff -v /dev/VolGroup00/LogVol01
    
  2. Resize the LVM2 logical volume by 256 MB:
    # lvm lvresize /dev/VolGroup00/LogVol01 -L +256M
    
  3. Format the new swap space:
    # mkswap /dev/VolGroup00/LogVol01
    
  4. Enable the extended logical volume:
    # swapon -va
    
  5. Test that the logical volume has been extended properly:
    # cat /proc/swaps # free
    

5.2.2. Creating an LVM2 Logical Volume for Swap

To add a swap volume group (assuming /dev/VolGroup00/LogVol02 is the swap volume you want to add):
  1. Create the LVM2 logical volume of size 256 MB:
    # lvm lvcreate VolGroup00 -n LogVol02 -L 256M
    
  2. Format the new swap space:
    # mkswap /dev/VolGroup00/LogVol02
    
  3. Add the following entry to the /etc/fstab file:
    /dev/VolGroup00/LogVol02   swap     swap    defaults     0 0
    
  4. Enable the extended logical volume:
    # swapon -va
    
  5. Test that the logical volume has been extended properly:
    # cat /proc/swaps # free
    

5.2.3. Creating a Swap File

To add a swap file:
  1. Determine the size of the new swap file in megabytes and multiply by 1024 to determine the number of blocks. For example, the block size of a 64 MB swap file is 65536.
  2. At a shell prompt as root, type the following command with count being equal to the desired block size:
    dd if=/dev/zero of=/swapfile bs=1024 count=65536
    
  3. Setup the swap file with the command:
    mkswap /swapfile
    
  4. To enable the swap file immediately but not automatically at boot time:
    swapon /swapfile
    
  5. To enable it at boot time, edit /etc/fstab to include the following entry:
    /swapfile          swap            swap    defaults        0 0
    
    The next time the system boots, it enables the new swap file.
  6. After adding the new swap file and enabling it, verify it is enabled by viewing the output of the command cat /proc/swaps or free.

Tuesday, March 13, 2012

Power Path Operation on RedHat

Check if License installed or not
# powermt check_registration
<key shows up here>
  Product: PowerPath
  Capabilities: All
Start Power Path
# /etc/init.d/PowerPath start

install license

# emcpreg -install

===========   EMC PowerPath Registration ===========
Do you have a new registration key or keys to enter?[n] y
Enter the registration keys(s) for your product(s),
one per line, pressing Enter after each key.
After typing all keys, press Enter again.

Key (Enter if done): **emc-powerpath-license-key**
1 key(s) successfully added.
Key successfully installed.

Key (Enter if done):
Key  is invalid, ignored.
Try again or press Enter if done.
1 key(s) successfully registered


powermt config
powermt save
powermt set policy=co dev=all
powermt display dev=all

to clean up dead LUN
pwermt check

Cleaning up wstemp directory for WAS adminconsole workspace

remove all contents under the following folders:


dmgr_profile/wstemp
dmgr_profile/config/temp
dmgr_profile/temp

Wednesday, March 7, 2012

Unix Sort by Date in Text file

Data File

d10NVaR_Berm_Pll_AggrInfo_ST 03/05/2012
d10NVaR_Berm_Stress_New_PVs 03/05/2012
command line:
sort -r -t ' ' -nk2.7,2.10 -nk2.1,2.2 -nk2.4,2.5 called_jobs.txt > sorted_by_date.txt