FedoraForum.org - Fedora Support Forums and Community
Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2008
    Location
    Guelph (pronounced Gwe-ELF), Ontario , Canada
    Posts
    40

    Unhappy How do you RAID an existing LVM system - F14

    I hope this is the proper forum for this question.
    I've been following Falko Timme's tutorial on converting a F8 running LVM system to a RAID1 LVM system but I'm having a horrible time.
    ref: http://www.howtoforge.com/set-up-rai...system-fedora8
    I have my system running on /dev/sda, I want to add /dev/sdb, an identical drive.

    Here's my setup:
    • /dev/sda1: used for LVM (volume group HostOS) and contains / (volume Fedora14) and swap (volume swap)
    • /dev/sda2: /boot partition ext4
    • /dev/sda3: used for LVM (volume group Vservers) and contains /VServer (volume VS_OS) and /VSData (volume VS_Data)


    In the end, I want to have the following setup:
    • /dev/md0: (made up of /dev/sda1 and /dev/sdb1): LVM (volume group HostOS), containing / (volume Fedora14) and swap (volume swap)
    • /dev/sda2, /dev/sdb2 both bootable partitions; ext4 NOT RAIDed
    • /dev/md1: (made up of /dev/sda3 and /dev/sdb3): LVM (volume group Vservers), containing /VServer (volume VS_OS) and /VSData (volume VS_Data)


    I install mdadm, mkinitrd :
    Code:
    yum -y install mdadm mkinitrd
    ... and a few kernel modules :
    Code:
    modprobe linear
    modprobe raid0
    modprobe raid1
    modprobe raid5
    modprobe raid10
    then I copy the partitioning of /dev/sda over to /dev/sdb (/dev/sda1 doesn't end at a cylinder boundary so I have to --force the issue)
    Code:
    sfdisk -d /dev/sda|sfdisk --force /dev/sdb
    I then use fdisk on /dev/sdb to change the partition type of /dev/sdb1 and /dev/sdb3 to Linux raid autodetect
    Code:
    fdisk /dev/sdb
    Command (m for help): <- t
    Partition number (1-4): <- 1
    Hex code (type L for list codes) : <- fd
    
    Command (m for help): <- w
    The partition table has been altered
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
    I make sure /dev/sdb has no previous RAID information:
    Code:
    mdadm --zero-superblock /dev/sdb1
    mdadm --zero-superblock /dev/sdb3
    I then create degraded RAID arrays using only partitions /dev/sdb1 in /dev/md0 and /dev/sdb3 in /dev/md1:
    Code:
    mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdb1
    mdadm --create /dev/md1 --level=1 --raid-disks=2 missing /dev/sdb3
    Although I am not going to RAID my /boot partition, I need to make a filesystem on /dev/sdb2 to copy my boot information
    Code:
    mkfs.ext4 /dev/sdb2
    I then create a physical volume /dev/md0
    Code:
    pvcreate /dev/md0
    and add it into my HostOS volume group
    Code:
    vgextend HostOS /dev/md0
    I repeat this for my other volume group:
    Code:
    pvcreate /dev/md1
    vgextend Vservers /dev/md1
    Next, I create /etc/mdadm.conf as follows:
    Code:
    mdadm --examine --scan > /etc/mdadm.conf
    my mdadm.conf look slightly different to Falko's as mdadm in F14 using metadata v1.2

    I forego modifications to /etc/fstab and /etc/mtab as I am not RAIDing my /boot partition

    I do follow and alter my /boot/grub/grub.conf file with the recommended additions:
    Code:
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE:  You have a /boot partition.  This means that
    #          all kernel and initrd paths are relative to /boot/, eg.
    #          root (hd0,0)
    #          kernel /vmlinuz-version ro root=/dev/mapper/HostOS-Fedora14
    #          initrd /initrd-[generic-]version.img
    #boot=/dev/sda
    default=0
    fallback=1
    timeout=0
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title Fedora (2.6.35.11-83.fc14.x86_64)
    	root (hd1,1)
    	kernel /vmlinuz-2.6.35.11-83.fc14.x86_64 ro root=/dev/mapper/HostOS-Fedora14 rd_LVM_LV=HostOS/Fedora14 rd_MD_UUID=08e554d0:0aa4e998:06007e67:ed5ba9d5 rd_NO_LUKS rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
    	initrd /initramfs-2.6.35.11-83.fc14.x86_64.img
    title Fedora (2.6.35.11-83.fc14.x86_64)
    	root (hd0,1)
    	kernel /vmlinuz-2.6.35.11-83.fc14.x86_64 ro root=/dev/mapper/HostOS-Fedora14 rd_LVM_LV=HostOS/Fedora14 rd_MD_UUID=08e554d0:0aa4e998:06007e67:ed5ba9d5 rd_NO_LUKS rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
    	initrd /initramfs-2.6.35.11-83.fc14.x86_64.img
    Next, i adjust my ramdisk to the new situation
    Code:
    mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.orig
    mkinitrd /boot/initramfs-$(uname -r).img $(uname -r)
    Here is the dicey part:
    I move my LVM partition to my new RAIDed LVM partition;
    Code:
    pvmove /dev/sda1 /dev/md0
    This is a lethal blow that kills my system.
    Afterward (the next morning) my system is unusable
    Code:
    boot has failed.  sleeping forever.
    Has anyone else attempted to move a single disk LVM system to a RAID1 LVM system ... and succeeded ?!
    Last edited by AIM Systems; 25th March 2011 at 03:43 PM.

Similar Threads

  1. Upgrading Fedora with existing RAID
    By power78 in forum Using Fedora
    Replies: 0
    Last Post: 15th October 2009, 10:22 PM
  2. Installing on existing RAID partitions
    By jas88 in forum Installation, Upgrades and Live Media
    Replies: 0
    Last Post: 16th March 2006, 10:54 AM
  3. Installing a software raid on an existing non-raid system
    By jimispier in forum Hardware & Laptops
    Replies: 8
    Last Post: 4th March 2006, 06:51 AM
  4. New install with existing Software RAID
    By JoeVulture in forum Installation, Upgrades and Live Media
    Replies: 1
    Last Post: 17th August 2005, 07:24 AM

Tags for this Thread

Posting Permissions

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