Find the answer to your Linux question:
Results 1 to 3 of 3
I am having trouble converting my existing LVM to LVM+RAID1. I have used the following tutorials in order to help me along. Unfortunately I hit a wall on step 18 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2012
    Posts
    11

    Convert LVM to LVM RAID1 - mdadm


    I am having trouble converting my existing LVM to LVM+RAID1.
    I have used the following tutorials in order to help me along. Unfortunately I hit a wall on step 18 of link 2.

    Link 1:
    Google this: How To Set Up Software RAID1 On A Running System (Incl. GRUB Configuration) (Fedora | HowtoForge - Linux Howtos and Tutorials

    Link 2:
    Google this: LVM Single Drive to LVM RAID 1 Mirror Migration - Spiceworks

    I get it to mirror the boot partition under /dev/md0:
    Code:
    [root ~]# cat /proc/mdstat 
    Personalities : [raid1] 
    md1 : active raid1 hdc2[1]
          976655488 blocks [2/1] [_U]
          
    md0 : active raid1 hdc1[1] hdb1[0]
          104320 blocks [2/2] [UU]
    but step 18 shows:
    Code:
    [root ~]# pvcreate -v /dev/md1
        Wiping cache of LVM-capable devices
        Wiping internal VG cache
        Device /dev/md1 not found (or ignored by filtering).
    mdadm --detail --scan shows the following:
    Code:
    [root ~]# mdadm --detail --scan
    ARRAY /dev/md0 level=raid1 num-devices=2 metadata=0.90 UUID=dc49ac1e:5f331bfd:f1220ec9:d6d944a0
    ARRAY /dev/md1 level=raid1 num-devices=2 metadata=0.90 UUID=25323f02:d5fe868c:22f7455f:ed368c09
    my drive layout right now:
    Code:
    [root ~]# fdisk -l | grep hd
    Disk /dev/hdb: 1000.2 GB, 1000204886016 bytes
    /dev/hdb1   *           1          13      104391   fd  Linux raid autodetect
    /dev/hdb2              14      121601   976655610   8e  Linux LVM
    Disk /dev/hdc: 1000.2 GB, 1000204886016 bytes
    /dev/hdc1               1          13      104391   fd  Linux raid autodetect
    /dev/hdc2              14      121601   976655610   fd  Linux raid autodetect
    Any ideas why I would not be able to pvcreate?

    I can output any information related to this setup if you would like.


    edit:

    just did this:
    Code:
    [root@stlnas1 ~]# mdadm --examine /dev/md1
    mdadm: No md superblock detected on /dev/md1.
    is this why?
    Last edited by shockwavecs; 09-21-2012 at 07:29 PM.

  2. #2
    Just Joined!
    Join Date
    Sep 2012
    Posts
    11
    i started the whole process over and I am STILL stuck. pvcreate fails. i dont know why.

  3. #3
    Just Joined!
    Join Date
    Sep 2012
    Posts
    11
    i had to do the following:
    Code:
    vim /etc/lvm/lvm,conf
    edit the filter section:
    Code:
    filter = [ "r|/dev/sdb|", "r|/dev/sdc|", "r|/dev/sdd|", "r|/dev/sde|", "r|/dev/sdf|", "r|/dev/sdg|", "r|/dev/sda|", "a|drbd.*|", "a|/dev/hda|", "a|/dev/hdb2|", "r|.*|", "a|/dev/md0|", "a|/dev/md1|" ]
    after this nothing changes, so you need to rebuild your initrd image
    Code:
    cp /boot/initrd-`uname -r`.img /boot/initrd-`uname -r`.img.bak
    mkinitrd -f /boot/initrd-`uname -r`.img `uname -r`
    reboot
    after this you need to rescan vg's
    Code:
    vgscan -vvvvvvv
    you should see that the md0 and md1 have been added to the device cache
    Code:
    #device/dev-cache.c:331         /dev/md0: Added to device cache
    #device/dev-cache.c:331         /dev/md1: Added to device cache
    check this to make sure it is proper (or manually add it for testing this solution):
    Code:
    cat /etc/lvm/cache/.cache | grep md
    Last edited by shockwavecs; 09-21-2012 at 11:13 PM.

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •