**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
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.
root@openmediavault:~# apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libdbd-mysql-perl libdbi-perl libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.1 mysql-common mysql-server-5.1 mysql-server-core-5.1 psmisc
Suggested packages:
libterm-readkey-perl tinyca
Recommended packages:
libhtml-template-perl
The following NEW packages will be installed:
libdbd-mysql-perl libdbi-perl libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.1 mysql-common mysql-server mysql-server-5.1 mysql-server-core-5.1 psmisc
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 24.2 MB of archives.
After this operation, 61.9 MB of additional disk space will be used.
Do you want to continue [Y/n]?
Alles anzeigen
Thats it, mysql is installed and should be running.
Next we need to install greyhole.
Just enter the following
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
root@openmediavault:~# apt-get install greyhole
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
bzip2 php-pear php5-intl php5-mysql sysstat
Suggested packages:
bzip2-doc php5-dev isag
The following NEW packages will be installed:
bzip2 greyhole php-pear php5-intl php5-mysql sysstat
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,037 kB of archives.
After this operation, 4,190 kB of additional disk space will be used.
Do you want to continue [Y/n]?
Alles anzeigen
Just press enter to install
When its finished you should see
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,
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
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.
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
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.
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
remove the # and add your timezone
# 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
# 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
My lines look like
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.
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
You can then check if it is working by copying something to your share and watching the log output.
root@openmediavault:~# greyhole -L
Oct 24 15:05:17 7 sleep: Nothing to do... Sleeping.Oct 24 15:06:07 7 write: Saving 1 metadata files for NAS/asftools310.exe
Oct 24 15:06:07 7 write: Saving metadata in /media/e6d5197b-e369-4c19-8bc3-0d24c531af17/.greyhole/.gh_metastore/NAS/asftools310.exe
Oct 24 15:06:07 7 write: Saving backup metadata file in /media/83406b69-3a5a-4df8-b514-4ee988af95f3/.greyhole/.gh_metastore_backup/NAS/./asftools310.exe
Oct 24 15:06:07 7 write: Copying 403KB file to /media/e6d5197b-e369-4c19-8bc3-0d24c531af17/.greyhole/NAS/asftools310.exe
Oct 24 15:06:07 7 write: Creating symlink in share pointing to the above file copy.
Oct 24 15:06:07 7 write: Saving 1 metadata files for NAS/asftools310.exe
Oct 24 15:06:07 7 write: Saving metadata in /media/e6d5197b-e369-4c19-8bc3-0d24c531af17/.greyhole/.gh_metastore/NAS/asftools310.exe
Oct 24 15:06:07 7 write: Saving backup metadata file in /media/83406b69-3a5a-4df8-b514-4ee988af95f3/.greyhole/.gh_metastore_backup/NAS/./asftools310.exe
Oct 24 15:06:07 7 read_smb_spool: Processing Samba spool...
Oct 24 15:06:07 7 sleep: Nothing to do... Sleeping.
Oct 24 15:06:17 7 read_smb_spool: Processing Samba spool...
Alles anzeigen
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
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.