Friday, 5 March 2010

Unix Basics refreshb

set –o vi
Then use + ansd – or j and K to navigate back through your commands

w
uptime, users logged in etc

ls -l | grep ^- | sort –nr
List the files in current directory sorted by size

ls -a1 | grep "^\."
List the hidden files in current directory

grep -ir ssh /var/log/*
grep -ir breakin /var/log/*
grep -ir security /var/log/*
Examples of grep querying log files for security breakins

du - k * | sort -nr (or)
du -k . | sort -nr
Display the Disk Usage of file sizes under each directory in current directory

find . -depth -print
Display the all files recursively with path under current directory

ps -aef | grep username
Display all processes running under your username (where username = your username)

ls -.ltr | sort -nr -k 5
Display the files in the directory by file size

ps –p $$
Find out what sell you are running

Sh hot keys
Ctrl+l . Clears the Screen.
Ctrl+r . Does a search in previously given commands in shell.
Ctrl+u - Clears the typing before the hotkey.
Ctrl+a . Places cursor at the beginning of the command at shell.
Ctrl+e . Places cursor at the end of the command at shell.
Ctrl+d . Kills the shell.
Ctrl+z . Places the currently running process into background.

Use fuser to discover what processes are stopping a volume from unmounting

du -sk * | sort -nr | head
Display top ten largest files/directories

ptree Example: ptree 1267
or
pstree
Display the parent/child tree of a process

pwdx Example: pwdx 1267
Show the working directory of a process

pfiles Example: pfiles 1267
Display the processes current open files

top (or) prstat
shows cpu utilization

vmstat (or) glance
for memory

date | awk ‘{print $2 ” ” $6}’
AWK example, to print only the second and sixth fields of the date command (the month and year) with a space separating them. You would get the output
Mar 2010
From a total output of
Thu Mar 4 13:14:43 GMT 2010

quota –v
show current disk usage and limits

chmod u-x,go+r myfile
chang myfile so owner loses execute privs, and group and other gain read access

ln file1 file2
create a second file name – eg file2 – that is a dynamically updated copy of file1

ln –s file3 target3
symbolic links are nothing more than shortcuts to a file – they point at a file
if you move or delete the source file then the link is useless

iostat –En
lists disks

format
lists disks

How can a parent and child process communicate?
A parent and child can communicate through any of the normal inter-process communication schemes (pipes, sockets, message queues, shared memory), but also have some special ways to communicate that take advantage of their relationship as a parent and child. One of the most obvious is that the parent can get the exit status of the child.
What is a zombie?
When a program forks and the child finishes before the parent, the kernel still keeps some of its information about the child in case the parent might need it - for example, the parent may need to check the child's exit status. To be able to get this information, the parent calls `wait()'; In the interval between the child terminating and the parent calling `wait()', the child is said to be a `zombie' (If you do `ps', the child will have a `Z' in its status field to indicate this.)
What are the process states in Unix?
As a process executes it changes state according to its circumstances. Unix processes have the following states:
Running : The process is either running or it is ready to run .
Waiting : The process is waiting for an event or for a resource.
Stopped : The process has been stopped, usually by receiving a signal.
Zombie : The process is dead but have not been removed from the process table.
What are various IDs associated with a process?
Unix identifies each process with a unique integer called ProcessID. The process that executes the request for creation of a process is called the 'parent process' whose PID is 'Parent Process ID'. Every process is associated with a particular user called the 'owner' who has privileges over the process. The identification for the user is 'UserID'. Owner is the user who executes the process. Process also has 'Effective User ID' which determines the access privileges for accessing resources like files.
• getpid() -process id
• getppid() -parent process id
• getuid() -user id
• geteuid() -effective user id

ps –el | grep ‘Z’
finding zombie processes

vxprint –Ath

vxdisk list

vxdiskadm

powermt display

powermt display ports

powermt display dev=all

syminq

netstat
Displays generic net statistics of the host you are currently connected to.
netstat -an
Shows all connections to the server including the source and destination ips and ports if you have proper permissions.
netstat -rn
Displays routing table for all ips bound to the server.
netstat -an |grep :80 |wc -l
Display the amount of active connections on port 80. Removing the pipe and wc command would display each connection.
netstat -natp
Display active Internet connections.
ifconfig eth0
View the network settings on the first Ethernet adapter installed in the computer.
ifconfig -a
Display info on all network interfaces on server, active or inactive.
ifconfig eth0 down
If eth0 exists would take it down causing it cannot send or receive any information.
ifconfig eth0 up
If eth0 exists and in the down state would return it back to the up state allowing to to send and receive information.
ifconfig eth0 192.168.1.102 netmask 255.255.255.0 broadcast 192.168.1.255
Assign eth0 with the above values for IP, netmask and broadcast address.


mount -t nfs eslat001:/opt/ims /app/ims
mount -t nfs eslat001:/opt/rims /app/rims
example of how to mount an nfs mount
and then add to the /etc/fstab with the following entries;

servername:/pathofdir /pathonserver nfs options 0 0

where;

The corresponds to hostname, IP address, or fully qualified domain name of the server exporting the file system.

The is the path to the exported directory.

The specifies where on the local file system to mount the exported directory. This mount point must exist before /etc/fstab is read or the mount will fail.

The nfs option specifies the type of file system being mounted.

The area specifies mount options for the file system. For example, if the options area states rw,suid, the exported file system will be mounted read-write and the user and groupid set by the server will be used. Note that parentheses are not to be used here

Wednesday, 30 September 2009

How to list contents of an rpm in Red Hat Linux

server0103 # rpm -q -lp autosys-client-ALD-lonos-1.0-2.noarch.rpm
warning: GEOSautosys-client-ALD-lon-1.0-2.noarch.rpm: V3 DSA signature: NOKEY, key ID b4ac8093
/etc/auto.profile
/etc/xinetd.d/auto_remote_ALD
/opt/CA/sybase
/opt/CA/sybase/interfaces
/opt/CA/uajm
/opt/CA/uajm/ald
/opt/CA/uajm/ald/autosys
/opt/CA/uajm/ald/autosys/bin
/opt/CA/uajm/ald/autosys/bin/auto_remote
/opt/CA/uajm/ald/autosys/bin/autorep
/opt/CA/uajm/ald/autosys/bin/jil
/opt/CA/uajm/ald/autosys/bin/sendevent
/opt/CA/uajm/ald/autouser
/opt/CA/uajm/ald/autouser/autosys.csh
/opt/CA/uajm/ald/autouser/autosys.env
/opt/CA/uajm/ald/autouser/autosys.ksh
/opt/CA/uajm/ald/autouser/autosys.sh
/opt/ixp/agent
/opt/ixp/agent/conf
/opt/ixp/bin
/opt/ixp/bin/ixagent
/opt/ixp/bin/ixautorep
/opt/ixp/bin/ixflags
/opt/ixp/bin/ixjil
/opt/ixp/bin/ixsendevent
/opt/ixp/etc
/opt/ixp/etc/ixp.conf
/opt/ixp/lib
/opt/ixp/lib/ixp.jar

Monday, 28 September 2009

vxvm troubleshooting - claim ownership of disk for new diskgroup

this is the issue

trying to add a disk to a diskgroup via vxdiskadm option 1 - the disk used to belong to a solaris host (this is emc symmetrix device)- and the disk is already owned by a diskgroup on the eupr0037 (now decommisoned) and I want to add it to eupr0201

when I do a vxdisk list cxtxtdx it shows the disk as owned by a dgprapdcd01 (a dg on the decommed eupr0037)

the solution is simple – run the following command

vxdisk –f init cxtxdx

and then run a vxdisk list cxtxdx and you will see diff ownership for the disk and no group assigned to it

you can then run a vxdiskadm > option 1 and readd the disk you want to the diskgroup you want

Friday, 11 September 2009

mount nfs mount and add it fstab in linux

example of how to mount an nfs mount

mount -t nfs eslat001:/opt/ims /app/ims
mount -t nfs eslat001:/opt/rims /app/rims


and then add to the /etc/fstab with the following entries;

servername:/pathofdir /pathonserver nfs options 0 0


where;

The corresponds to hostname, IP address, or fully qualified domain name of the server exporting the file system.

The is the path to the exported directory.

The specifies where on the local file system to mount the exported directory. This mount point must exist before /etc/fstab is read or the mount will fail.

The nfs option specifies the type of file system being mounted.

The area specifies mount options for the file system. For example, if the options area states rw,suid, the exported file system will be mounted read-write and the user and groupid set by the server will be used. Note that parentheses are not to be used here

Wednesday, 9 September 2009

vpar & npar

Npar : Hard partitioning - Partitioned at SBA level -Hardware failure won't affect the other partition

VPar : Soft Patitioning - Partitioned at LBA level : Hardware failure can affect other partition - Software failure wont affect other partition.

Various HP superdome stuff

useful links;

http://docs.hp.com/en/B2355-90702/ch05s05.html#babbhcbb

and

http://my.safaribooksonline.com/0131927590/ch17lev1sec4


to get to the MP>CM stuff, you need to be on the seperate node that runs the MP stuff

once on that node, you get presented with the following;




(c) Copyright 2005 Hewlett-Packard Development Company, L.P.

Welcome to the
Management Processor
HP 9000 and Integrity Superdome Server SD64B


Supported firmware-updateable entity combination: Recipe SD 6.20c



MP MAIN MENU:

CO: Consoles
VFP: Virtual Front Panel
CM: Command Menu
CL: Console Logs
SL: Show Event Logs
FW: Firmware Update
HE: Help
X: Exit Connection

[eupr0200] MP>


The VFP allows you to boot and reboot partitiions etc, the CM we will come to shortly - CL (console logs) is self explanatary, as are the others;

to verify if the IP address of the console you are connected to is public or private, run MP>CM>LS and you will get confirmation

Enter HE to get a list of available commands

(Use to return to main menu.)

[euisjd0] MP:CM> LS

Current configuration of MP customer LAN interface
MAC address : 01:1a:4b:we:27:c7
IP address : 10.157.73.122 0x0aa94sdd96
Name : eupr0200
Subnet mask : 255.255.255.0 0xffffff00
Gateway : 10.157.73.122 0x0adff901
Status : UP and RUNNING


Current configuration of MP private LAN interface
MAC address : 00:22:f0:02:4d:qs
IP address : 192.128.2.11 0xds328020a
Name : priv-00
Subnet mask : 255.255.255.0 0xffffff00
Gateway : 192.128.2.11 0xdsar20a
Status : UP and RUNNING

[eudsasd0] MP:CM>


you can get lots of output from the CM



[edfsddfds0] MP:CM> sysrev



Supported firmware-updateable entity combination: Recipe SD 6.20c




| Cab 0 | Cab 1 | Cab 8 | Cab 9 |
---------+-----------------+-----------------+----------------+----------------|
MP | 024.004.001 | | | |
ED | 024.015.000 | | | |
CLU | 024.000.005 | 024.000.005 | 024.000.005 | |
PM | 022.001.002 | 022.001.002 | 022.001.002 | |
RPM0 | 002.002.000 | 002.002.000 | | |
RPM1 | 002.002.000 | 002.002.000 | | |
RPM2 | 002.002.000 | 002.002.000 | | |
OSP | 000.011.000 | 000.011.000 | | |



Key: * - Not at the highest entity revision supported by this combination.



Please type to continue, Q to quit, or S to stream: q
[efsdsffd0] MP:CM> cp



-------------------------------+
Cabinet | 0 | 1 |
-------------+--------+--------+
Slot |01234567|01234567|
-------------+--------+--------+
Partition 0 |........|XXX.....|
Partition 1 |........|.....X..|
Partition 2 |........|...X....|
Partition 3 |XXXX....|........|
Partition 4 |........|....X.X.|
Partition 5 |....XXX.|........|



[eufdsfewg] MP:CM> io



--------------------------+
Cabinet | 0 | 1 |
--------+--------+--------+
Slot |01234567|01234567|
--------+--------+--------+
Cell |XXXXXXX.|XXXXXXX.|
IO Cab |0.0.080.|1.81118.|
IO Bay |1.1.010.|1.01000.|
IO Chas |3.1.113.|3.11313.|



[asdsafv] MP:CM>

Friday, 14 August 2009

ILO issues and HOT KEYS

If you get an ilo issue with a remote console - as i recently have - where it is stuck and not booting, but giving you Function key options (for example, F10 to enter sys maintenance mode - always a good idea) - then if function keys are not set up, you need to do it. Luckily, setting up hot keys is simple - just go to remote console > remote console hot keys, and you can set up your function key 'hot keys' there

FYI, I did an F10 and got into the GRUB menu and could then boot into linux, as opposed to windows (which is what the console was telling me it was configured as - even though I knew the OS was linux...........)

Thursday, 13 August 2009

powermt check to clean up dead powerpath paths

server005:root / > ./sbin/powermt display dev=all
Symmetrix ID=000287751748
Logical device ID=03E7
state=alive; policy=SymmOpt; priority=0; queued-IOs=0

Symmetrix ID=000290103418
Logical device ID=03BB
state=alive; policy=SymmOpt; priority=0; queued-IOs=0
==============================================================================
---------------- Host --------------- - Stor - -- I/O Path - -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
18 6/0/2/1/0.97.5.19.0.13.1 c18t13d1 FA 9aA active alive 0 1
21 6/0/13/1/0.97.5.19.0.13.1 c21t13d1 FA 8aA active alive 0 1

Symmetrix ID=000290103418
Logical device ID=03CF
state=alive; policy=SymmOpt; priority=0; queued-IOs=0
==============================================================================
---------------- Host --------------- - Stor - -- I/O Path - -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
18 6/0/2/1/0.97.5.19.0.13.6 c18t13d6 FA 9aA active dead 0 1
21 6/0/13/1/0.97.5.19.0.13.6 c21t13d6 FA 8aA active dead 0 1




server005:root / > ./sbin/powermt check
Warning: Symmetrix device path c18t13d6 is currently dead.
Do you want to remove it (y/n/a/q)? y
Warning: Symmetrix device path c21t13d6 is currently dead.
Do you want to remove it (y/n/a/q)? y



server005:root/ > ./sbin/powermt display dev=all

Symmetrix ID=000290103418
Logical device ID=03BB
state=alive; policy=SymmOpt; priority=0; queued-IOs=0
==============================================================================
---------------- Host --------------- - Stor - -- I/O Path - -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
18 6/0/2/1/0.97.5.19.0.13.1 c18t13d1 FA 9aA active alive 0 1
21 6/0/13/1/0.97.5.19.0.13.1 c21t13d1 FA 8aA active alive 0 1

Thursday, 30 July 2009

How to give a user su root access with sudoers

How to add an entry in a local sudoers file to enable an individual user su root access

These are the type of entries – just edit file with vi


#Temp access for 10 days from 200709 - itask 1374893
gbsmnt eudt0076-dt = SUROOT

#Temp access for 10 days from 300709 - itask 1392545
gbchgd eudt0076-dt = SUROOT

Thursday, 23 July 2009

vxdmp - veritas dynamic multipathing

The vxdmpadm utility is a command line administrative interface to the DMP feature of VxVM.

You can use the vxdmpadm utility to perform the following tasks.

Retrieve the name of the DMP device corresponding to a particular path

List all paths under a DMP device

List all controllers connected to disks attached to the host

List all the paths connected to a particular controller

Enable or disable a host controller on the system

Rename an enclosure

Control the operation of the DMP restore daemon

The following sections cover these tasks in detail along with sample output. For more information, see the vxdmpadm(1M) manual page.

Retrieving Information About a DMP Node

The following command displays the DMP node that controls a particular physical path:


# vxdmpadm getdmpnode nodename=c3t2d1

The physical path can be specified as the nodename attribute, which must be a valid path listed in the /dev/rdsk directory.

Use the enclosure attribute with getdmpnode to obtain a list of all DMP nodes for the specified enclosure.


# vxdmpadm getdmpnode enclosure=enc0

Displaying All Paths Controlled by a DMP Node

The following command displays the paths controlled by the specified DMP node:


# vxdmpadm getsubpaths dmpnodename=c2t1d0s2

The specified DMP node must be a valid node in the /dev/vx/rdmp directory.

You can also use getsubpaths to obtain all paths through a particular host disk controller:


# vxdmpadm getsubpaths ctlr=c2

Listing Information About Host I/O Controllers

The following command lists attributes of all host I/O controllers on the system:


# vxdmpadm listctlr all

This form of the command lists controllers belonging to a specified enclosure and enclosure type:


# vxdmpadm listctlr enclosure=enc0 type=X1

Disabling a Controller

Disabling I/O to a host disk controller prevents DMP from issuing I/O through the specified controller. The command blocks until all pending I/O issued through the specified disk controller are completed.

To disable a controller, use the following command:


# vxdmpadm disable ctlr=ctlr

Enabling a Controller

Enabling a controller allows a previously disabled host disk controller to accept I/O. This operation succeeds only if the controller is accessible to the host and I/O can be performed on it. When connecting active/passive disk arrays in a non-clustered environment, the enable operation results in failback of I/O to the primary path. The enable operation can also be used to allow I/O to the controllers on a system board that was previously detached.

To enable a controller, use the following command:


# vxdmpadm enable ctlr=ctlr

Listing Information About Enclosures

To display the attributes of a specified enclosure, use the following command:


# vxdmpadm listenclosure enc0

The following command lists attributes for all enclosures in a system:


# vxdmpadm listenclosure all

Renaming an Enclosure

The vxdmpadm setattr command can be used to assign a meaningful name to an existing enclosure, for example:


# vxdmpadm setattr enclosure enc0 name=GRP_1

This example changes the name of enclosure from enc0 to GRP_1.




NOTE: The maximum length of an enclosure name is 25 characters.



Starting the DMP Restore Daemon

The DMP restore daemon re-examines the condition of paths at a specified interval. The type of analysis it performs on the paths depends on the specified checking policy.

Use the start restore command to start the restore daemon and specify the policy:


# vxdmpadm start restore policy=check_disabled

The check_disabled policy (the default) checks the condition of paths that were previously disabled due to hardware failures, and revives them if they are back online. If the policy is set to check_all, the restore daemon analyzes all paths in the system and revives the paths that are back online, as well as disabling the paths that are inaccessible.




NOTE: The DMP restore daemon does not change the disabled state of the path through a controller that you have disabled using vxdmpadm disable.



The command vxdmpadm start restore is used to set the interval of polling. For example, the polling interval is set to 400 seconds using the following command:


# vxdmpadm start restore interval=400

The default interval is 300 seconds. Decreasing this interval can adversely affect system performance. To change the interval or policy, you must stop the restore daemon and restart it with new attributes.

Stopping the DMP Restore Daemon

Use the following command to stop the DMP restore daemon:


# vxdmpadm stop restore




NOTE: Automatic path failback stops if the restore daemon is stopped.



Displaying the Status of the DMP Restore Daemon

Use the following command to display the status of the automatic path restoration daemon, its polling interval, and the policy that it uses to check the condition of paths:


# vxdmpadm stat restored

This produces output such as the following:


The number of daemons running : 1
The interval of daemon: 300
The policy of daemon: check_disabled

Displaying Information About the DMP Error Daemons

To display the number of error daemons that are running, use the following command:


# vxdmpadm stat errord

Tuesday, 21 July 2009

Quick Crib for HPUX troubleshooting

uname -a
model
bdf
setboot
ioscan -fn
ioscan -funC disk
swlist -l product
strings /etc/lvmtab
vgdisplay -v
lvdisplay -v /dev/vg*/lv*
top
UNIX95=1 ps -efH

