Install Greyhole and MySql from cli

  • **Updated, thanks to gboudreau**
    This guide assumes you have your drives mounted and samba shares are working.


    The first thing to do is to install mysql. To do this just enter


    Code
    apt-get install mysql-server


    you should see the output below, just press enter to accept. It will ask you to enter a password, this is the mysql main password, remember it as you will need it.



    Thats it, mysql is installed and should be running.


    Next we need to install greyhole.
    Just enter the following


    Code
    sh -c 'echo "deb http://www.greyhole.net/releases/deb stable main" > /etc/apt/sources.list.d/greyhole.list'
    wget -qO- http://www.greyhole.net/releases/deb/greyhole-debsig.asc | sudo apt-key add -


    wait for it to report "OK" then do the following


    apt-get update
    apt-get install greyhole



    Just press enter to install


    When its finished you should see


    Code
    Setting up greyhole (0.9.35-1) ...
    update-rc.d: using dependency based boot sequencing
    ===========================================================================
    See /usr/share/greyhole/USAGE to learn how to configure and start Greyhole.
    ===========================================================================


    Thats it, greyhole and mysql are installed, now the hard part, configuring greyhole.


    Configure your samba shares


    You need to load up the OMV webui and click the SMB/CIFS icon in the services section. In the Extra options box, add,


    Code
    unix extensions = no
    wide links = yes


    Click save at the top of the screen.


    Now click the Shares tab
    for each share you want greyhole to use do,


    1. click Shared folder name
    2. click edit
    3. enter the following into the Extra options box

    Code
    dfree command = /usr/bin/greyhole-dfree
    vfs objects = greyhole


    4. click save


    Once you have added the Extra options for each of the shares click the apply button at the top of the screen.


    Setup a MySQL greyhole database


    Remember that password you entered when installing MySQL? well now you need it. I used 1234 below, just replace that with your MAIN password.
    I use 89y63jdwe as the database password but you can use any password.


    Code
    mysql -u root -p1234 -e "create database greyhole; grant all on greyhole.* to greyhole_user@localhost identified by '89y63jdwe';"
    mysql -u greyhole_user -p89y63jdwe greyhole < /usr/share/greyhole/schema-mysql.sql


    Configure Greyhole


    To edit the configuration file just enter


    Code
    nano /etc/greyhole.conf


    Most settings have comments to say what the setting does but as this is the hardest part of setting up greyhole I will divide it up a bit and try to explain some of the important settings.


    Code
    db_engine = mysql
            db_host = localhost
            db_user = greyhole_user
            db_pass = 89y63jdwe
            db_name = greyhole


    The above section is for the database settings, if you used another password while creating the database enter that in place of 89y63jdwe


    Code
    #timezone = America/Montreal


    remove the # and add your timezone


    Code
    #       num_copies[Backups] = 2
    #       num_copies[CrashPlan] = 2
    #       num_copies[Games] = 2
    #       num_copies[Music] = 2
    #       num_copies[Photos] = max # This will insure those files are on all HDD
    #       num_copies[RecordedTV] = 1
    #       num_copies[Software] = 2
    #       num_copies[TimeMachine] = 1
    #       num_copies[Videos] = 2


    The above section sets the number of copies of files you want backed up across your drives, I don't require backups so I just set it to 1 for my shares, remember to remove the # if you edit the existing lines.


    My lines look like this

    Code
    num_copies[BACKUP] = 1
           num_copies[NAS] = 1



    Code
    # Example:
    #
    #       storage_pool_drive = /mnt/hdd0/gh, min_free: 10gb
    #       storage_pool_drive = /mnt/hdd1/gh, min_free: 10gb
    #       storage_pool_drive = /mnt/hdd2/gh, min_free: 10gb
    #       storage_pool_drive = /mnt/hdd3/gh, min_free: 10gb


    This is the section where you define the drive you want in your 'Storage pool'


    For each drive you want added to the pool add a line like


    Code
    storage_pool_drive = /media/UUID/.greyhole, min_free: 10gb


    My lines look like


    Code
    storage_pool_drive = /media/83406b69-3a5a-4df8-b514-4ee988af95f3/.greyhole, min_free: 10gb
           storage_pool_drive = /media/9070fd96-0246-4c9d-bf6a-cd7aca9c0700/.greyhole, min_free: 10gb
           storage_pool_drive = /media/e6d5197b-e369-4c19-8bc3-0d24c531af17/.greyhole, min_free: 10gb


    You can read the rest of the config and adjust any other settings you may want to but I normally leave them at their default values.
    Hold Ctrl-X to exit nano, it will ask if you want to save, press y followed by enter.


    The last thing we need to do is create the folders for greyhole to use. As you can see from above I use .greyhole as my greyhole space, you can use any name you like as long as you remember to make the folder with the same name on each drive.


    Code
    mkdir /media/83406b69-3a5a-4df8-b514-4ee988af95f3/.greyhole
    mkdir /media/9070fd96-0246-4c9d-bf6a-cd7aca9c0700/.greyhole
    mkdir /media/e6d5197b-e369-4c19-8bc3-0d24c531af17/.greyhole


    once that is done you just need to restart greyhole


    Code
    service greyhole restart


    You can then check if it is working by copying something to your share and watching the log output.


    Code
    greyhole -L



    and you can see file is found and moved to the greyhole storage pool.


    Greyhole problems


    I won't respond to PM's about this guide.
    If it does not work for you, you can try to do


    Code
    wget -qO- http://www.greyhole.net/support/system_info.sh | sh


    this will give you a url with info about your greyhole setup, you should look through the info in that url as it will help you debug any problems you may find.

    [align=center]banner@1x.jpg
    What I am watching/watched on my Popcorn Hour media player
    omv 2.1.1 stoneburner | 64 bit | omvextrasorg 1.29
    MySQL (Percona[size=8]) | Newznab | Sonarr | CP | HP | NZBget | YAMJ | CUPS

  • Added to the HowTo section.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Good stuff.


    BTW, mysql-server is listed as a required dependency in the Greyhole .deb package, so you shouldn't need to install it manually. If you just install Greyhole, it should install mysql-server too automatically, the same way it installs all other dependencies.


    Also, about curl, does OMV install wget by default? That step to install curl could be skipped if you used wget instead of curl to download the APT repo signature:

    Code
    wget -qO- http://www.greyhole.net/releases/deb/greyhole-debsig.asc | sudo apt-key add -
  • Debian squeeze comes with wget installed.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Zitat von "gboudreau"

    Good stuff.


    BTW, mysql-server is listed as a required dependency in the Greyhole .deb package, so you shouldn't need to install it manually. If you just install Greyhole, it should install mysql-server too automatically, the same way it installs all other dependencies.


    Also, about curl, does OMV install wget by default? That step to install curl could be skipped if you used wget instead of curl to download the APT repo signature:

    Code
    wget -qO- http://www.greyhole.net/releases/deb/greyhole-debsig.asc | sudo apt-key add -


    Thanks for the feed back gboudreau, I wanted to keep the MySQL separate from the greyhole install as it asks for a password and I wanted it to be clear the this was the main password for MySQL and nothing to do with greyhole. Some user might just want to install MySQL and use it with xbmc or another database.
    Also as the debug command needed curl so I thought I would get to user to install it early, there might be a way to use wget there as well but I thought that would need a wget, chmod and then run.

    [align=center]banner@1x.jpg
    What I am watching/watched on my Popcorn Hour media player
    omv 2.1.1 stoneburner | 64 bit | omvextrasorg 1.29
    MySQL (Percona[size=8]) | Newznab | Sonarr | CP | HP | NZBget | YAMJ | CUPS

  • Zitat von "jhmiller"

    Also as the debug command needed curl so I thought I would get to user to install it early, there might be a way to use wget there as well but I thought that would need a wget, chmod and then run.


    Code
    wget -qO- URL

    can replace

    Code
    curl URL

    (in the debug command too)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!