linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Julie Ashworth <ashworth@berkeley.edu>
To: linux-lvm@redhat.com
Subject: [linux-lvm] LV mirror extents on same physical device
Date: Fri, 21 Feb 2014 23:14:08 -0800	[thread overview]
Message-ID: <20140222071408.GA10598@localhost.localdomain> (raw)

hi all,

just some background...
I installed a CentOS5 server in 2010 with a mdadm RAID1 containing 2 partitions (/dev/sda1 and /dev/sdb1). /dev/sda1 failed, and unfortuately, the mirror failed to sync with a new drive.

On this RAID1, I have one VG (VolGroup00) with 5 LVs.

I contacted the folks on the mdadm mailing list. The data on /dev/sdb is good, so they recommended that I convert the linear LVs to mirrors (to copy the data to a new drive).

I formatted a new drive (/dev/sde) identical to /dev/sd[ab], added it to a mdadm device (/dev/md2), which I then added to my VG:
mdadm --create --level=1 -n 2 /dev/md2 /dev/sde2 missing
pvcreate /dev/md2
vgextend VolGroup00 /dev/md2

I then converted all my volumes to mirrors:
lvconvert -m1 --mirrorlog=mirrored --alloc=anywhere /dev/VolGroup00/srvlv
lvconvert -m1 --mirrorlog=mirrored --alloc=anywhere /dev/VolGroup00/rootlv
lvconvert -m1 --mirrorlog=mirrored --alloc=anywhere /dev/VolGroup00/swaplv
lvconvert -m1 --mirrorlog=mirrored --alloc=anywhere /dev/VolGroup00/varlv
lvconvert -m1 --mirrorlog=mirrored --alloc=anywhere /dev/VolGroup00/tmplv

(in case you're wondering, when this completed, I added /dev/sda1 to /dev/md2, so /dev/md2 is a fuctional mdadm RAID1).

Now... the problem ;)....

When I run 'lvs' I see that the LV mirror extents were created on the same device (/dev/md1):

# lvs -a -o +devices 
LV                     VG         Attr   LSize  Origin Snap%  Move Log         Copy%  Convert Devices                                        
rootlv                 VolGroup00 mwi-ao 10.00G                    rootlv_mlog 100.00         rootlv_mimage_0(0),rootlv_mimage_1(0)          
[rootlv_mimage_0]      VolGroup00 iwi-ao 10.00G                                               /dev/md1(0)                                    
[rootlv_mimage_1]      VolGroup00 iwi-ao 10.00G                                               /dev/md1(4036)                                 
[rootlv_mlog]          VolGroup00 mwa-ao 32.00M                                100.00         rootlv_mlog_mimage_0(0),rootlv_mlog_mimage_1(0)
[rootlv_mlog_mimage_0] VolGroup00 iwi-ao 32.00M                                               /dev/md2(4)                                    
[rootlv_mlog_mimage_1] VolGroup00 iwi-ao 32.00M                                               /dev/md1(4356)      


My long-term goal is to convert the mirror back to a linear volume using just /dev/md2, i.e.
lvconvert -m0 /dev/VolGroup00/rootlv /dev/md1
lvconvert -m0 /dev/VolGroup00/swaplv /dev/md1
lvconvert -m0 /dev/VolGroup00/srvlv /dev/md1
lvconvert -m0 /dev/VolGroup00/varlv /dev/md1
lvconvert -m0 /dev/VolGroup00/tmplv /dev/md1

... so it seems problematic that both extents are on /dev/md1.

I thought lvm was supposed to use both physical devices. Do you know why both extents were created on the same physical device?
Should I create another extent on /dev/md2 before I remove the /dev/md1 extent(s)? If so, can you give me an example of how to use lvconvert in this case?

Thanks in advance!
best,
Julie

             reply	other threads:[~2014-02-22  7:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-22  7:14 Julie Ashworth [this message]
2014-02-22 10:12 ` [linux-lvm] LV mirror extents on same physical device emmanuel segura
2014-02-24 18:56   ` Julie Ashworth
2014-02-24 21:51     ` Julie Ashworth
2014-02-25 11:18       ` emmanuel segura
2014-02-25 11:19         ` emmanuel segura
2014-02-22 10:37 ` James Hawtin
2014-02-22 17:08   ` Julie Ashworth
2014-02-24  1:59     ` John Stoffel
2014-02-24  3:20       ` Julie Ashworth
2014-02-24  2:16 ` Roger Heflin
2014-02-24  3:03   ` Roger Heflin
2014-02-24  3:12     ` Julie Ashworth
2014-02-24  3:13   ` Julie Ashworth
2014-02-24  3:29     ` Roger Heflin
2014-02-24  4:29       ` Julie Ashworth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140222071408.GA10598@localhost.localdomain \
    --to=ashworth@berkeley.edu \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).