HPUX equivalent of ptree

I sorely miss the proc tools found on Solaris and Linux each time I have to deal with HP-UX - the tools pfiles, ptree, pkill, pgrep are just too valuable to go without. Here is just one hack I found that can effectively do the same function as ptree (well, sort of):

bash-3.00# UNIX95=1 ps -Hef
The output of all processes on the system will grouped by parent process id's with children processes nicely indented below their parents. Even though it is not even nearly as good as using a genuine ptree utility, since you may have to brose the longish list to find all the parents of the process you're interested in, it still has definite usefulness. Please remember not to export the UNIX95 variable since if exported this variable will effect the way other programs you may start from command line will behave after that point.

Wednesday, 1 July 2009

use getfacl to show file permissions and ownership

especially good if used recursively;

getfacl -R /aa/aaa/aaaa

Tuesday, 30 June 2009

hummingbird exceed

Below is the text of a document I wrote to setup Exceed.
****************************
Using Exceed X Server with SSH X11 Tunneling

Step 1: Install and configure Exceed on your PC

Step 2: Configure Exceed for Passive Mode and Multiple Windows

Exceed’s passive mode allows you to start the X Server on your PC without it making any initial attempt to connect to a specific remote host.

Set Exceed to use Passive Mode and Multiple Windows Mode. Both of these settings are Exceed defaults, but check the settings if Exceed has been used before.

