Join the community today
Become a Member

Raid 1 to Raid5 (soft) in OVH

Discussion in 'System Administration' started by pamamolf, Nov 15, 2014.

  1. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    3:08 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    Hi

    I got a server from OVH with 3x 160gb ssd's and when i try to load Centos 6.6 i got Raid 1 :(

    [​IMG]


    Then i try to change it to Raid 5 but i don't get the full 320GB and i am not so sure that this is the correct way :(

    [​IMG]

    Any help please?

    Thanks
     
    Last edited: Nov 15, 2014
  2. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    10:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    only used SoYouStart partition manager once ever so not familiar with it and it looks different from my SoYouStart one so not sure.. but raid levels are set per disk device partition you create and not for whole disks

    for my SoYouStart looked like this for raid 1 with a raid 0 fastdisk partition

    [​IMG]
     
  3. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    3:08 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    Damn i have no idea how to fix this :(
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    10:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    just keep reinstall CentOS 6.6 OS from OVH dashboard changing the default partitioning at install time until you get what you want
     
  5. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    3:08 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    What commands should i use after installation the Raid that i use and the size?

    Thanks
     
  6. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    10:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    not sure i understand, SoYouStart partition manager at CentOS 6.x OS reload/reinstall time has partition manager to size and set raid levels prior to install. I assume OVH one also has such
     
  7. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    3:08 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    Yes as you can see from my screenshots i am on partition manager tool.....but i can't get it to have Raid 5 320gb usable and i get only 210gb ...
     
  8. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    10:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    you should be able to resize partitions at partition creation time
     
  9. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    3:08 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    I think after my screenshot it will auto install the OS and not ask anything else :(
     
  10. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    10:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    There should be a check box for custom install on reinstalls - at least there is for SoYouStart.

    Actually, just discovered SoYouStart has a Manage Template Installations where you can predefine your OS to install as well as it partition setup either as default or new custom. I just recreated my raid 0 partition scheme on a new Installation Template which you select from reinstall list of OSses

    soyoustart_manage_template_installation_00.png

    selecting my custom raid 0 partition scheme which I created when I created my CentOS 6.6 raid template

    soyoustart_manage_template_installation_01.png
    the default partition layout
    soyoustart_manage_template_installation_02.png
    the raid 0 partition layout I created
    soyoustart_manage_template_installation_03.png
    now when you go to reinstall OS, I just select that custom Installation Template I created
    soyoustart_manage_template_installation_04.png
     
  11. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    10:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    FYI, requirement of software raid is / and /boot need to be raid 1 partitions at least everything else can be set to your desired raid levels
     
  12. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    3:08 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    Yes this is what i have in my mind if you check my second screenshot:

    / raid 1
    /home rest of space
    /swap 1.5gb

    Ok i will check again and try to find it :)

    What partioning do you recommend for Centminmod installation ?
    Do i have to create at this stage a partition in ram for caching?
    It will auto detect from Centminmod and use or .. ?
     
  13. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    3:08 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    There is no extra step :(

    Last step is to confirm the partition that i have already done:

    [​IMG]
     
  14. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    10:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    that looks right for raid 5 with 3x160GB SSD disks

    Centmin Mod .07 stable install takes care of /tmp on tmpfs ramdisk while this has changed and improved on Centmin Mod .08 beta where install automatically determines if /tmp is on ram disk tmpfs or on disk according to how much memory you have. Full outline here and actual code in .08 beta on lines 653 to 689 of centmin.sh

    Code:
        # only mount /tmp on tmpfs if CentOS system
        # total memory size is greater than 8GB
        # will give /tmp a size equal to 1/2 total memory
        if [[ "$TOTALMEM" -ge '8000000' ]]; then
           rm -rf /tmp
           mkdir -p /tmp
           mount -t tmpfs -o rw,noexec,nosuid tmpfs /tmp
           chmod 1777 /tmp
           echo "tmpfs /tmp tmpfs rw,noexec,nosuid 0 0" >> /etc/fstab
           rm -rf /var/tmp
           ln -s /tmp /var/tmp
        elif [[ "$TOTALMEM" -ge '2000000' || "$TOTALMEM" -lt '8000000' ]]; then
           # set on disk non-tmpfs /tmp to 4GB size
           # if total memory is between 2GB and <8GB
           rm -rf /tmp
           dd if=/dev/zero of=/home/usertmp_donotdelete bs=1024 count=4000000
           echo Y | mkfs.ext4 /home/usertmp_donotdelete
           mkdir -p /tmp
           mount -t ext4 -o rw,noexec,nosuid /home/usertmp_donotdelete /tmp
           chmod 1777 /tmp
           echo "/home/usertmp_donotdelete /tmp ext4 rw,noexec,nosuid 0 0" >> /etc/fstab
           rm -rf /var/tmp
           ln -s /tmp /var/tmp
        elif [[ "$TOTALMEM" -le '2000000' ]]; then
           # set on disk non-tmpfs /tmp to 2GB size
           # if total memory is <2GB
           rm -rf /tmp
           dd if=/dev/zero of=/home/usertmp_donotdelete bs=1024 count=2000000
           echo Y | mkfs.ext4 /home/usertmp_donotdelete
           mkdir -p /tmp
           mount -t ext4 -o rw,noexec,nosuid /home/usertmp_donotdelete /tmp
           chmod 1777 /tmp
           echo "/home/usertmp_donotdelete /tmp ext4 rw,noexec,nosuid 0 0" >> /etc/fstab
           rm -rf /var/tmp
           ln -s /tmp /var/tmp
        fi
    fi
    As to recommended partition, you have to be careful as Centmin Mod as well as CentOS system itself has a number of directories and files located at root / if you are partitioning using a single root / partition
    • /svr-setup where all Centmin Mod source tarballs, rpms for repos, are saved to which over time can grow to 3-5+GB (I should really come up with a way to clean older files in next release)
    • /var/log where system and nginx, php-fpm, mariadb mysql logs are located which can grow
    • /var/lib/mysql where mariadb mysql data resides
    You'll have come up with the optimal partition size and setup for your intended usage loads and requirements though as there isn't a real general partition setup that would work for everyone.
     
  15. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    3:08 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    On raid 5 if i am not wrong i will be able to use the 2 disks so 320GB but i can see that i can only use :

    / 20gb <----If here goes the db then i have a problem as only the db is 31GB :(
    /home <-----210gb --->forum files are 80gb
    /swap <---1.5gb

    total: 231,5gb to be able to use :(
     
    Last edited: Nov 16, 2014
  16. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    10:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    raid 1 will take disk space from each of your 3x 160GB,

    so 20GB raid 1 partition takes 20GB x3 disks = 60GB and 512MB raid 1 swap = 512MBx3 = 1.5GB

    As 160GB formatted capacity is ~146GB, meaning each disk has 146-20-1.5 = 124.5GB of space left. So potentially for raid 5, you have 2x124.5GB = 249GB
     
  17. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    3:08 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    This one what was confuse me then :)

    One last question please.

    For the current server with this space that i have how do you recommend me to partitioning it (80gb data+32gb database) so i can avoid a full disk from logs or system files or centminmod files and so on ?

    Thank you !
     
  18. eva2000

    eva2000 Administrator Staff Member

    53,614
    12,139
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,683
    Local Time:
    10:08 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Well you can take care of /svr-setup by moving the directory to say /home/svr-setup and edit the main DIR_TMP variable in centmin.sh to point to /home/svr-setup as per Install - svr-setup directory | Centmin Mod Community

    but /var really depends on how your intended apps and software utilise it and their sizing requirements for logs.

    you could make / smaller and set dedicated /var and /svr-setup partitions on EXT4 as raid 5 instead too
     
  19. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    3:08 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    Ok thanks :)
     
    Last edited: Nov 17, 2014
  20. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    3:08 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    What do you think about this as it seems to be what i will use:

    Data 80Gb and DB 32Gb....

    [​IMG]

    ?
    I hate that / must be in Raid 1 :(

    Thanks
     
    Last edited: Nov 17, 2014