Operating System - HP-UX
1826615 Members
2330 Online
109695 Solutions
New Discussion

Re: Deleting/Recreating Volume

 
James Hager
Occasional Advisor

Deleting/Recreating Volume

I have never done this before, and work more with Oracle than with HP-UX, so please bear with me. If I sound like a total n00b, it's probably because I am. I just want to be sure that I am taking the correct steps to get this thing done right, rather than bugger it all up. So....

I have a CLARiiON CX400 connected to an RP7400. On the CLARiiON, I have a LUN that I need to resize. The only way that I see this is possible is to delete it and recreate it. My understanding is that this means I will need to delete the logical volume (as well as unbind the LUN, etc.). Is there a good guide to go with on this? Is there a doc that shows what I will need to do to undo what I have done with pvcreate, etc. when I set this up originally?

I am not looking to completely destroy this setup, if at all possible. I need to resize the LUN and make it bigger, so that I can use it to perform our test system refresh this weekend. I'd like to take the least destructive path to get there.

Thanks in advance,

--James
10 REPLIES 10
Pete Randall
Outstanding Contributor

Re: Deleting/Recreating Volume

James,

You are correct. You will need to remove the LV (using lvremove) before you can recreate the LUN. If you just deleted and recreated the LUN it would be very difficult to re-establish the logical volume because the system would still think it was there.


Pete

Pete
Torsten.
Acclaimed Contributor

Re: Deleting/Recreating Volume

James,

just umount the filesystem, lvremove the LVOL, resize the LUN and use SAM to create the new LVOL.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Ajitkumar Rane
Trusted Contributor

Re: Deleting/Recreating Volume

James,

You probably need to do a vgreduce after lvremove to remove the disk from the VG.

Rgds,

Ajit
Amidsts difficulties lie opportunities
Lolupee
Regular Advisor

Re: Deleting/Recreating Volume

I assume the LUN you are refering to is the SAN LUN. If it is why not create another LUN and add this to the present, so that you do not need to delete the former.

If you must delete the disk and it is the only one in the volume group , then the simplest way is just

umount the filesystems
# umount /
# vgchnage -a n
# vgexport
or if you want to keep the map file, doubt if it is necessary
# vgexport -s -m

this would remove from he lvmtab and delete the device files for the volume group.

If you have more than one disk, please, let us know for further action
DCE
Honored Contributor

Re: Deleting/Recreating Volume


James,

There is a potential glitch - The vg may not recognize all of the new disk space.

When you create a volume group, the maximum disk size is hard coded for that VG. If you add a disk or LUN, larger than that max size, the system will not use the space beyond the max size at VG creation time.

If this is the case, then you will have to create a new VG with a max dsik/lun size equal to, or greater than, the size of the new LUN/disk.
James Hager
Occasional Advisor

Re: Deleting/Recreating Volume

To confirm:

I have just the one volume on the VG. Only one physical volume. Currently, this is set at about 5GB in space, and I am going to want to change it to, say, 50GB. I will need to:

1) umount the filesystem
2) lvremove my logical volume with lvremove

Now, would I need to delete the volume group as well, or would vgreduce work? Can I keep the existing node and physical volume?

3) Delete volume group (if needed)
4) unbind the LUN/recreate
5) Create new volume group (if needed)
6) Create new logical volume
7) Create new filesystem (since it's increasing)
8) mount new filesystem

Does that sound close?

Thanks again, and I'll be handing out points, no worries!

--James
DCE
Honored Contributor

Re: Deleting/Recreating Volume


Because of the increase in the LUN size, I would recommend you vgreduce and then vgremove the VG, and create a new VG based on the larger LUN size.

Lolupee
Regular Advisor

Re: Deleting/Recreating Volume

Ok. if you do not want to vgexport.

Then your steps is in order. But you must delete the volume group. you cannot have a volume group without at least a disk.


umount
lvremove lvname
vgchange -a n vgname
vgremove

then

vgcreate ... etc.
Deoncia Grayson_1
Honored Contributor

Re: Deleting/Recreating Volume

I agree with DCE, just do a vgreduce and vgremove and create the volume group over with the new disk space, this reduces the chances of encountering an error.
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Geoff Wild
Honored Contributor

Re: Deleting/Recreating Volume

How was the vg originally created?

If you didn't specify the PE size - and you are adding a larger lun - then you will need to delete the vg (vgexport will do just fine) - then re-create the vg.

1) umount the filesystem
2) lvremove my logical volume with lvremove
3) vgexport /dev/vgXX
4) unbind the LUN/recreate
5) Create new volume group
6) Create new logical volume
7) Create new filesystem (since it's increasing)
8) mount new filesystem


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.