Difference between revisions of "Greyhole Tips"

From Amahi Wiki
Jump to: navigation, search
(Created page with "=")
 
Line 1: Line 1:
=
+
This area is a compilation of Greyhole tips and best practices.  Please feel free to add/update.
 +
 
 +
== Initial data copy to shares ==
 +
 
 +
When you start using Greyhole, you might want to copy or move all your existing files into your new shares that use the storage pool.
 +
 
 +
Note: This is not necessary if your files are already in Amahi shares. If they are there, and you enable the ''Uses pool'' option in the Amahi dashboard, the files will start getting moved around into the drives in your storage pool during the night (starting at midnight), when the nightly storage pool check starts.<br/>
 +
The instructions below are for users who have more data to copy into the Greyhole shares than their currently free space in the /var/hda/files/ folder.
 +
 
 +
One way to do that is to mount the shares that use the Greyhole storage pool, either on the HDA itself, or on a client computer on your local network, and copy your data from their existing location into the mounted shares.
 +
This can be time consuming, but it is the safest way to use Greyhole.
 +
 
 +
Another way to move your files from their current location into the storage pool is to share their current location using an Amahi share that ''Uses pool'', then let Greyhole's nightly check move the files from there into the pool.
 +
 
 +
Here's a more detailed walk-through for this method:
 +
 
 +
# Setup the Greyhole Storage Pool in the Amahi dashboard, Shares > Storage Pool page.
 +
# Go in the Shares > Shares page. In there, make sure you have an existing share for each share you have data for. Create new ones if you need, remove the ones you don't need.
 +
# Edit the ''path'' of each of those shares, and enter the current location of your existing data. For example, the Movies share could have a path = ''/media/External Drive/Movies''
 +
# Enable the ''Uses pool'' option for each of your shares, and select the number of extra copies you'd like, if any.
 +
# Now, you either need to wait for Greyhole's nightly check to start, or you can start it manually from a terminal, as root, using this command: greyhole --fsck
 +
# Monitor /var/log/greyhole.log to see when the ''fsck'' operation is done.
 +
# Once ''fsck'' is done, your data has now been moved into the Greyhole storage pool (in the drives you selected in Shares > Storage Pool). All that should be left in the previous location of your data (''/media/External Drive/Movies'' from the previous example) should be symbolic links pointing to the new file copies. If the previous location is just empty directories (no symlinks), do not panic. This is normal if your previous location is an NTFS or FAT partition (drive).
 +
# Move all those directories / symlinks from there into the correct folders in /var/hda/files/share_name
 +
# Back in the Amahi dashboard, edit the path of the shares once again, and put back ''/var/hda/files/share_name'' (i.e. the folders where you moved the symbolic links).
 +
# If you used an NTFS or FAT partition for the previous location, you'll need another fsck to create the symlinks where they should be. Either wait for midnight, or launch it manually, from a command line, as root: ''greyhole --fsck''
 +
 
 +
 
 +
You're done. All your existing data is now stored in the various drives included in your storage pool, and are accessible via the Samba shares you have defined in the Amahi dashboard.
 +
 
 +
== Drive Mounted as /media ==
 +
Including any drive mounted as /media/Something in your storage pool is usually a bad idea.<br/>
 +
 
 +
Those mounts are created by the ''gnome-automounter'', which requires you to be logged in into X (Gnome) to become available.<br/>
 +
 
 +
This will create issues with Greyhole, which expects drives to always be available, and will take action when some of them are missing.
 +
 
 +
Follow this guide to [[Adding a second hard drive to your HDA|permanently mount your drives]] before you include them in your storage pool.
 +
 
 +
== Forcing a fsck ==
 +
Greyhole comes with a crontab file that schedules daily and weekly fsck runs. The daily cron (usually runs at 4am) will only run if the configuration changed in the last 24 hours. The weekly fsck (usually runs at 4am on Sundays) will always run, whether the configuration changed or not.<br />
 +
To force a fsck at any other time, simply execute
 +
 
 +
:<u>Fedora</u><br />
 +
:As [[Open_terminal|root user]]:
 +
greyhole --fsck
 +
 
 +
:<u>Ubuntu</u>
 +
sudo greyhole --fsck
 +
 
 +
== Monitoring ==
 +
Sometimes you might want to monitor what Greyhole is doing, for example when writing data to your greyhole shares for the first time. Here are a few commands you can type in a terminal to follow along.
 +
 
 +
'''Scrolling view of total Greyhole operations queue:'''
 +
