- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: LVM Mirror like in HPUX
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
тАО02-16-2010 12:56 AM
тАО02-16-2010 12:56 AM
LVM Mirror like in HPUX
I wanted to make a mirror copy for LV with different Physical volume in redhat linux 4.7 but it seems bit cofusion.
I have one VG=vg01
Two PV = sdb1,sdc1 each 1 gb.
I have one LV=mylv with the size of 512mb.
Now i needs to mirror mylv with physical volume sdc1 as below
#lvconvert -m1 /dev/vg01/mylv /dev/sdc1 but it givs error
Not enough PVs with free space available for parallel allocation.
Consider --alloc anywhere if desperate.
seems its looking for same phyiscal volume for mirror.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-16-2010 05:23 AM
тАО02-16-2010 05:23 AM
Re: LVM Mirror like in HPUX
>
>seems its looking for same phyiscal volume for mirror.
Yes, your assumption seems right.
You ought to be pretty desperate before you resorted to the "--alloc anywhere" option ;-)
You can look up how many free PEs there are in each PV.
Either issue
# vgdisplay -v vgrh|egrep 'PV Name|Total PE|PE Size'
or use this command
# pvs -o name,pe_count,pe_alloc_count,free /dev/sd[bc]1
You can also have a look at how those allocated PEs are mapped on the PVs by
# pvdisplay -m /dev/sd[bc]1
Besides, before there was introduced the mirroring option in Linux LVM2 the usual way to mirror accross different HDDs an their partitions was to build an MD RAID1 device beneath LVM and use that as a PV to create your mirrored VG.
One would do this by first marking same sized partitions on different HDDs of type 0xfd (i.e. autoraid) (e.g. by using fdisk /dev/sdb and fdisk /dev/sdc) and then run something like such:
# mdadm -C /dev/md0 -a md -l 1 -n 2 /dev/sd[bc]1
# mdadm -Dsv | grep -A1 md0 >>/etc/mdadm.cfg
# pvcreate /dev/md0
# vgcreate -s 16m vgbla /dev/md0
# lvcreate -L 2g -n lv_bla vgbla
# mke2fs -j /dev/vgbla/lv_bla
etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-16-2010 06:24 AM
тАО02-16-2010 06:24 AM
Re: LVM Mirror like in HPUX
The error may be because lvconvert wants to allocate a small amount of disk space for the mirror log, which ideally should be not on the same disks as the mirror halves (i.e. you would need a small *third* PV in your VG for the mirror log).
If you're mirroring for short term only (e.g. you're performing a SAN migration, and will remove the "old" side of the mirror as soon as the mirroring to the "new" side is complete), you might use the "--corelog" option:
lvconvert -m1 --corelog dev/vg01/mylv /dev/sdc1
If you use the --corelog option and the system is rebooted while the mirror exists, the mirror must be fully resynchronized from the original. So it is *not suitable* for long-term use.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-16-2010 06:29 AM
тАО02-16-2010 06:29 AM
Re: LVM Mirror like in HPUX
For proper mirror, I would use lvmove to get the data on to one physical volume and then run the mirror configuration posted above, not what you originally tried.
I am guessing your mylv logical volume is spread across two disks. To have mirror have any use, you need to get all the data to one disk and THEN mirror.
SEP
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-17-2010 05:24 AM
тАО02-17-2010 05:24 AM
Re: LVM Mirror like in HPUX
Yeah, as Matti said, you need three PVs for a two-way mirroring on Linux. This was strange also to me, but got used to it.
Altough the --corelog option isn't recommended.
Unix operates with beer.