1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Linux 8 days to build mdadm array???

Discussion in 'Tech Support' started by KID52, 1 Jan 2014.

  1. faugusztin

    faugusztin I *am* the guy with two left hands

    Joined:
    11 Aug 2008
    Posts:
    6,953
    Likes Received:
    270
  2. KID52

    KID52 Minimodder

    Joined:
    19 Aug 2007
    Posts:
    335
    Likes Received:
    6
    Thanks, but that looks like it is for the desktop version. I'm going to go for the minimal Ubuntu installation. Luckily there is plenty of help for this on the XBMC forums already.

    Pretty sure 64bit is required for ZFS, so I'm going to go ahead with the installation and set up ZFS. Haven't really got anything to lose (I hope!).
     
  3. IvanIvanovich

    IvanIvanovich будет глотать вашу душу.

    Joined:
    31 Aug 2008
    Posts:
    4,870
    Likes Received:
    252
    Yes, you are on the right track to do x64 minimal distro install, then the zfs and xbmc packages. I hope it works out better for you than the path you were on before, good luck.
     
  4. KID52

    KID52 Minimodder

    Joined:
    19 Aug 2007
    Posts:
    335
    Likes Received:
    6
    Right, installed a minimal version of Ubuntu 13.04 (13.10 seems to have an issue with USB keyboards during install).

    Installed ZFS and set up the pool as a RAID-Z array. Seemed simple enough.

    Set up the SAMBA share, tried to copy a file... 200KB/s... WTF?

    Any idea what is going on here? Checked RAM use and it's only at 7% so I guess that isn't the issue.

    Output from iostat again in case that is useful.

    Code:
    Linux 3.8.0-34-generic (XBMCLive)       02/01/14        _x86_64_        (2 CPU)
    
    avg-cpu:  %user   %nice %system %iowait  %steal   %idle
               1.10    0.00    0.78   22.43    0.00   75.69
    
    Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
    sda               4.19         3.74        49.90       4016      53584
    sdb               4.19         2.97        49.69       3192      53352
    sdc               3.69         2.91        49.19       3124      52820
    sdd               3.70         2.97        48.27       3188      51828
    sde               6.24       206.37        63.65     221599      68344
    I've also tried using dd and the speed is exactly the same...
     
  5. KID52

    KID52 Minimodder

    Joined:
    19 Aug 2007
    Posts:
    335
    Likes Received:
    6
    Okay, so to test whether I am just a tard or not, I installed FreeNAS and set up ZFS RAID-Z on the 4 drives.

    Added a share, tried to copy a file. Oh look, speeds exactly as expected. Now, I haven't tried it on the gigabit network, but it saturates the 10/100 router it is currently connected to.

    A quick dd test shows a speed of 242MB/s for a 10GB file, but I am told this is not a reliable test on a ZFS system as this data may just be in memory rather than actually on the disks.

    Anyway, regardless of what the unscientific tests show, it proves I am incapable of correctly setting up my own ZFS RAID-Z configuration in Ubuntu.

    So, my question now is what are the exact steps I need to follow to get this set up correctly? I have followed various guides to the letter, and each time this has resulted in the same pitiful 200KB/s transfer speeds, and yet it works fine in FreeNAS, so what the hell am I doing wrong, or not doing?

    I have even found numerous posts where people have set up a HP MicroServer as I am doing, and have 0 issues with ZFS RAID-Z, some of which have guides, and yet when I follow those, I still get 200KB/s.

    I really have no idea where I am going wrong. Hopefully someone can help me :(
     
  6. Xlog

    Xlog Minimodder

    Joined:
    16 Dec 2006
    Posts:
    714
    Likes Received:
    80
    Generally speaking, due to licensing issues ZFS support on linux/gnu is crap, last time I checked, you needed to recompile kernel to have kernel-space ZFS, otherwise its running on FUSE, resulting in very poor performance. I suggest sticking to bsd (kFreeBSD if you want debian style package manager) or if you are feeling really adventurous - solaris/illumos.

    Now for ZFS itself. ZFS by default does not know about 4k sector disks (maybe freenas automates this, need to check), so then creating vdev you'll need to add ashift = 12 (more info). Also, make sure that dedup is disabled - it's usually not needed in home environment.

    Few other pointers:
    * one share/folder per content type (films, music, documents, etc), this way you'll be able to adjust zfs options (compression, dedup, snapshots, etc) for each content type.
    * at least weakly scrub.
    * snapshots are godsend - use them (helps redusing "oh **** I deleted something important" moments, but causes "I keep deleting things, but free space is not increasing)
    * don't fill vdev more than ~80%
     
  7. Gareth Halfacree

    Gareth Halfacree WIIGII! Lover of bit-tech Administrator Super Moderator Moderator

    Joined:
    4 Dec 2007
    Posts:
    17,132
    Likes Received:
    6,728
    ZFS support in Linux is actually pretty stable now, although 'cos my NAS has such a tiny amount of memory - 512MB - I use Btrfs instead. Works pretty well, with LZO compression and file-level (not the block-level of ZFS) deduplication.
     
  8. lp rob1

    lp rob1 Modder

    Joined:
    14 Jun 2010
    Posts:
    1,530
    Likes Received:
    140
    RAID5 is notorious for taking a long time to create an array, especially with 4 high capacity disks. ZFS, as a file system instead of a block-level manager, avoids the whole process, giving you an array in a few minutes at most. Btrfs works in a similar way (although I haven't tried it).

    As Xlog said, ZFS on Linux is currently pretty bad when it comes to performance. You might want to try Btrfs as Gareth suggested, however note that it is currently in heavy development and you might find data-destroying bugs with it. For this reason I would stay away from it until most of the bugs are ironed out, and stick with ZFS. Although, I have got a ZFS array working at ~100Mbit/s read speeds, so I'm not sure how you got such poor performance on Linux.
     
  9. Gareth Halfacree

    Gareth Halfacree WIIGII! Lover of bit-tech Administrator Super Moderator Moderator

    Joined:
    4 Dec 2007
    Posts:
    17,132
    Likes Received:
    6,728
    That's a very good point, and something I should have mentioned. That said, I've (so far) had no trouble with it - but I've nothing on there I can't afford to lose: I mainly use it for storing backups.
     
  10. KID52

    KID52 Minimodder

    Joined:
    19 Aug 2007
    Posts:
    335
    Likes Received:
    6
    I think FreeNAS is based on freeBSD, but really, I would prefer to use Ubuntu just because I know how to get it set up so that it works in the way I need using XBMC with the correct video drivers, remote drivers etc.

    The wiki suggests Ubuntu has native ZFS support and can be installed from a repository (which is how I did it the first time).

    https://wiki.ubuntu.com/ZFS

    I was also aware of the 4k issue, my first ZFS attempt I did not add the extra flag, but I did second time round, however this appeared to have no effect on the speed, it remained at 200KB/s.

    Appreciate the other helpful pointers too.

    Again, thanks for this information.

    As much as I would like the speed, it isn't critical, I'm not pulling files off the server all the time, maybe writing a few GB per day. I'd like to see 50MB/s or more, but I can cope with less.

    From what I can tell, all I need to do is run the following command to create the pool.

    Code:
    zpool create -o ashift=12 datapool raidz /dev/sda /dev/sdb /dev/sdc /dev/sdd
    Then create the datasets.

    Code:
    zfs create -o mountpoint=/mnt/films datapool/films
    zfs create -o mountpoint=/mnt/tvshows datapool/tvshows
    And then I should be good to go?

    This is exactly what I did yesterday, and only achieved the 200KB/s speed. Am I missing something here? Do I need to do anything to the drives, as in, format them or anything at all, or does the first command that creates the pool deal with all of that?

    Also I'm aware that it is advised to use drive IDs rather than "/dev/sda" etc, I just put those in the post as it's easier to write.
     
  11. IvanIvanovich

    IvanIvanovich будет глотать вашу душу.

    Joined:
    31 Aug 2008
    Posts:
    4,870
    Likes Received:
    252
    It seems no one asked, and you didn't tell which disk you are using... not happen to be WD green by chance? I know those have all sorts of issue when trying to put them in any kind of array.
    I'm not familiar with the bios of HP microserver, but does it have any raid options, and did you use them? You should not.
    I am not sure what is otherwise going on, as honestly I am not really as familiar with setting up ZFS on linux. I was not aware that ZFS support was still so far behind on linux, so I apologize for recommending a potentially bad path. Perhaps if you don't wan't to go with standard BSD, you could maybe try Debain kfreeBSD? I have not tried this distro personally, It seems it is BSD core with debain system and packages. Debain is what ubuntu came from so it should be much more similar to what you are used to in the userspace and also have the BSD core with full mature ZFS... could be a best of both solution.
     
  12. KID52

    KID52 Minimodder

    Joined:
    19 Aug 2007
    Posts:
    335
    Likes Received:
    6
    From what I've read, a lot of people with the identical hardware to me (maybe different drives) seem to be using ZFS on Ubuntu without issue, and as mentioned FreeNAS runs fine so I'm positive the hardware is up to the job, it's just getting the configuration and initial setup right.

    I don't think using any BSD based system would be possible though, as I need to run XBMC on the machine. Hence my preference of Ubuntu as I vaguely know what I'm doing.
     
  13. Xlog

    Xlog Minimodder

    Joined:
    16 Dec 2006
    Posts:
    714
    Likes Received:
    80
    kfreebsd has xbmc in its repo (11 for stable, 12.3 for sid), so I can't this being the problem.
     
  14. IvanIvanovich

    IvanIvanovich будет глотать вашу душу.

    Joined:
    31 Aug 2008
    Posts:
    4,870
    Likes Received:
    252
    Even pure BSD have xbmc ports as well. Unless you are entrenched in ways of doing things indepth on linux, BSD isn't going to be all that different if you don't spend lot of time with CLI stuff.
     
  15. lysaer

    lysaer Suck my unit! Kirk lazarus (2008)

    Joined:
    15 May 2010
    Posts:
    1,467
    Likes Received:
    71
    Personally I found using zfs and software raid in Ubuntu and raid 5 software I would get horrific write speeds on mine, write would be in the region of 20MB/s

    I tried a variety of solutions and in the end bit the bullet and brought a hardware raid card, I installed it, built the raid and now pull 250MB/s write without any issue.

    Software raid5 just kinda sux for writes since it has to do the parity calculations and even with a 4770k overclocked to 4.2 and a maximus vi with 16gb of ram didn't seem to be enough to handle it.

    Like I said stuck the raid card in and bam no problems at all with writes

    Sent from my Nexus 7 using Tapatalk 4
     
  16. narwen

    narwen narwen

    Joined:
    6 Aug 2010
    Posts:
    387
    Likes Received:
    12
    xbmc is supported in freenas via htpc manager.
     
  17. KID52

    KID52 Minimodder

    Joined:
    19 Aug 2007
    Posts:
    335
    Likes Received:
    6
    I will definitely try this out then, when I had a quick look I didn't see much support for XBMC running on BSD, but I have nothing to lose by installing it.

    Again, a RAID card is simply not an option due to cost.

    That appears to be for just controlling another machine that is running XBMC, not actually running XBMC on the same machine.
     
  18. KID52

    KID52 Minimodder

    Joined:
    19 Aug 2007
    Posts:
    335
    Likes Received:
    6
    Having posted on the Ubuntu forum also, I have not been able to find a solution to the speed issue.

    I attempted to install FreeBSD and XBMC, but although installing FreeBSD went okay and setting up RAIDZ worked with decent speeds, I was unable to get XBMC working. Tried following a guide from just a few months back but it already seemed outdated with some broken links.

    Also found out my RAM is faulty, so that is getting replaced.

    So, my solution now, which may not be perfect, but the end result is acceptable, is to use two machines.

    One is running FreeNAS and just stores files, the other runs XBMC and plays the files from the FreeNAS machine. Both are HP Microservers. The FreeNAS box is 1.5GHz, and XBMC box is the slower 1.3GHz version with a GT210.

    Both fulfil their intended purpose.

    I wouldn't mind replacing the XBMC machine with something like a Raspberry Pi for a true silent media PC, but from what I've seen it isn't quite powerful enough to run everything perfectly.
     
  19. narwen

    narwen narwen

    Joined:
    6 Aug 2010
    Posts:
    387
    Likes Received:
    12
  20. KID52

    KID52 Minimodder

    Joined:
    19 Aug 2007
    Posts:
    335
    Likes Received:
    6
    Not a bad idea, haven't really looked into those much.

    Do they usually come with a remote?

    Have you tried XBMC on one personally? If so, do 1080p files play silky smooth? What about the GUI and moving between screens?

    Do I need a specific one for XBMC compatibility, if not, what sort of specs do I need?

    I'd be happy to purchase one as long as there is not too much faffing around getting things to work, and everything is smooth :)
     

Share This Page