Reuse a LUN


 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support Reuse a LUN
# 1  
Old 08-17-2012
Reuse a LUN

I have a LUN (From HP-Storage VA7110) that is claimed on 2 servers, but is in used in one of the VG on Server-1 .
Now I want to shut Server-1 and re-use that LUN on server-2 .

Code:
Server-1
Path-1 : /dev/rdsk/c4t0d1 
Path-2: /dev/rdsk/c6t0d1

Server-2
Path-1: /dev/rdsk/c5t0d1  
Path-2: /dev/rdsk/c4t0d1

Am new on HP-UX, confused with right steps .

1. Do I need to format LUN: /dev/rdsk/c4t0d1 before reuse with new VG on server-2
2. If need to format, what command I can use safely
3. Also I want alternate path to be available with new VG as well, so is below syntax is right .

On Server-2
Code:
# pvcreate -f /dev/rdsk/c5t0d1
# mkdir /dev/vg05
# mknod /dev/vg05/group c 64 0x050000 
# vgcreate -l 255 -p 32 -s 8 /dev/vg05   /dev/rdsk/c5t0d1   /dev/dsk/c4t0d1
# vgdisplay -v vg05

--Shirish Shukla

Last edited by Shirishlnx; 08-17-2012 at 08:58 AM..
# 2  
Old 08-17-2012
I suggest you do a
Code:
 pvdisplay -v /dev/dsk/c4t0d1 | more

and see what is on it before going further... Why is the disk seen on both servers, is this a cluster ( or was...)?
# 3  
Old 08-17-2012
No server is not in cluster, have clean exported the VG and de-provisioned that server-1 .

Now I want to use same LUN on Server-2 as fresh to extend an existing volume group .

Last edited by Shirishlnx; 08-17-2012 at 02:17 PM..
# 4  
Old 08-19-2012
You will need to run on server-1 (on which you want to remove the LUN from)

1. vgdisplay -v the group, and write down the LUN's/disks that are used in it.
2. vgexporton that volume group.
3. pvremove on disks that are inside that volume group.
4. Depresent the disks from storage side.
5. Run ioscan -fnC disk, and check for NO_HW
6. Run rmsf -H on NO_HW devices

You have now removed the Lun(s) from server1.

