How to set RAID 1, with new HDD in Redhat 9

Posted on 2004-11-25
Last Modified: 2010-03-17
I want to set RAID1 to mirror my existing ATA HDD with new ATA HDD of same capacity in Redhat 9.
Question by:rajeevsrivas
    LVL 87

    Expert Comment

    If you have a ATA Raid controller you should be able to do that while booting the system. You will just have take the 2 drives into your raid then be carefull to give the correct drive as the drive with the data source. Before creating the raid be sure to read the docs on the raid controller and also install the linux drivers for this controller.
    LVL 2

    Assisted Solution

    hi rajeevsrivas ,

                Do you want to make RAID 1 implimintation on installation time  or after installation ?

         1) At the time of of installation u go for disc druid option for  manual partitioning .  on that gui based utility is there through just select on filesystem tag u need to select RAID drive  
         2)  If  u have installed linux then there are  two utilities  Fdisk of partd
                using fdisk is more easier and i preffered ...  make new drives  and with t option make filesystem to raid
                ie convert it into software raid drives  ( 0xfd is the hex code for software raid auto detect)
           3) Now when u made drives with RAIDFS i.e. RAID file system format it with ext3 fs  by mke2fs
            4) edit /etc/raidtab  to define /dev/md0(md is raid volume representations)
                     mention raid level 1  , nr-rqaid-discs  = 2 ,  chunk-size 32, superblock 1 , and parity-algorithm
                                  device       /dev/hda<raiddrveno>
                                   raid-disk 0
                                   similar for  raid disk 2  

        to check your  configurations you can use  lsraid ,  mdstat .
                    5) you need to mount your raid drive to use it will generate automatically  mirroring or stripping pairity!  

     stay relax to your data  and enjoy !
    LVL 38

    Expert Comment


       There is hardware RAID and software RAID.
    For hardware RAID, you need have ATA RAID controller chip or card.
    rindi has mentioned the way to do hardware RAID.
    However, Linux treat match device name with IDE controller, so you need to be careful.
    your original hard disk is in primary master --> /dev/hda   <=== original hard disk
    primary slave ---> /dev/hdb
    secondary master ---> /dev/hdc
    secondary slave  ---> /dev/hdd
    ---- change to
    For extra ATA RAID controller card,
     primary master --> /dev/hde   <=== Put original hard disk
     primary salve  ---> /dev/hdf    
     secondary master --> /dev/hdg  <=== put new hard disk
     secondary slave   --> /dev/hdh
    Those drive letter need to change in /etc/fstab, /boot/grub/grub.conf
    or you linux box won't boot after you change your hard disk to RAID controller.

    For software RAID, it's implement in partition level.

    You might want to check the following URL:

    It's for RedHat 9. Very useful.



    Author Comment

    I am sorry, I m asking for software RAID.

    I m already having Redhat 9 running on ATA Hardisk. Now I want to add new Hard disk and do RAID1.

    LVL 38

    Assisted Solution

    >> For software RAID, it's implement in partition level.

    You can put your new hard disk in and boot from CD-ROM (RedHat Linux 9) and choose upgrade and "manual run disk druid".
    Then you will go to the GUI to setup disk partition as the RedHat document said above.

    If you want to manually do it, then "aashishkunte" already said it.

    I would like to double emphasize that "software RAID is implemented in PARTITION level".
    So if you have multiple partition in you original disk, then you need to create the same amount of partions on the new disk (thesame partition size, too). Make software RAID on each partition one-by-one and step-by-step.

    For the whole disk RAID 1, buy a RAID controller and do hardware RAID is easier and faster (software slow down the performance).

    Good luck,

    LVL 2

    Expert Comment

    do u want fdisk options

                    fdisk /dev/hda

               then u press p will show u partition list !

      n will create new partition t will convert filesystem  l will show u supported file system list

    LVL 2

    Expert Comment

    If I understood correctly You have up and running system and You want to add a mirror to it - software mrror. BE WARNED THAT PROCESS OF ADDING A NEW DRIVE MIGHT BE DANGEROUS, but on the other hand i've st up few such configurations and they are working correctly till now.

    Be warned that you might face a few other problems:
    you will need to boot from a raid-1 software array and you have to place a root ('/') partition on a raid-1 software array

    I think You should read this first (and read it twice before proceding):
    and remember it *might* be a little outdated - but not very much. Even if its very outdated you will get the trick after reading it.

    Hope that helps
    LVL 2

    Expert Comment

    Have u tried making partitions ?  and convert it intoRAID Drives And then  Ext3 FS installation ?
                The raidtab File in /etc is not present by default you need to write at your  own
     do u want raidtab file structure ?

    LVL 1

    Accepted Solution

    Wesly_chen and aashishkunte has provide you the solution, but i m giving another alternative.

    Add new hard disk of same size and make partitions in new disk of same size as in primary hard disk.

    now download free software mirrordir. Install this rpm package.

    mkdir -p /mirror

    mount /dev/hdb2 /mirror/

    mirrordir / /mirror/

    umount /mirror

    similarly you can do with hdb1 (boot) partition.

    Then make one file in usr/local/sbin
    and cron it atleast every hour.
    The advantage is that it only updates files, and incase primary harddisk fails secondary hard disk can be used as primary hard disk.

    If you want I can provide u.


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now