- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Moving Logical Volumes between Volume Groups
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
тАО11-04-2005 03:39 AM
тАО11-04-2005 03:39 AM
Need to do a bit of simple housekeeping but wanted to post this thread to make sure I am on the right lines.
Scenario:-
VG00 contains the OS
VG01 contains 4 lvols each mounted on a different mount point with data
What I want to do is move (copy really in case of problems) the four lvols and their mount points (with all the data of course) into vg00 so that that the disk which currently hosts vg01 can be wiped and re used elsewhere.
One of my issues is that he lvols on vg01 have names lvol1 through lvol4 and of course these exist on vg00 for the OS. My thoughts are to create 4 new lvols on vg00 with more appropriate names and then using the cp -Rrp command to copy the data into them but one of the things is that I cant create the directories again because they already exist and I dont want to copy the data to a new directory, delete and re create the old directories and then copy all the data into them - I figure that there has to be an easier way.
So in short the question is:-
How can I merge all the resourses in vg01 into vg00 and what is the best way? My way above or is there a better alternative?
Thanks as always for the help
Cheers
Mark
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2005 03:50 AM
тАО11-04-2005 03:50 AM
Re: Moving Logical Volumes between Volume Groups
1) create 4 new lvs
2) newfs those 4 new lvs
3) mount those 4 new lvs somewhere. /mnt/name
is a good place.
4) I would use cpio not cp.
(cp source; find . -xdev -print | cpio -pudmv /mnt/destination ) > logfile.
Make sure no applications are writing to these filesystems while you copy data.
5) Then I would verify that all the files were copied correctly with rdist.
rdist -f - << EOF
Host = $(hostname)
Files = ( $source )
\${Files} -> \${Host}
install -v /mnt/destination
EOF
In order to use rdist make sure the system can remsh to itself.
6) umount the old stuff, and mount the new lvs on the same mount points.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2005 03:53 AM
тАО11-04-2005 03:53 AM
SolutionOLD LV mounted at /abc
Create new LV sized appropriately and mount at /abc.new
# cd /abc
# cp -Rp . /abc.new
When the copy is done, unmount /abc and /abc.new, then remount the new LV as /abc.
Now you can use the old disk(s) for whatever.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2005 03:56 AM
тАО11-04-2005 03:56 AM
Re: Moving Logical Volumes between Volume Groups
If you are saying that long-term you want to merge your vg01 logical volumes into vg00, then I'd say "don't". I strongly urge you to keep vg00 for the operating system only. This makes potential recoveries and certainly operating system upgrades (updates or cold-installs) so very much easier.
If you are saying that the merge of the two volume groups is only a short-term step, then simply create four new logical volumes of any new unique name on vg00; create four new mountpoints therein; and use 'cpio' or 'fbackup' to copy the data from vg01's logical volume mountpoints to vg00's logical volume mountpoints. When done, modify '/tc/fstab' to simply rename the mountpoint names on 'vg00' to be the same as the old 'vg01' was while renaming the vg01 counterparts to something else.
To use 'cpio':
# cd olddir && find . -depth -print | cpio -pudlmv newdir
To use 'fbackup/frecover':
# cd srcdir && fbackup -i . -f - | ( cd dstdir && frecover -Xsrf - )
'fbackup' and 'frecover' can handle largefiles if that is an issue, too.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2005 03:57 AM
тАО11-04-2005 03:57 AM
Re: Moving Logical Volumes between Volume Groups
You basically have two options:
1. Backup the directories where the current LVs are mounted to tape, umount them, mount the new ones, restore from tape
or
2. Mount the new LVs on temporary mount points, do a copy of the data from the current mount point to the new, umount both sets, mount the new LVs on the permanent mount points, remove the temporary mount point directories.
Option 2 is faster. Option 1 has fewer steps. I'd go with faster myself. :)
Best of there are no users accessing the file systems obviously. You could lose data if they are changing things while you copy.
Of course, don't forget updating /etc/fstab in either case. In option 2, I would also use tar instead of cp for the copy. A preference, but I know it exactly copies things... I've never had the same warm and fuzzy feeling about cp.
cd
tar cf - . | (cd
Same can be done with cpio and probably fbackup or whatever archiving utility people may prefer over tar.
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2005 03:59 AM
тАО11-04-2005 03:59 AM
Re: Moving Logical Volumes between Volume Groups
When doing you copy, use the cpio passthru option. This will preserve the perms and owners of the files.
cd into the source directory to copy
find . -depth | cpio -pmuldv /
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2005 04:01 AM
тАО11-04-2005 04:01 AM
Re: Moving Logical Volumes between Volume Groups
As the data is there in vg01 and you want to accomodate it in vg00 then the only option is the one sililar to what you are mentioning. Allthough if there are multiple disks in vg00 ( More than two) than it will be worth consideration that instead you spare one or more disks to vg01 itself, move LVOLs in vg01 to new disks and then remove the existing disks in vg01. But the current information do not give any clue about this.
The current option seems to be fine but you need to halt your application while copying the files which shall not be required if you choose the above suggestion. I in such case would normally do this.
1. Create four new LVOLs in vg00 to have data from four LVOLs in vg01 which should be atleast greater than the current data volumes in four LVOLs in vg01.
2. Mount them in new directories. Suppose existing mount points are /data , data1 , data2 and data3 then mount them on /dataa, /data1a , /data2a and /data3a.
3. Now halt your applications and copy data across file systems. I normally use cpio for this.
#cd /data
#find ./ -name "*" -print|cpio -pdmv /dataa
#cd /data1
#find ./ -name "*" -print|cpio -pdmv /data1a
#cd /data2
#find ./ -name "*" -print|cpio -pdmv /data2a
#cd /data3
#find ./ -name "*" -print|cpio -pdmv /data3a
Now umount volumes in vg01 and change entries in /etc/fstab for all four LVOLs and give
#mountall
Confirm all four LVOLs mounted to correct path.
When everything starts back normally then probably after few days.
#vgexport /dev/vg01
And remove disks belonging to vg01.
HTH,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2005 04:55 AM
тАО11-04-2005 04:55 AM
Re: Moving Logical Volumes between Volume Groups
I may also suggest you use vxdump/vxrestore:
vxdump 0f - /oldmnt|(cd /newmnt;vxrestore rf -)
Or even dd:
dd if=/dev/vg01/roldlvol of=/dev/vg02/rnewlvol bs=4096k
with the condition that oldlvol and newlvol are sized the same.
Favourite Toy:
AMD Athlon II X6 1090T 6-core, 16GB RAM, 12TB ZFS RAIDZ-2 Storage. Linux Centos 5.6 running KVM Hypervisor. Virtual Machines: Ubuntu, Mint, Solaris 10, Windows 7 Professional, Windows XP Pro, Windows Server 2008R2, DOS 6.22, OpenFiler
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2005 05:26 AM
тАО11-07-2005 05:26 AM
Re: Moving Logical Volumes between Volume Groups
Just a note to say thanks for all the assistance and I appreciate the time and effort from you all.
I will close the thread now but just wanted to acknowledge your comments ref why have the OS and an applicaction on the same disk - I too dont like it at all but it certainly wasnt my preference. The reason why I am doing this is to free up the second disk to use as a mirror to the OS and what will now be the applicatio to. The reason for the this is that no storage solution will be used as the machines are development boxes.
Thanks again to you all
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2005 05:26 AM
тАО11-07-2005 05:26 AM