- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Possible to move LV's from 1 VG to Another
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
Forums
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
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
тАО02-10-2003 07:12 AM
тАО02-10-2003 07:12 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2003 07:25 AM
тАО02-10-2003 07:25 AM
Re: Possible to move LV's from 1 VG to Another
There is no way to just move an LV between VGs without going through a lot of other steps, like above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2003 07:32 AM
тАО02-10-2003 07:32 AM
Re: Possible to move LV's from 1 VG to Another
No, it is not possible under LVM to move a logical volume and its associated filesystem from one volume group to another.
You will need to create a new logical volume (optionally in a new volume group) and copy the data from the old to the new filesystem. This can be done easily with 'cpio' or with 'fbackup'/'frecover'.
# cd /olddir || exit 1
# find . -depth ???print | cpio -pudlmv /newdir
...or:
# cd /olddir
# fbackup -i . -f - | (cd /newdir; frecover -Xsrf -)
When the copy has been completed, you can edit '/etc/fstab' to reflect the '/newdir' mountpoint's device with the '/olddir' name.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2003 07:33 AM
тАО02-10-2003 07:33 AM
Re: Possible to move LV's from 1 VG to Another
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2003 07:48 AM
тАО02-10-2003 07:48 AM
Re: Possible to move LV's from 1 VG to Another
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2003 10:34 AM
тАО02-10-2003 10:34 AM
Re: Possible to move LV's from 1 VG to Another
Although I don't have time to check this I would say it is possible but only if the filesystem (lv) is completely contained within the disks you are moving. If you have an extent map you can lvcreate the logical volume within the new volume group and fsck the filesystem.
For instance on one call I was working on someone had removed all the logical volumes and removed the disk from the volume group. They wanted to know if this data on this disk could be accessed by a third party if the disk went off-site. All I had was a bdf and I rebuilt it all (after much cursing as they had extended LVs all over the place!)
Still, not conventional or supported and I wouldn't advise doing it this way.
Regards,
James.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2003 01:08 PM
тАО02-10-2003 01:08 PM
SolutionHad a bit of time, here is the output of the commands I used to do this, hope it pastes ok!
# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000
# vgcreate /dev/vg01 /dev/dsk/c1t4d0
Increased the number of physical extents per physical volume to 1023.
Volume group "/dev/vg01" has been successfully created.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
# lvcreate -l 5 vg01
Logical volume "/dev/vg01/lvol1" has been successfully created with
character device "/dev/vg01/rlvol1".
Logical volume "/dev/vg01/lvol1" has been successfully extended.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
# newfs -F vxfs /dev/vg01/rlvol1
version 4 layout
20480 sectors, 20480 blocks of size 1024, log size 1024 blocks
unlimited inodes, largefiles not supported
20480 data blocks, 19384 free data blocks
1 allocation units of 32768 blocks, 32768 data blocks
last allocation unit has 20480 data blocks
# mkdir /itrc
# mount /dev/vg01/lvol1 /itrc
# touch /itrc/james
# umount /itrc
# lvremove /dev/vg01/lvol1
The logical volume "/dev/vg01/lvol1" is not empty;
do you really want to delete the logical volume (y/n) : y
Logical volume "/dev/vg01/lvol1" has been successfully removed.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
# vgremove vg01
Volume group "vg01" has been successfully removed.
# vgextend vg00 /dev/dsk/c1t4d0
Volume group "vg00" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvcreate -l 5 vg00
Logical volume "/dev/vg00/lvol11" has been successfully created with
character device "/dev/vg00/rlvol11".
Logical volume "/dev/vg00/lvol11" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# fsck -F vxfs /dev/vg00/rlvol11
file system is clean - log replay is not required
# mount /dev/vg00/lvol11 /itrc
# ls /itrc
james lost+found
So there you are, the filesystem and data is still intact. However, note some things here:
1) I didn't have to check any extent maps as I knew the lvol was created in the first five extents of the disk
2) My primary disk was fully populated, hence I didn't have to create a physical volume group to ensure that disk was used (defined in /etc/lvmpvg).
Regards,
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2003 11:49 PM
тАО02-10-2003 11:49 PM
Re: Possible to move LV's from 1 VG to Another
Also note that the PV you are trying to move between VGs is used for creating new LV on new VG otherwise lvcreate will use some extent from the remaining PVs before using your newly included disk.
do some test/practice before trying it for production PV/LV and take the backup before.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2003 05:18 AM
тАО02-12-2003 05:18 AM
Re: Possible to move LV's from 1 VG to Another
Consider that the source LVOL is :
/dev/vg01/source_lvol
mounted on /my_data_source
Create a new LVOL of the same size using LVCREATE on the "other" VG:
lvcreate -L 1000 (same as source!) -n target_lvol /dev/vg_other
umount /my_data_source
dd if=/dev/vg01/rsource_lvol of=/dev/vg_other/rtarget_lvol bs=1024k
(Note I'm using the Block devices)
When the dd is finished with identical IN and OUT blocks, then mount /my_data_source onto /dev/vg_other/target_lvol .
Note: since you are in effect copying every block between the source and the target, you DO NOT need to do a MKSF/NEWFS on the new raw LVOL.
This method leaves the source untouched.