1. Start -> Programs -> Hummingbird Connectivity 9.0 -> Exceed -> Xconfig
2. Set Passive Communications:
a. Click the Network and Communication link. This will open the Communications dialog box.
b. Select Passive from the mode field’s drop-down list.
c. Validate and apply changes (green checkmark on toolbar).
3. Set Multiple Windows Screen Definition:
a. Click the Display and Video link. This will open the Screen 0 dialog box.
b. Click the radio button beside Multiple in the Window Mode box in the upper left.
c. Validate and apply changes (green checkmark on toolbar).

Step 3: Configure Localhost Security

When using SSH X11 tunneling, the only host that Exceed will ever talk to is your own PC – the localhost. Thus, regardless of which or how many machines or accounts you’re going to use Exceed with, you only have to tell Exceed to answer to one machine – your local host.

1. Click the Security, Access Control and System Administration link. This will open the Security dialog box.
2. In the Host Access Control List section of the Security dialog box, click the radio button that is to the immediate left of the word File.
3. Click the Edit box to the right of the name xhost.txt. A NotePad editing session will be initiated, editing the xhost.txt file.
4. Type localhost on a new line in the file.
a. If your xhost.txt file already has other specific hosts listed, delete those lines.
5. Save your changes to xhost.txt by clicking File in the menu bar, then selecting Save.
6. Leave NotePad by clicking File in the menu bar, then selecting Exit.
7. Validate and apply changes (green checkmark on toolbar).