while [ 1 == 1 ]; do greyhole --view-queue | grep Total; sleep 60; done
 +
 
 +
'''Alternate way to watch Greyhole operations queue:'''
 +
watch -d greyhole --view-queue
 +
 
 +
'''Scrolling log of what files Greyhole is working on right now:'''
 +
tail -f /var/log/greyhole.log
 +
 
 +
 
 +
'''NOTE:'''  The Amahi application [http://www.amahi.org/apps/greyhole-logmon Greyhole LogMon] allows viewing the Greyhole log in a web browser.

Revision as of 01:37, 7 August 2014

This area is a compilation of Greyhole tips and best practices. Please feel free to add/update.

Initial data copy to shares

When you start using Greyhole, you might want to copy or move all your existing files into your new shares that use the storage pool.

Note: This is not necessary if your files are already in Amahi shares. If they are there, and you enable the Uses pool option in the Amahi dashboard, the files will start getting moved around into the drives in your storage pool during the night (starting at midnight), when the nightly storage pool check starts.
The instructions below are for users who have more data to copy into the Greyhole shares than their currently free space in the /var/hda/files/ folder.

One way to do that is to mount the shares that use the Greyhole storage pool, either on the HDA itself, or on a client computer on your local network, and copy your data from their existing location into the mounted shares. This can be time consuming, but it is the safest way to use Greyhole.

Another way to move your files from their current location into the storage pool is to share their current location using an Amahi share that Uses pool, then let Greyhole's nightly check move the files from there into the pool.

Here's a more detailed walk-through for this method:

  1. Setup the Greyhole Storage Pool in the Amahi dashboard, Shares > Storage Pool page.
  2. Go in the Shares > Shares page. In there, make sure you have an existing share for each share you have data for. Create new ones if you need, remove the ones you don't need.
  3. Edit the path of each of those shares, and enter the current location of your existing data. For example, the Movies share could have a path = /media/External Drive/Movies
  4. Enable the Uses pool option for each of your shares, and select the number of extra copies you'd like, if any.
  5. Now, you either need to wait for Greyhole's nightly check to start, or you can start it manually from a terminal, as root, using this command: greyhole --fsck
  6. Monitor /var/log/greyhole.log to see when the fsck operation is done.
  7. Once fsck is done, your data has now been moved into the Greyhole storage pool (in the drives you selected in Shares > Storage Pool). All that should be left in the previous location of your data (/media/External Drive/Movies from the previous example) should be symbolic links pointing to the new file copies. If the previous location is just empty directories (no symlinks), do not panic. This is normal if your previous location is an NTFS or FAT partition (drive).
  8. Move all those directories / symlinks from there into the correct folders in /var/hda/files/share_name
  9. Back in the Amahi dashboard, edit the path of the shares once again, and put back /var/hda/files/share_name (i.e. the folders where you moved the symbolic links).
  10. If you used an NTFS or FAT partition for the previous location, you'll need another fsck to create the symlinks where they should be. Either wait for midnight, or launch it manually, from a command line, as root: greyhole --fsck


You're done. All your existing data is now stored in the various drives included in your storage pool, and are accessible via the Samba shares you have defined in the Amahi dashboard.

Drive Mounted as /media

Including any drive mounted as /media/Something in your storage pool is usually a bad idea.

Those mounts are created by the gnome-automounter, which requires you to be logged in into X (Gnome) to become available.

This will create issues with Greyhole, which expects drives to always be available, and will take action when some of them are missing.

Follow this guide to permanently mount your drives before you include them in your storage pool.

Forcing a fsck

Greyhole comes with a crontab file that schedules daily and weekly fsck runs. The daily cron (usually runs at 4am) will only run if the configuration changed in the last 24 hours. The weekly fsck (usually runs at 4am on Sundays) will always run, whether the configuration changed or not.
To force a fsck at any other time, simply execute

Fedora
As root user:
greyhole --fsck
Ubuntu
sudo greyhole --fsck

Monitoring

Sometimes you might want to monitor what Greyhole is doing, for example when writing data to your greyhole shares for the first time. Here are a few commands you can type in a terminal to follow along.

Scrolling view of total Greyhole operations queue:

while [ 1 == 1 ]; do greyhole --view-queue | grep Total; sleep 60; done

Alternate way to watch Greyhole operations queue:

watch -d greyhole --view-queue

Scrolling log of what files Greyhole is working on right now:

tail -f /var/log/greyhole.log


NOTE: The Amahi application Greyhole LogMon allows viewing the Greyhole log in a web browser.