AddStoragePoolDrive

Guillaume Boudreau edited this page Apr 22, 2016 · 3 revisions

How to add drives to your storage pool

If the drive you want to add already contains data, and you want to merge that data with your storage pool, see How to re-use non-Greyhole data drives as Greyhole storage pool drives.

If the drive is empty, or contains data you don't want in your storage pool, here's how to add that drive to your storage pool.

  1. If it isn't already, partition and format the drive. Most likely, you'd want a single partition that use all the drive, and use your favorite file system for format that partition: ext4, XFS, ReiserFS, etc.

  2. Mount the partition using fstab. See below for recommendations about mounting drives. Let's assume the new drive partition is mounted at /mnt/hdd5.

  3. Create an empty folder, let's say gh, in the root of the partition: mkdir /mnt/hdd5/gh

  4. Add the path to the folder you just created in /etc/greyhole.conf: storage_pool_drive = /mnt/hdd5/gh, min_free: 10gb

  5. Restart the Greyhole daemon: /etc/init.d/greyhole restart or restart greyhole

  6. If you expect old files to be copied into that new storage pool drive, run greyhole --fsck. For example, if you have set num_copies[...] = max for some shares, fsck will create the needed file copies on the new drive.

Best practices for mounting partitions

When mounting partitions to use as a Greyhole storage pool directory, you should always do so using the label or UUID of the partition, and never using the /dev/xyz

Doing so will insure your partitions are always mounted correctly, and at the same place, even if you move the drives around (physically).

Good /etc/fstab line: UUID=957ad07b-90f9-4e69-835d-130bd2c456fb /mount/drive1 ext3 defaults 0 0

Good /etc/fstab line: LABEL=GH_DISK_1 /mount/drive1 ext3 defaults 0 0

Bad /etc/fstab line: /dev/sdb1 /mount/drive1 ext3 defaults 0 0

Some more info about devices vs UUID in fstab: http://linux.byexamples.com/archives/321/fstab-with-uuid/

/media/ mounts

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.

Recommended mount options (for ext3/ext4)

The following mount options are recommended: noatime,data=writeback,nofail

noatime disables the tracking of access times. This prevents the file-system from having to write a new access time each time you read a file!

data=writeback means that metadata for files can be written lazily after the file is written. This will not cause file system corruption, but it may cause the most recent changes to be lost in the event of a crash (so you may jump back into the past a bit).

nofail will allow your system to boot completely even if one of your disk is not available.