Step 4: Unconfigure your Unix Account

If you have set your account to talk to your X Server, you have to remove these settings before you can use it with SSH X11 tunneling.

For Korn/Bourne shell users, check your .profile file, and remove any lines that look like this:
export DISPLAY=xxx.xxx.xxx.xxx:0

After that, and X-Windows window will automatically open whenever you start an X-Windows program on any remote Unix host.

A good X-Windows program to test with when you first setup Exceed is xclock. On your Unix host using your Unix account, enter: /usr/X/bin/xclock &
and a small X-Windows window containing a clock will open on your PC’s screen.

Using Exceed X Server with SSH

When using telnet, passwords will be sent across the network in plain text and can be viewed with other network traffic using a sniffer or other methods. This is an example of the password being intercepted using the Solaris snoop utility:

158 12.50892 xxx.xx.xx.xxx -> myhost TELNET C port=665 X&d2k7GG\r

Where “X&d2k7GG\r” is your password with a return at the end. Using the Secure Shell start method will eliminate sending your password in plain text across the network.

1. Start -> Programs -> Hummingbird Connectivity 9.0 -> Exceed -> Xstart
2. In the Start Method box in the upper left, select Secure Shell (Set Display).
3. Enter the host in the box to the right of the word Host.
4. Enter the host type in the box to the right of the words Host Type by selecting Sun in the drop-down box. Then select the command to use by clicking on the ellipsis button and selecting XTerm. This will populate the command line with a predefined xterm command line.
5. To the right of the Information prompt, select the radio button labeled None.
6. In the Secure Shell Profile: field in the upper section of the xstart session, click on the ellipsis button. This will launch the Open Tunnel application.
7. In the lower left corner, click on the Add New Tunnel button. In the Tunnel name: box enter the name for your new tunnel.
8. Using the drop-down list in the Host name: field, select the host for your new tunnel.
9. Enter your Unix account login in the User name: field.
10. In the TCP port: field leave the default of 22.
11. After entering the information for the new tunnel, click OK.
12. This will add the new tunnel to the list. With your new tunnel highlighted, click Open in the lower right. The Secure Shell Profile: will now use this tunnel when opening a connection to your Unix host.