Present the lun's to server 2, run ioscan -fnC disk.
If you are running v2, you will need to run insf -e to create devices, on v3 they will be created after ioscan.
Verify the results with xpinfo, or similar tool.
Run pvcreate on those rdsks created (you don't need -f if you ran pvremove on server1), only per one path is enough of course.
Use the LUN in new or existing volume group.

Notice, if you are running v2 and you are using multipath, you will need to add both paths in your volume group via vgextend (existing) or vgcreate (new).

Hope that helps.
Regards
Peasant.
# 5  
Old 08-21-2012
Thanks Peasant .

Now am getting below error while importing same on cluster node .

Code:
# vgimport -p -v -s -m /tmp/vg01.map /dev/vg01
Beginning the import process on Volume Group "/dev/vg01".
Verification of unique LVM disk id on each disk in the volume group
/dev/vg01 failed.
Following are the sets of disks having identical LVM disk id
/dev/dsk/c5t0d2 /dev/dsk/c4t1d1 /dev/dsk/c5t1d1
/dev/dsk/c5t0d3 /dev/dsk/c4t1d2 /dev/dsk/c5t1d2


# vgimport -p -v -s -m /tmp/vg01.map /dev/vg01 /dev/dsk/c5t0d2 /dev/dsk/c5t0d3 /dev/dsk/c4t0d2 /dev/dsk/c4t0d3 /dev/dsk/c5t0d1 /dev/dsk/c4t0d1
Beginning the import process on Volume Group "/dev/vg01".
Verification of unique LVM disk id on each disk in the volume group
/dev/vg01 failed.
Following are the sets of disks having identical LVM disk id
/dev/dsk/c5t0d2 /dev/dsk/c4t1d1 /dev/dsk/c5t1d1
/dev/dsk/c5t0d3 /dev/dsk/c4t1d2 /dev/dsk/c5t1d2

Do you have any clue why am getting so ... and how to resolve this ..
# 6  
Old 08-21-2012
This is because the new disks that you are adding have the same LVM id as existing ones on machine

Are you sure this is not a serviceguard cluster or some storage based cloning like truecopy or business copy ?

If you are sure those are the disks you want to use...

Code:
vgexport /dev/vg01
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x050000
vgchgid  /dev/rdsk/c5t0d2 /dev/rdsk/c5t0d3 /dev/rdsk/c4t0d2 /dev/rdsk/c4t0d3 /dev/rdsk/c5t0d1 /dev/rdsk/c4t0d1
vgimport /dev/vg01 /dev/dsk/c5t0d2 /dev/dsk/c5t0d3 /dev/dsk/c4t0d2 /dev/dsk/c4t0d3 /dev/dsk/c5t0d1 /dev/dsk/c4t0d1

Notice rdsk when using vgchgid and dsk in vgimport.

You will not use -m or -s in this case.

Just please, be sure about your operations and what are you trying to achive, since this looks like some volume group migration from one host to another, rather then reusing of existing luns.

Regards
Peasant.
# 7  
Old 08-21-2012
Yes.. there's serviceguard cluster and each LUN (from HP Storage VA7110) having true copy and business copy ..

- Have check business copy is taken but is of 0MB size .. (AM not sure why..)

- Have added a LUN on Primary cluster server and are able to see the extended space in VG and both path ..

< ON Server-1 >
Code:
# strings /etc/lvmtab
/dev/vg00
/dev/dsk/c1t2d0
/dev/dsk/c2t2d0
/dev/vg01
/dev/dsk/c5t0d2
/dev/dsk/c5t0d3
/dev/dsk/c4t0d2
/dev/dsk/c4t0d3
/dev/dsk/c5t0d1
/dev/dsk/c4t0d1



# vgdisplay -v vg01
..
..
      --- Physical volumes ---
   PV Name                     /dev/dsk/c5t0d2
   PV Name                     /dev/dsk/c4t0d2  Alternate Link
   PV Status                   available
   Total PE                    5631
   Free PE                     0
   Autoswitch                  On

   PV Name                     /dev/dsk/c5t0d3
   PV Name                     /dev/dsk/c4t0d3  Alternate Link
   PV Status                   available
   Total PE                    5631
   Free PE                     1
   Autoswitch                  On

   PV Name                     /dev/dsk/c5t0d1
   PV Name                     /dev/dsk/c4t0d1  Alternate Link
   PV Status                   available
   Total PE                    5119
   Free PE                     1279
   Autoswitch                  On

Now I want same to be updated on secondary node vg01 .

?? Do vgchgid requires any downtime .. on primary cluster

Last edited by Shirishlnx; 08-21-2012 at 09:51 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Reuse format strings

I have a collection of format strings for sscanf, such as "%02d%*1s%02d%*1s%02d" to read in certain formatted strings, such as dates, times, etc. I wonder if there is a way to use them in printf without some changes? The example above would not work - at least I can't think of any ways to... (4 Replies)
Discussion started by: migurus
4 Replies

2. Shell Programming and Scripting

How to reuse values in Shell script

Hi I am trying to write a shell script and wanted to re-use the value which I have entered already. Here is the sample code. echo "Enter Value : \c" ; read val echo "Enter number: $val\c" ; read num Now I wanted to change the value as showing in 2nd Line or if I will use enter, it... (15 Replies)
Discussion started by: SushilAnand
15 Replies

3. Shell Programming and Scripting

How to declare variables once and reuse them in other scripts?

Hello everyone. I'm trying to create a conf file with variables that my other scripts will use. I have several scripts that use the same variables, and since I don't know how to read them from an external file, i define them in each script (and then if i want to change one's value i need to... (4 Replies)
Discussion started by: moshe88
4 Replies

4. UNIX for Dummies Questions & Answers

Reuse argument from current command?

I'm currently using zsh. Sometimes I find myself wishing to reuse an argument from earlier in the command. I know that I can, of course, assign an argument to a variable ahead of time, and then easily use that variable more than once. I know about the ability to reuse arguments from previous... (0 Replies)
Discussion started by: marshaul
0 Replies

5. Shell Programming and Scripting

Reuse Variable..

Hi. I have these two variables: My objective here is to reuse that $file_name variable again and again by resetting the $cv value. for example, if i reissue the cv="$(print 'CV01')" command, thus $file_name is now should be "CP99978_CV01.TXT", not "CP99978_CV01.TXT" anymore. How I'm... (7 Replies)
Discussion started by: aimy
7 Replies

6. Solaris

I have LUN ID, how to find disk relate to that LUN ID?

I have a list of LUN ID, my task is to find if disk has been added or not. How do I do that? I have been searching the forum and not able to find answer. thanks (4 Replies)
Discussion started by: uuontario
4 Replies

7. Linux

suggest some ideas for reuse

hi can you all help me to develop anything in unix that could be reused. any module or application could be helpful (0 Replies)
Discussion started by: infyanurag
0 Replies

8. HP-UX

Reuse disk from other HP-UX

Hello, I have 2 hp-ux both running 11.23, I have move one of a harddisk from "UNIX A" to "UNIX B", so how can I read back the data in "UNIX B"? Thanks (5 Replies)
Discussion started by: zetadhell
5 Replies

9. UNIX for Advanced & Expert Users

Password reuse utility

Does anyone know of a password reuse utility for Solaris 7 or 8? Security people are telling me that I need one. Thanks (1 Reply)
Discussion started by: rtoba
1 Replies

10. UNIX for Dummies Questions & Answers

How to reuse same major number

Hi, I am working on device drivers.Once If register a device i'll get one major no. If i unregister and register again i'll get a different major no.What i have to do to get same major no. each time :( (0 Replies)
Discussion started by: Agnello
0 Replies
Login or Register to Ask a Question