Operating System - HP-UX
1832988 Members
2709 Online
110048 Solutions
New Discussion

Re: How to create and move the LV from HPSAN to vg00 ?

 
SOLVED
Go to solution
DnD_1
Regular Advisor

How to create and move the LV from HPSAN to vg00 ?

Hi,

I have the following filesystem which mount from HP-SAN,

/dev/vgBankHSBC/lv_bankHSBC 4012288 623909 017560 76% /bank1/opt

Which I have to create and move to Vg00, can anyone guide me the steps ?

Many thanks !!


12 REPLIES 12
Roopesh Francis_1
Trusted Contributor
Solution

Re: How to create and move the LV from HPSAN to vg00 ?

Hi,

you need to create logical volume using lvcreate.no other way.
lvcreate -L size -n lvname vg00
newfs -F vxfs /dev/vg00/lvol
create mount point and mount the file system.copy the data from /bank1/opt to new mount point
BTW why you need to create data volume in vg00
Torsten.
Acclaimed Contributor

Re: How to create and move the LV from HPSAN to vg00 ?

But you should keep vg00 clean an store any data in other VGs.

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!   
Fabio Ettore
Honored Contributor

Re: How to create and move the LV from HPSAN to vg00 ?

Hi,

usually it's good to keep vg00 only for system crucial filesystems, like /stand, /usr, /opt, etc.

Anyway if you are really interested to move data from a filesystem to another one, you can use the following command:

- create the new filesystem on vg00 by lvcreate and newfs;
- move data:
cd /bank1/opt
find . -xdev -print | cpio -pdmvux /

Otherwise you can backup data from /bank1/opt and restore them to new filesystem.

Definitely you have some possibilities.

HTH.

Best regards,
Fabio
WISH? IMPROVEMENT!
Suraj K Sankari
Honored Contributor

Re: How to create and move the LV from HPSAN to vg00 ?

Hi,
create a new lv under vg00
mount it and then move all data from this lv to new lv or
take a backup of existing lv create a new lv under vg00, mount it and restore all data from your backup.
before going to create lv into vg00 check you vg00 is having sufficient space to create new lv.

steps are
vgdisplay -v vg00
lvcreate -L 3920 -n myvolume /dev/vg00
newfs -F vxfs -o largfiles /dev/vg00/mymolume
mkdir /newmountpoint

mount /dev/vg00/myvolume /newmountpoint

then cipo to copy data
find . -print | cpio -pdl /newmountpoint

for more info on cpio see the below link

http://www.ncsa.illinois.edu/UserInfo/Resources/Hardware/IBMp690/IBM/usr/share/man/info/en_US/a_doc_lib/cmds/aixcmds1/cpio.htm

Suraj



Suraj
DnD_1
Regular Advisor

Re: How to create and move the LV from HPSAN to vg00 ?

Thanks all.

but i have to mount to the same directory /bank1/opt....how can I do that

Torsten.
Acclaimed Contributor

Re: How to create and move the LV from HPSAN to vg00 ?

Mount the new LVOL to another mount point, let's say

/bank1/opt_new

copy the data, unmount the old and mount the new LVOL to the original mount point.

You need to stop the accessing application for that.

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!   
Sunny123_1
Esteemed Contributor

Re: How to create and move the LV from HPSAN to vg00 ?

Hi

Follow the Torsten's steps.


Regards
Sunny
Sharma Sanjeev
Respected Contributor

Re: How to create and move the LV from HPSAN to vg00 ?

Hi

Follow Above procedure BUT

Make sure to update /etc/fstab with new changes

Regards
Sanjeev
Everything is Possible as " IMPOSSIBLE" word itself says I M POSSIBLE
Suraj K Sankari
Honored Contributor

Re: How to create and move the LV from HPSAN to vg00 ?

Hi Again,
>>but i have to mount to the same directory /bank1/opt....how can I do that

you already have this mount point on your system so no need to create, after creating new lv and copy or move old data into new lv just mount

mount /dev/vg00/myvolume /bank1/opt

and change your fstab with your new lv name.

Suraj
DnD_1
Regular Advisor

Re: How to create and move the LV from HPSAN to vg00 ?

so here are the steps,

1. lvcreate -L 3072 -n lv_bankHSBC /dev/vg00
2. newFS -F vxfs /dev/vg00/rlv_bankHSBC
3. unmount /bank1/opt
4. cp all data from /bank1/opt to /bank1/new_opt/
5. rename /bank1/opt to /bank/opt_old
6. rename /bank1/new_opt to /bank1/opt
7. mount /dev/vg00/lv_bankHSBC /bank1/opt

right ?
Torsten.
Acclaimed Contributor

Re: How to create and move the LV from HPSAN to vg00 ?

First copy, then unmount the source.

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!   
Fabio Ettore
Honored Contributor

Re: How to create and move the LV from HPSAN to vg00 ?

Hi,

steps are good however you don't need points 5 and 6 to rename mount points. You can change just the logical volume definition into /etc/fstab in order to have /dev/vg00/lv_bankHSBC. Then umount the old filesystem and mount the new one as follows:

mount /bank1/opt

This command reads into /etc/fstab and will mount the new filesystem for the lvol /dev/vg00/lv_bankHSBC.

HTH.

Best regards,
Fabio
WISH? IMPROVEMENT!