When you start Unix client connection using the Xstart Client Startup Application, you will be prompted for a Password Authentication. Enter your Unix account password and you will receive a secure connection to your Unix host.

Monday, 29 June 2009

If you cannot find an emulex or qlogic HBA driver on Red hat Linux

well, this driver might be the answer;

cpq_cciss 2.4.60 Jun 26 2006 HP cciss 2.4.60 HBA driver RPM

Friday, 26 June 2009

How to resize a volume within a diskgroup and add that storage to another volume in that diskgroup

Say you added space to a volume and it was the wrong volume. Luckily, both volumes are in the same diskgroup. Here is how you can move the storage from one vol to another. Very simple really;

you can do a vxdg free to see how much free space you have prior to this, then you can proceed;

# vxresize -F vxfs -g your_dg your_vol -100g

# vxresize -F vxfs -g your_dg your_other_vol +100g

How to resize a filesystem with specific disks under vxvm

A VxVM question:

I have a volume/filesystem spread over 4*146G disks. Now I want to shrink the filesystem - which I can do using vxresize. However, I want to shrink so that two of the four disks that the filesystem occupies are removed from the volume. Can I do that?

Yes, you can.

Assuming disks called disk1, disk2, disk3, disk4, volume "vol" and diskgroup "mydg" , and that you want to free disks 3 and 4.
Code:
vxassist -g mydg move vol disk1 disk2 \!disk3 \!disk4



