Page 1 of 6 123 ... LastLast
Results 1 to 10 of 52

Thread: WD20EARS Alignment and RAID5 Guide!

  1. #1
    Join Date
    Jun 2010
    Beans
    45

    WD20EARS Alignment and RAID5 Guide!

    Like many other people, I bought WD20EARS drive for an array and thought I would just toss them into my server and set up an array and would be done by sun down. And like many people, I was dead wrong. What was supposed to be a one-night deal turned into a month long battle with RMA's (newegg is pretty fast) and filed SATA cards, bad drives, bad cables, and bad SATA controllers on my old motherboard. So after all this crap, I still had to deal with figuring out how to align partitions on a WD20EARS with a GPT partition table (since the drives have 4KB sectors), and kept finding guides that said to use 0 or 1 or 64 for the sectors to start your partitions with. Well I tried those, and got ridiculously low speeds for syncing the array.

    So I read somewhere that Windows 7 knew how to align them properly, so i popped one into my windows 7 box and created a partition on it. It started at sector 2048! (1MB into the disk). So i make an ext4 partition in its place with the same start and ending sectors, and then struggled with that a bit and it kept locking up as the sync got to about 93.2% and then two of the drives would fail out of the array and another would be turned into a spare.

    After a week of trying different methods of this i tried setting pins 7 and 8 on the drives, well that failed too, the box wouldn't even boot. I read somewhere that it messed with the controller. So i gave up on that for a few days until i decided to do the same thing but put the disk into my win7 box, and the windows 7 worked fine, i made a new GPT table and did the same with the rest of the disks. I noticed it still didnt get very good read/write performance. I decided to go ahead and try and align the partitions manually even with the 7+8 pins jumped.

    Suffice it to say that after some serious trial and error I cam up with a configuration that worked. I have pin 7+8 jumpered on all 4 drives, I created and formatted XFS partitions starting at sector 2048 and ending on sector 3907029134 on each drive. I then "forced" a raid5 creation. And I am currently waiting for that to finish, but am getting GREAT sync speeds, of around 70-90MB/s.

    So here are the steps:

    1. Physical preparation: Ensure pints 7+8 are jumpered (if you don't have jumpers you can buy them are most computer stores or online)
    2. Download and install the necessary software.
      Code:
      sudo apt-get install xfsprogs
    3. Change user to root.
      Code:
      sudo -s
    4. Create the partitions on EACH drive (replace sda with whatever drive you are doing).
      Code:
      parted /dev/sda
      mklabel gpt
      yes
      unit s
      mkpart
      
      xfs
      2048
      3907029134
      quit
    5. Format the partitions. Do the following for each drive. (again, replace sda with whatever drive you are doing)
      Code:
      mkfs.xfs /dev/sda1
    6. Create the array with the following command (change the number of drives as required and be sure that the devices are correct):
      Code:
      mdadm --create /dev/md0 --chunk=2048 --force --level=5 --raid-devices=4 /dev/sdb1 /dev/sdd1 /dev/sdc1 /dev/sde1
    7. Create your /etc/mdadm/mdadm.conf file, without this it will fail to recognize the array after you reboot! Execute the following commands:
      Code:
      sudo echo "DEVICE partitions" > /etc/mdadm/mdadm.conf
      sudo mdadm --detail --scan >> /etc/mdadm/mdadm.conf
    8. Wait for the array to finish syncing. You can reboot while it is going, but DO NOT CONTINUE WITH THIS GUIDE (OR ATTEMPT TO PARTITION /dev/md0)UNTIL IT IS COMPLETELY SYNC'D!! You can expect this to take 8-12 hours! You are able to watch the status of it via:
      Code:
      watch -n 0.2 cat /proc/mdstat
      or
      Code:
      watch -n 2 mdadm --detail /dev/md0
    9. Format the new array.
      Code:
      mkfs.xfs /dev/md0
    10. Add the array to your fstab (File System TABle). You can use gedit, or your favorite command line editor. Add the following line to the end of your "/etc/fstab" file.
      Code:
      /dev/md0 /media/raidarray auto defaults 0 3
      You can change "/media/raidarray" to wherever you want it to mount on boot.
    11. Mount the new raid array:
      Code:
      mount --all


    Now you should have a raid5 array mounted at /media/raidarray or where ever you put it.
    Last edited by megamandos; October 19th, 2010 at 10:14 AM.

  2. #2
    Join Date
    Mar 2010
    Location
    Woonsocket, RI USA
    Beans
    3,195

    Re: WD20EARS Alignment and RAID5 Guide!

    Quote Originally Posted by megamandos View Post
    Suffice it to say that after some serious trial and error I cam up with a configuration that worked. I have pin 7+8 jumpered on all 4 drives, I created and formatted XFS partitions starting at sector 2048 and ending on sector 3907029134 on each drive. I then "forced" a raid5 creation. And I am currently waiting for that to finish, but am getting GREAT sync speeds, of around 70-90MB/s.
    This story is rather surprising. Jumpering those pins causes the drive to offset its sector numbers by 1, so that what the computer believes is 63 is actually 64 (and others changed in a similar way). In theory, you should get better performance with that jumper not set. Certainly every test I've seen (and I actually ran a set of tests myself) suggests that, in a single-drive configuration, performance can take a significant hit when partitions are misaligned.

    I would speculate that your syncing operation is doing reads of large blocks of data at once, so you're not seeing the performance problems of this configuration; but when you start using the disk, the performance won't be as great as it should be, particularly if you write a lot of small files. In my tests, XFS took 1.8 times as long to write small files on improperly aligned partitions. Whatever you do, don't use ReiserFS, ext2fs, or JFS on that drive! (See Figure 2 in the article to which I linked.)

    Of course, I realize you tried doing it the "right" way and had difficulties. I suspect you've got two or three interacting problems, with the Advanced Format alignment issues being just one of them (and the one that's not a show-stopper).

  3. #3
    Join Date
    Jun 2010
    Beans
    45

    Re: WD20EARS Alignment and RAID5 Guide!

    I am still having issues, seems to be alignment of the partition on the md0 device. And i am still having trouble with my motherboard so i ordered a new motherboard and bought some new RAM. Overnight, they should be here in a couple days.

  4. #4
    Join Date
    Mar 2010
    Location
    Woonsocket, RI USA
    Beans
    3,195

    Re: WD20EARS Alignment and RAID5 Guide!

    Quote Originally Posted by megamandos View Post
    I am still having issues, seems to be alignment of the partition on the md0 device. And i am still having trouble with my motherboard so i ordered a new motherboard and bought some new RAM. Overnight, they should be here in a couple days.
    In that case, I recommend you try again without using the jumper and with 2048-sector (1 MiB) alignment on your next attempt.

  5. #5
    Join Date
    Jun 2010
    Beans
    45

    Re: WD20EARS Alignment and RAID5 Guide!

    View the attachment, it happened when i was formatting on of the drives. Granted, it was mounted over USB, an I/O error is bad either way.

    The second try worked though.
    Attached Images Attached Images

  6. #6
    Join Date
    Jun 2010
    Beans
    45

    Re: WD20EARS Alignment and RAID5 Guide!

    Ok so, without the jumper installed, sync speeds are around 11MB/s when forced.

    They are all XFS with partitions starting at sector 2048.

    Also i got this error twice: "md: could not bd_claim sde1"

    Code:
            Version : 1.2
      Creation Time : Thu Oct 21 22:41:59 2010
         Raid Level : raid5
         Array Size : 5860529472 (5589.04 GiB 6001.18 GB)
      Used Dev Size : 1953509824 (1863.01 GiB 2000.39 GB)
       Raid Devices : 4
      Total Devices : 4
        Persistence : Superblock is persistent
    
        Update Time : Thu Oct 21 22:41:59 2010
              State : clean, resyncing
     Active Devices : 4
    Working Devices : 4
     Failed Devices : 0
      Spare Devices : 0
    
             Layout : left-symmetric
         Chunk Size : 64K
    
     Rebuild Status : 0% complete
    
               Name : big-server:0  (local to host big-server)
               UUID : eb6e693e:436cee15:1c63f80d:9a9422c8
             Events : 0
    
        Number   Major   Minor   RaidDevice State
           0       8       17        0      active sync   /dev/sdb1
           1       8       49        1      active sync   /dev/sdd1
           2       8       33        2      active sync   /dev/sdc1
           3       8       65        3      active sync   /dev/sde1
    Each of the drives look just like this, no jumper is installed.
    Code:
    Model: ATA WDC WD20EARS-00M (scsi)
    Disk /dev/sdc: 3907029168s
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start  End          Size         File system  Name  Flags
     1      2048s  3907024064s  3907022017s  xfs
    After a little while speeds improved, but not by much.

    Code:
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
    md0 : active raid5 sde1[3] sdc1[2] sdd1[1] sdb1[0]
          5860529472 blocks super 1.2 level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
          [>....................]  resync =  1.1% (22409472/1953509824) finish=1541.6min speed=20876K/sec
          
    unused devices: <none>
    Last edited by megamandos; October 22nd, 2010 at 05:06 AM.

  7. #7
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: WD20EARS Alignment and RAID5 Guide!

    The purpose of the jumper is to allow Windows XP to perform normally with a start sector of 63. Current versions of partitioning tools on Ubuntu will start the partition at sector 2048, like vista and windows 7, in which case you do NOT want the jumper. You can use gpt if you want to, but you do not have to since the drive is not larger than the 2tb limit of the msdos partitoin table. The fact that it uses 4kb sectors internally ( and lies and claims it is 512 bytes still ) has no bearing on anything other than the optimal alignment. Which filesystem you use is also immaterial.

  8. #8
    Join Date
    Jun 2010
    Beans
    45

    Re: WD20EARS Alignment and RAID5 Guide!

    Second attempt with the EXACT same configuration:

    Code:
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
    md0 : active raid5 sde1[3] sdc1[2] sdd1[1] sdb1[0]
          5860536960 blocks super 1.2 level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
          [>....................]  resync =  0.0% (227712/1953512320) finish=28925.3min speed=1125K/sec
          
    unused devices: <none>
    This time the error i see is slightly different, only by the disk:
    Code:
    [2844.077019] md: could not bd_claim sdd1

  9. #9
    Join Date
    Jun 2010
    Beans
    45

    Re: WD20EARS Alignment and RAID5 Guide!

    Quote Originally Posted by psusi View Post
    The purpose of the jumper is to allow Windows XP to perform normally with a start sector of 63. Current versions of partitioning tools on Ubuntu will start the partition at sector 2048, like vista and windows 7, in which case you do NOT want the jumper. You can use gpt if you want to, but you do not have to since the drive is not larger than the 2tb limit of the msdos partitoin table. The fact that it uses 4kb sectors internally ( and lies and claims it is 512 bytes still ) has no bearing on anything other than the optimal alignment. Which filesystem you use is also immaterial.
    So any guess as to the major performance degradation?

    Current versions of partitioning tools on Ubuntu will start the partition at sector 2048...
    Thats not correct. Gparted starts at sector 34 by the way.
    Last edited by megamandos; October 22nd, 2010 at 07:41 AM.

  10. #10
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: WD20EARS Alignment and RAID5 Guide!

    Quote Originally Posted by megamandos View Post
    So any guess as to the major performance degradation?
    Are you sure that you have the jumper OFF? And you will need to reformat when changing the position of the jumper.

    Quote Originally Posted by megamandos View Post
    Thats not correct. Gparted starts at sector 34 by the way.
    Which version are you using? The one that ships with 10.04 should start at sector 2048 just like Windows Vista and 7.

Page 1 of 6 123 ... LastLast

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
  •