- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Mount a VG under a different Name
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-17-2005 11:50 AM
тАО05-17-2005 11:50 AM
Mount a VG under a different Name
Quick question - on a server I have already a vg called vgtest for example.
I need to copy the contents of vgtest onto a new disk lets say and the way in which I will do it is using the vgexport and vgimport to copy the structures.
Later i need to copy data from the origional vgtest to the new vgtest with both vgs connected to the same server - how can I mount the new vgtest volume group so that I can switch between the two but with a different name, lets say vgtest_new so that I have vgtest and vgtest_new both mounted ??
Cheers as always
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-17-2005 01:07 PM
тАО05-17-2005 01:07 PM
Re: Mount a VG under a different Name
Create a new volume group /dev/vgtest_new and activate it. Unmount any filesystems on /dev/vgtest.
Create LVOL's of the same size as /dev/vgtest in /dev/vgtest_new.
For each LVOL,
dd if=/dev/vgtest/rlvol1 of=/dev/vgtest_new/rlvol1 bs=256k
This will copy the data and create duplicate filesystems. You do not need to run newfs.
You can now remount the filesystems on /dev/vgtest and create mountpoints for the copy filesystems. Mount the copy filesystems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-17-2005 01:30 PM
тАО05-17-2005 01:30 PM
Re: Mount a VG under a different Name
vgextend /dev/vgtest /dev/dsk/c......
^^^^^the new disk
for i in /dev/vgtest/lvol*
do
lvextend -m 1 $i /dev/dsk/c.....
done
unmount any fs mounted on vgtest
vgchange -a n /dev/vgtest
unplug the new disk
vgchange -q n -a y /dev/vgtest
for i in /dev/vgtest/lvol*
do
lvreduce -k -m 0 $i /dev/dsk/c.....
done
vgreduce -f /dev/vgtest /dev/dsk/c.....
vgexport -p -m /tmp/vgtestmap /dev/vgtest
mkdir /dev/vgtest_new
ll /dev/*/group
crw-r--r-- 1 root sys 64 0x030000 Dec 16 1999 /dev/vg/group
crw-r----- 1 root sys 64 0x000000 Aug 2 1999 /dev/vg00/group
crw-rw-rw- 1 root sys 64 0x010000 Aug 30 1999 /dev/vg01/group
crw-rw-rw- 1 root sys 64 0x020000 Aug 30 1999 /dev/vg02/group
chose a 0x?0000 not yet used
mknod /dev/vgtest_new/group c 64 0x30000
( 0x30000 is not used in my system)
plug the disk
vgimport -m /tmp/vgtestmap /dev/vgtest_new /dev/dsk/c.....
vgchange -q n -a y /dev/vgtest_new
for i in /dev/vgtest_new/lvol*
do
lvreduce -m 0 /dev/vgtest_new
done
I did not try but it is like that I would try. May be some details could fail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-17-2005 04:56 PM
тАО05-17-2005 04:56 PM
Re: Mount a VG under a different Name
If the purpose is to just move the data to a newer disk, add the new disk to the VG and then use pvmove to move all the physical extents from the old disk to the newer one.
If you want an entirely new VG with data transferred to the new disk,
Create new VG:
#mkdir /dev/vgtest_new
#mknod /dev/vgtest_new/group c 64 0x020000
#vgcreate /dev/vgtest_new /dev/dsk/cxtydz
#lvcreate /dev/vgtest_new
#lvextend -L size_in_MB /dev/vgtest_new/lvol1
#newfs -F vxfs /dev/vgtest_new/lvol1
#mkdir /newvgtest
#mount -F vxfs /dev/vgtest_new/lvol1 /newvgtest
Copy the data from the existing mountpoint to the /newvgtest using cpio.
#cd /old_fs_mount_point
#find . -xdev -depth | cpio -pvdlmax /newvgtest
After you copy the data,
vgexport /dev/vgtest #i.e. the old VG
Regards,
Naveej
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 02:30 AM
тАО05-18-2005 02:30 AM
Re: Mount a VG under a different Name
Do you require to mount LVs from both the VGs?
If yes, you can simple create the required mount points, and mount the filesystems (of course, after performing the required steps of creating new VG, creating LVs, creating fs).
Otherwise, after you have copied all the data, and you want to use only the new VG, simply boot the system in single user mode, and make changes in /etc/fstab so that the mount points are pointed to the newly created LVs.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-18-2005 04:26 PM
тАО05-18-2005 04:26 PM
Re: Mount a VG under a different Name
If you need to access both the voulme groups in a mounted state then you can do the following steps ,
1.Create new VG:
#mkdir /dev/vgtest_new
#mknod /dev/vgtest_new/group c 64 0x030000
#vgcreate /dev/vgtest_new /dev/dsk/cxtydz
#lvcreate /dev/vgtest_new
#lvextend -L size_in_MB /dev/vgtest_new/lvol1
#newfs -F vxfs /dev/vgtest_new/lvol1
#mkdir /newvgtest
#mount -F vxfs /dev/vgtest_new/lvol1 /newvgtest
Copy the data from the existing mountpoint to the /newvgtest using cpio.
goto to the source directory(/vgtest)
/# cd /vgtest
/vgtest# find . -depth -print | cpio -pdlmv /newvgtest
the above command will copy the entire data from vgtest to newvgtest.
then you can use both the vg's mounted with same data.
or else you can try this also
2.Create a new volume group /dev/vgtest_new and activate it. Unmount the filesystem on vgtest.
Create LVOL's of the same size as /dev/vgtest in /dev/vgtest_new.
For each LVOL,
dd if=/dev/vgtest/rlvol1 of=/dev/vgtest_new/rlvol1 bs=256k or 512k
This will copy the data and create duplicate filesystems. No need to run newfs.
You can now remount the filesystem on /dev/vgtest and create mountpoints for the copied filesystems. Mount the copied filesystems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2005 09:14 AM
тАО05-19-2005 09:14 AM
Re: Mount a VG under a different Name
Thanks for some very useful points and more importantly the confirmation of my origional idea!!
I have assigned the points.
Cheers
Mark