So I should run vxresize to resize the filesystem to, say, 200G and then run vxassist? I just want to know exactly what I am going to have to do, because there is a netbackup master server running on that filesystem and obviously we do not want any data loss...

Yes, that's exactly it.

Do the resize to make sure you are under the capacity of two of the four disks, then the vxassist. I have had to do this recently when someone decided to grow a volume on a systems where the second plex in a mirror was detached and disassociated and a someone else decided to grow the volume and allocated all of the disks is the diskgroup as available. As a result an additional subdisks were allocated on on of the disks that should only have been assigned to the mirror plex.

I'll see if I have a machine handy and I'll a screen dump of this scenario, and the exact sequence.

Thursday, 25 June 2009

Search for installed linux packages

rpm -qa | grep whateveryouarelookingfor

EMC Client installation and checking for linux and solaris

EMC Client installation and checking

This web page is a quick guide on what to install and how to check that EMC SAN is attached and working

Solaris

Installing
==========================================================
Install Emulex driver/firmware, san packages (SANinfo, HBAinfo, lputil), EMC powerpath
Use lputil to update firmware
Use lputil to disable boot bios
Update /kernel/drv/lpfc.conf
Update /kernel/drv/sd.conf
Reboot
Install ECC agent

Note: when adding disks on different FA had to reboot server?

