Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Setting up RAID 1... after install

  1. #1
    Join Date
    Oct 2010
    Location
    Reading, PA, US
    Beans
    63
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Cool Setting up RAID 1... after install

    Ok so i've decided to go with software RAID for 2 IDE drives. from what i read it's possible, but nothing i found is for what i want specifically. The problem is all the guides i found are for setting up RAID BEFORE installation of the OS, and to clone the boot disk... this isn't what i want.

    Short Version: I have a home server running 10.10 server and i want to setup RAID 1 on sdb and sdc. Both drives are 80GB IDE, one WD and one Seagate (i know, i know). Everything must be done via SSH, So where do i begin? google hasn't offered much in the way of post-installation storage-only RAID setup for ubuntu server using command-line only.

    Further reading: These drives are for storing my music collection (which i have already lost once), and thought it would be a nice solution to my problem. I am using samba to share my drives as extra space and DLNA down the road (when i have a use for it). I have a 20GB IDE drive for boot, and these 2 80GB IDE drives for (hopefully) RAID 1. I plan on adding a 1TB in about a month, and later replacing the 2 80GB with 2 500GB SATA.

  2. #2
    Join Date
    Feb 2005
    Location
    Oregon
    Beans
    496
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Setting up RAID 1... after install

    Wikipedia has a quick reference with all the important stuff, oddly enough: http://en.wikipedia.org/wiki/Mdadm

    Create the raid: (if your raid drives are sdb and sdc, and you've partitioned them)
    mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sdb1 /dev/sdc1

    Append array details to mdadm.conf:
    mdadm -Es | grep md0 >> /etc/mdadm/mdadm.conf

    After which the boot ramdisk should be updated:
    update-initramfs -u

    Create the filesystem:
    mkfs.ext4 /dev/md0

    Add it to /etc/fstab:
    /dev/md0 /store ext4 defaults,nobootwait 0 2

    "/store", or whatever you use, must already exist as a directory. The nobootwait is to prevent startup from halting if it can't mount it for some reason. I also add "barrier=1,nodelalloc" to reduce risk of loss in a crash at the cost of performance, and "noatime" to gain a small bit back.

    Mount with "mount -a"

    Another option is to use LVM, which has some mirroring support on its own, and it makes growing and moving volumes much easier, or you can use it in combination with mdadm.
    Last edited by dtfinch; February 15th, 2011 at 08:21 AM.

  3. #3
    Join Date
    Oct 2010
    Location
    Reading, PA, US
    Beans
    63
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Setting up RAID 1... after install

    Well that's certainly enough to get me started, Thanks!

    Will report back with results

  4. #4
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Setting up RAID 1... after install

    Quote Originally Posted by TechSupportx86 View Post
    Both drives are 80GB IDE, one WD and one Seagate (i know, i know).
    What do you know? It seems to me that the data protection of a RAID is improved the less correlated the failures of the disks. So in this regard is it not beneficial to use disks from different manufacturers?

  5. #5
    Join Date
    Oct 2010
    Location
    Reading, PA, US
    Beans
    63
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Setting up RAID 1... after install

    Quote Originally Posted by YesWeCan View Post
    What do you know? It seems to me that the data protection of a RAID is improved the less correlated the failures of the disks. So in this regard is it not beneficial to use disks from different manufacturers?
    Yes, It's just when it comes to RAID almost everyone (well, atleast the guides i've read) will tell you that using the same exact drive (we're talking same brand, same model and same family) is sort of a rule, But i disagree for the same reason. The "i know i know" was just to disregard the differences of the disks and get to the setting up of the array, to keep those "you should use the same blah blah blah" from voicing their opinion.

    The same would have been said if working with 2 brand new 1TB drives, one hitachi and the other WesternDigital (WD is just my pref). Was really just a "i know the so-called 'risk', just get to the point".

    My personal opinion is to use 2 different brands. The chances of 2 hitachi, seagate, wd, or IBM drives failing if in RAID for the same exact amout of time has a far greater chance of losing both disks before you can replace the bad one.

  6. #6
    Join Date
    Jun 2010
    Beans
    181

    Re: Setting up RAID 1... after install

    Quote Originally Posted by TechSupportx86 View Post
    Yes, It's just when it comes to RAID almost everyone (well, atleast the guides i've read) will tell you that using the same exact drive (we're talking same brand, same model and same family) is sort of a rule, But i disagree for the same reason.
    This rule comes from experience and knowledge about HDDs. Array made of different drive models will work ofc, but the main disadvantage will be lower to very poor performance. This is true for every stripe-based array - the only exceptions are JBOD and special configurations of Raid1, like "Write-mostly" variant in md. It would need a lot of writing to explain why, but using simple words - it's similar to what happens when partition/stripe/chunk alignment is wrong, but produces much worse results, nemely huge delays that are periodical function of HDD's head position.

    HDD is not a gaming die - You can't estimate probability of failure that way, because there are hundreds of factors and many of them are independant of HDD model, like PSU output voltage quality, ambient temperature, humidity, etc.

  7. #7
    Join Date
    Oct 2010
    Location
    Reading, PA, US
    Beans
    63
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Setting up RAID 1... after install

    Quote Originally Posted by dtfinch View Post
    Wikipedia has a quick reference with all the important stuff, oddly enough: http://en.wikipedia.org/wiki/Mdadm

    Create the raid: (if your raid drives are sdb and sdc, and you've partitioned them)
    mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sdb1 /dev/sdc1

    Append array details to mdadm.conf:
    mdadm -Es | grep md0 >> /etc/mdadm/mdadm.conf

    After which the boot ramdisk should be updated:
    update-initramfs -u

    Create the filesystem:
    mkfs.ext4 /dev/md0

    Add it to /etc/fstab:
    /dev/md0 /store ext4 defaults,nobootwait 0 2

    "/store", or whatever you use, must already exist as a directory. The nobootwait is to prevent startup from halting if it can't mount it for some reason. I also add "barrier=1,nodelalloc" to reduce risk of loss in a crash at the cost of performance, and "noatime" to gain a small bit back.

    Mount with "mount -a"

    Another option is to use LVM, which has some mirroring support on its own, and it makes growing and moving volumes much easier, or you can use it in combination with mdadm.

    Well i followed the instruction, had to improvise a tad, BUT i think i did it
    The only problem i had was a permissions error with the command:

    Code:
    mdadm -Es | grep md0 >> /etc/mdadm/mdadm.conf
    Which i just opened mdadm.conf with nano and added:

    Code:
    mdadm -Es | grep md0
    I added md0 to fstab to be mounted at /media/Music, restarted and got zero errors so i think i'm good. Shows up on my desktop as a samba share (just sharing /media/Music) with 69.4GB free (just need to run tune2fs). so pretty much i'm all setup! Thank you very much, hopefully someone else will find this useful.


  8. #8
    Join Date
    Feb 2011
    Beans
    24
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Setting up RAID 1... after install

    Quote Originally Posted by TechSupportx86 View Post
    Well i followed the instruction, had to improvise a tad, BUT i think i did it
    The only problem i had was a permissions error with the command:

    Code:
    mdadm -Es | grep md0 >> /etc/mdadm/mdadm.conf
    Were you using sudo? If so, sudo doesn't apply to the redirect itself. If you want to use that syntax you need to temporarily switch to root
    Code:
    sudo -i
    or another user that has permission to write to the file you're trying to redirect to.

  9. #9
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Setting up RAID 1... after install

    Quote Originally Posted by TechSupportx86 View Post
    My personal opinion is to use 2 different brands. The chances of 2 hitachi, seagate, wd, or IBM drives failing if in RAID for the same exact amout of time has a far greater chance of losing both disks before you can replace the bad one.
    I agree. Should be fine with RAID 1.
    I implemented a RAID 1+0 with different brands and didn't see any performance reduction.

    Perhaps tomazzi will elaborate on the specific corner cases where performance suffers significantly.

  10. #10
    Join Date
    Oct 2010
    Location
    Reading, PA, US
    Beans
    63
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Setting up RAID 1... after install

    Quote Originally Posted by ashikaga View Post
    Were you using sudo? If so, sudo doesn't apply to the redirect itself. If you want to use that syntax you need to temporarily switch to root
    Code:
    sudo -i
    or another user that has permission to write to the file you're trying to redirect to.
    will keep in mind for next time, thanks.

    Quote Originally Posted by YesWeCan View Post
    I agree. Should be fine with RAID 1.
    I implemented a RAID 1+0 with different brands and didn't see any performance reduction.

    Perhaps tomazzi will elaborate on the specific corner cases where performance suffers significantly.
    Yeah, mine seems to be working fine. i mean the transfer rate went from about 11.4 to about 8mb/s, but it's 2 IDE drives, performance went out the window before i even started. I'm not expecting to run any programs off of it, or use it like and external HDD. The most stress this is going to see is copying my music folder over, and reading the 5mb songs to be played on iTunes or songbird (so reading 5mb every 3-4 minutes).

    I can see if i was hosting a content-rich website this could pose a problem and i WOULD want to gain any and all performance possible, but this is really only going to serv as basic storage with redundancy, and that's what i need

    So i think it's safe to say using two different disks of the same size, from different manufacturers isn't the recommended configuration if you are looking for performance, BUT it will work just fine for an 'average joe' home-server based storage setup, altho not an enterprise server setting where performance is necessary which i think tomazziis referring to. i'm not saying the performance loss isn't there, but i understand the trade-off to allow for redundancy.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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