FedoraForum.org - Fedora Support Forums and Community
Results 1 to 12 of 12
  1. #1
    bluejuice Guest

    A RAID vs LVM delimma

    First a bit of history:
    I have a HP Proliant ML350 with 2x80G HD (admitably bit of an overkill for my needs) which I am using as a file server for an office comprising of about 10 PC's. Currently the OS is Fedora 4. I have firebird database running as the backend of a point of sale software. It is not currently being used as a gateway as it only came with one network card, however I shall be adding another card in a near future and will then add squid transperant proxy and a few other features to increase security and monitoring.

    Ok so heres the issue:
    When FC4 was installed (not by me), LVM was used to create the partitions - with the except o of the /boot (sda1) partition the remaining 155G is mapped to VolGroup00. Now however since I will have a small crisis if I ever experience downtime therefore I want to set up a RAID1 array to mirror the 2 hd's. I dont really have a preference for LVM as i was using Fedora core for a long time and only recently became familiar with LVM since I installed FC4. Though I do understand the benefits I dont mind doing things oldskool as im a bit of a newbie and thus would prefer to reduce the complications.

    The crux of my delimma is this:
    Is there a way, and is it advisable, to set up a RAID1 array without doing a completely new install - i have read that it can be done but seems that the process is also rather complicated and since I will be looking to create physical partitions I do wonder if it would not be easier (perhaps cleaner) to do a complete new install. With the possibility of a new install I could also consider upgrading to FC5 or even downgrading back to Core1 - what would make sense based on my needs.
    Some feedback from others who have faced this delimma would be greatly appreciated.

  2. #2
    ccrvic Guest
    Quote Originally Posted by bluejuice
    Is there a way, and is it advisable, to set up a RAID1 array without doing a completely new install
    Yes. It's a piece of cake.

    The trick is to set up your RAID1 mirror with *just one drive* initially - use the "missing" keywork when telling mdadm which devices to use. Build your partitions/LVM on that (degraded) mirror & copy your data across.

    Update your /etc/fstab & reboot - this will give you your system running on the RAID instead of the original drive. Once you're happy everything is there, clear out your old drive, partition it ready for the RAID, and hot-add it with mdadm --add. The HDD light will then go crazy, and /proc/mdstat will tell you the progress of your mirroring.

    Quote Originally Posted by bluejuice
    I do wonder if it would not be easier (perhaps cleaner) to do a complete new install.
    No. Clean installations always look appealing - until you find out that there was loads of stuff there you didn't know about, and now someone (usually a relative of the boss) wants it back. Like now.

    Quote Originally Posted by bluejuice
    With the possibility of a new install I could also consider upgrading to FC5 or even downgrading back to Core1 - what would make sense based on my needs.
    For a production server, I wouldn't use Fedora at all - the release cycles are just too quick. I'd use Whitebox, but many people will point you at CentOS, which is also excellent. But if Fedora's what you've got, then I think you'll find less pain in sticking with it.

    Quote Originally Posted by bluejuice
    Some feedback from others who have faced this delimma would be greatly appreciated.
    Vic's Top Tip - Plan the operation. Write down all the steps, and follow them. Forgetting one (I forgot a "pvcreate" when zapping LVMs across disks) can cause massive data loss.

    And don't be afraid to knock up a test box to try things out first. You can normally pick up an old dog for free or thereabouts, and your management will appreciate any risk mitigation you can do.

    Vic.

  3. #3
    bluejuice Guest
    Hi Vic - as a newbie Im not so sure I understood what you meant by -
    The trick is to set up your RAID1 mirror with *just one drive* initially - use the "missing" keywork when telling mdadm which devices to use. Build your partitions/LVM on that (degraded) mirror & copy your data across.
    Could you maybe elaborate? or do you have any links where I can view the commands and steps?

    BTW - why do you recommend whitebox? My first server was infact SME a version of the Esmith distro but I migrated to Fedora as it had more versitility in samba file permissions as well as more online support. I am not adverse to changing distro if there is a tangible advantage in doing so. I've only done a couple of installations and now admin two servers in my company (the other server is running FC1).

    Yes I have just recently built a test box at home so that I might mitigate my risks - as you put it

  4. #4
    Join Date
    Apr 2005
    Location
    Finland
    Posts
    5,073
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  5. #5
    bluejuice Guest
    Great link markkuk - thanks. Will do a little experimenting on my test box and if all goes well I will have RAID1 up and running in no time.

  6. #6
    bluejuice Guest
    I have been trying (and failing) to find a solution to migrate a running system from a default installation of Fedora 4 to a full RAID 1 mirror including mirror of the /boot partition. I attempted to follow the tutorial from:
    http://www.linuxdevcenter.com/lpt/a/6553

    However the problem is, when you do a default install on 2 HD (80GB) the resulting partition table is like so:
    hda1 /boot 102MB
    hda2 Volgroup00 76246MB
    hdc1 VolGroup00 76348MB

    If I to pvmove as per the step in the tutorial I get

    # modprobe dm-mirror
    # pvmove /dev/hdc1 /dev/hda2
    Insufficient contiguous allocatable extents (2) for logical volume pvmove 0:2385 required
    Unable to allocate temporary LV for pvmove

    I assume this is because hdc1 ia bigger than hda2. So how can i get around this, or do i just have to resign to a complete new install.

  7. #7
    Join Date
    Apr 2005
    Location
    Finland
    Posts
    5,073
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You must first shink the filesystems and logical volumes to create free space for the pvmove command. See this thread: http://www.fedoraforum.org/forum/sho...d.php?t=126666

  8. #8
    bluejuice Guest
    Hi Markkuk - I tried to shrink the filesystem, but was unsuccessful to even umount /dev/hdc1. Could you be perhaps give me the commands?

    As an alternative - to maybe simplify the whole process, since my case has room for 2 more drives. Do you think it would be easier to simply add two hard drives hdd and hde, and then set up two raid arrays md0 and md1 to mirror the new partitions to the existing ones and then move and reformat the existing partitions, this why I do not need to resize as i can simply replicate the current partitions on the new drives.

    Since my goal is to make 2 drives bootable, to prevent downtime in case of harddrive failure, can you confirm that I will be able to even migrate the /boot partition to a RAID device? I can not find any information online to support or deny this claim. If it is not possible to migrate a /boot partition to a Raid partition then my only choice would be a new install right?

  9. #9
    Join Date
    Apr 2005
    Location
    Finland
    Posts
    5,073
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bluejuice
    Hi Markkuk - I tried to shrink the filesystem, but was unsuccessful to even umount /dev/hdc1.
    /dev/hdc1 is a LVM physical volume according to your earlier post, so obviously you can't unmount it because it's not mounted (or mountable) in the first place. You must unmount the filesystems on logical volumes before you can shrink them.
    Quote Originally Posted by bluejuice
    Could you be perhaps give me the commands?
    No, you haven't given enough information about your logical volumes and filesystems.
    Quote Originally Posted by bluejuice
    As an alternative - to maybe simplify the whole process, since my case has room for 2 more drives. Do you think it would be easier to simply add two hard drives hdd and hde, and then set up two raid arrays md0 and md1 to mirror the new partitions to the existing ones
    Sounds OK this far.
    Quote Originally Posted by bluejuice
    and then move and reformat the existing partitions,
    If you do that, you will lose the RAID capability. Wasn't it the purpose of all this?
    Quote Originally Posted by bluejuice
    Since my goal is to make 2 drives bootable, to prevent downtime in case of harddrive failure, can you confirm that I will be able to even migrate the /boot partition to a RAID device?
    Not from personal knowledge.

  10. #10
    Join Date
    Feb 2005
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can run /boot in RAID1. Just make sure to install GRUB on both devices.

    Your best option in all of this is to get the data off those disks and rebuild the system.

  11. #11
    bluejuice Guest
    Hi Markuk - sorry my linux vocab is a bit limited as I am very much a newbie. Thanks for the feedback, I am still conducting RAID 1 migration experiments on my test box. However if what pewterdragn says in true, that I need to rebuild the system then I guess a new install would probably be the best solution. Especially since at the same time I want to add a second network card so that I can set up squid as a transperant proxy. With much of this so perhaps it would be easier to simply do a new install. Im also considering upgrading to FC5 - any thoughts on this?
    Infact - as a safer option, I could simply remove the two hard disks, replace them with 2 new disks. Create a new installation and get it all running, then plug in the old disks and copy my data, user/group and samba config files to the new system. Then once Ive tested everything and made sure its 100% working, I can reformat the old discs and add them to the Raid array. Whats your thoughts on that plan?
    Last edited by bluejuice; 27th October 2006 at 09:30 AM.

  12. #12
    Join Date
    Feb 2005
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it sounds good. I would definitely move forward with Fedora Core 5 also although if your current system is heavily customized you might have to tweak a config file or two. That will increase the shelf life of the system so you won't have to do this again for awhile.

    Just remember that if you change the RAID arrays after the fact you can ONLY use RAID1 with /boot. The short story is GRUB needs the data on any single disk to be fully intact and readable without the meta devices.

Similar Threads

  1. kernel-2.6.9 downgrade delimma
    By Break in forum Installation, Upgrades and Live Media
    Replies: 3
    Last Post: 12th July 2006, 10:35 PM
  2. Perc3Di SCSI RAID + Adaptec 2810SA RAID = Fatal Grub Error?
    By LinuxOnTheEdge in forum Installation, Upgrades and Live Media
    Replies: 7
    Last Post: 19th March 2005, 02:19 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
  •