List HBA's /usr/sbin/hbanyware/hbacmd listHBAS (use to get WWN's)

/opt/HBAinfo/bin/gethbainfo (script wrapped around hbainfo)

grep 'WWN' /var/adm/messages
HBA attributes /opt/EMLXemlxu/bin/emlxadm

/usr/sbin/hbanyware/hbacmd HBAAttrib 10:00:00:00:c9:49:28:47
HBA port /opt/EMLXemlxu/bin/emlxadm

/usr/sbin/hbanyware/hbacmd PortAttrib 10:00:00:00:c9:49:28:47
HBA firmware /opt/EMLXemlxu/bin/emlxadm
Fabric login /opt/HBAinfo/bin/gethbainfo (script wrapped around hbainfo)
Adding Additional Disks cfgadm -c configure c2
Disk available cfgadm -al -o show_SCSI_lun

echo|format

inq (use to get serial numbers)
Labelling format
Partitioning vxdiskadm

format
Filesystem newfs or mkfs
Linux

Installing
==========================================================
Install Emulex driver, san packages (saninfo, hbanyware), firmware (lputil)
Configure /etc/modprobe.conf
Use lputil to update firmware
Use lputil to disable boot bios
Create new ram disk so changes to modprobe.conf can take affect.
Reboot
Install ECC agent

List HBA's
/usr/sbin/hbanyware/hbacmd listHBAS (use to get WWN's)

cat /proc/scsi/lpfc/*

HBA attributes /usr/sbin/hbanyware/hbacmd HBAAttrib 10:00:00:00:c9:49:28:47

cat /sys/class/scsi_host/host*/info
HBA port /usr/sbin/hbanyware/hbacmd PortAttrib 10:00:00:00:c9:49:28:47
HBA firmware lputil
Fabric login cat /sys/class/scsi_host/host*/state
Disk available cat /proc/scsi/scsi

fdisk -l |grep -I Disk |grep sd

inq (use to get serial numbers)
Labelling parted -s /dev/sda mklabel msdos (like labelling in solaris)
parted -s /dev/sda print
Partitioning fdisk

parted
Filesystem mkfs -j -L /dev/vx/dsk/datadg/vol01
PowerPath

HBA Info /etc/powermt display
Disk Info /etc/powermt display dev=all
Rebuild /kernel/drv/emcp.conf /etc/powercf -q
Reconfigure powerpath using emcp.conf /etc/powermt config
Save the configuration /etc/powermt save
Enable and Disable HBA cards used for testing
/etc/powermt display (get card ID)

/etc/powermt disable hba=3072
/etc/powermt enable hba=3072

Thursday, 11 June 2009

vxvm - what should you see if the disk is not under Vxvm control

cxtxdx auto:none online invalid

That is what you should see when a disk has been uninitialised;

you can uninitialise a disk from vxvm with the following

vxdiskunsetup -C cxtxdx