<div style="border: 1px solid #A3B1BF; padding: .8em 1em; background-color: #E6F2FF; margin: 0px 1em;">
'''NOTE:''' In the future, The Amahi [https://www.amahi.org/apps/disk-wizard Disk Wizard] application (in Amahi 8 or greater '''ONLY'Development'') will provide provides this capability from the DashboardUI.
</div>
=Disclaimer=
* [https://www.amahi.org Amahi] cannot be held responsible for any data breakage or destruction arising from the use or misuse of this script. We provide it as a service in good will. You accept this automatically if you use the script.
* [https://www.amahi.org Amahi] cannot be held responsible for any data breakage or destruction arising from the use or misuse of this script. We provide it as a service in good will. You accept this automatically if you use the script.
* [http://en.wikipedia.org/wiki/GUID_Partition_Table GUID-partitioned] hard drives (such as those previously used in a Mac or have GPT partition tables) are not supported in this tutorial.
* [http://en.wikipedia.org/wiki/GNU_nano nano] is used as the command-line text editor (refer to [http://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/ beginners guide to nano] as needed).
Fedora
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left">
yum dnf -y install pmount fuse fuse-libs ntfs-3g util-linux-ng parted nano
</div>
:'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the package manager for Fedora 23 and greater.
Ubuntu
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left">
</div></blockquote>
Up to 2TB, at the ''(parted)'' prompt, enter:
# mklabel msdos (answer ''yes'' when if prompted)
# mkpart primary 0% 100%
# quit
<br />
Greater than 2TB, at the ''(parted)'' prompt, enter:
# mklabel gpt (answer ''yes'' when if prompted)
# mkpart primary 0% 100%
# quit
Verify the new partition was created:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
ls -l /dev/disk/by-uuidid/
</div>
:EXAMPLE:
lrwxrwxrwx 1 root root 10 Dec 29 9 2010-02-1803:10 1b8597e024 ata-5d95-4474-b093-53099c8c81c9 Hitachi_HDS722020ALA330_JK1131YAGDU37V -> ../../sda1sda lrwxrwxrwx 1 root root 10 Dec 29 18:10 1c1610332010-c69502-4291-aba1-257d3987edf7 -> ../../dm-0 lrwxrwxrwx 1 root root 10 Dec 29 1803:10 b701725124 ata-cb54Hitachi_HDS722020ALA330_JK1131YAGDU37V-438b-92a3-781537c565e6 part1 -> ../../sdbsda1 lrwxrwxrwx 1 root root 10 Dec 29 18:10 c1fe62b3 9 2010-41dc-4a67-8a6b-09f90b7893ba -> ../../dm02-1 lrwxrwxrwx 1 root root 10 Dec 29 1803:10 e0f5a9bd-f52b-431e-89af24 ata-61da70659bdd ST31000528AS_6VP08W65 -> ../../dm-2sdb <span style="color:#FF0000">'''lrwxrwxrwx 1 root root 10 Dec 29 9 2010-02-1803:10 547b073d-e591-491324 ata-b4fbST31000528AS_6VP08W65-7c5084353979 part1 -> ../../sdb1'''</span>
The new partition is named sdX1 (i.e. sdb1 in <span style="color:#FF0000">'''RED'''</span>).
=Mount=
Mount the hard drive(s)/partition(s) for use in the HDA.
:'''NOTE:''' If you prefer not to use ''hda-diskmount'', refer to [[Adding_a_second_hard_drive_to_your_HDA#hda-diskmount|Troubleshooting ''hda-diskmount]].
[[Open Terminal as root|In a Terminal, as root]], execute the following(it will create drive1, drive2, etc and mount the hard drive(s) automatically):
</div>
:'''NOTE:''' There may be a '''WARNING''' that can be ignored indicating ''/var/hda/files/drives cannot be moved to a subdirectory of itself'' which should be ignored.
Unmount the new hard drive:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
mount -a
ls /var/hda/files/drives/drive1
</div>
The last command will display contents of the new hard drive. All shares are now located on the new hard drive.
It should look something like the following when lines are added for each of the five drives in this example.
:'''NOTEEXAMPLE:''' Lines beginning with # are comments where the remainder of the line is ignored <div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
# Mounting Greyhole Drives for Drive Pool.
#
#
#
</div>:'''NOTE:''' Lines beginning with # are comments where the remainder of the line is ignored
Verify there are no issues by executing the following:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
If all drives mounted successfully, it should look something like this (Ubuntu):
:EXAMPLE:[[File:Gstreet_greyhole_pool.png|options|caption]]
==Bad Blocks==
Answer ''yes''. The <code>-cn</code> option we're using can safely be used on mounted file systems.
==Spin Down Hard Drives==
Low power is a good thing to have in servers. If you do not use your server very often, you may want to force the hard drives to spin down faster than the default. Here is how.
First ensure ''hdparm'' package is installed:
sudo dnf install hdparm
To force to spin down after 10 minutes of being idle, add these lines to <code>/etc/rc.local</code>:
<pre>
# power drives down after 10 minutes idle
/sbin/hdparm -S120 /dev/sda
/sbin/hdparm -S120 /dev/sdb
...
</pre>
Most drives will power down on their own without doing this.
Once stopped, the drive may take as long as 30 seconds to respond to a subsequent disk access, though most drives are much quicker. The encoding of the -S timeout value is somewhat peculiar. A value of zero means "timeouts are disabled": the device will not automatically enter standby mode. Values from 1 to 240 specify multiples of 5 seconds, yielding timeouts from 5 seconds to 20 minutes. Values from 241 to 251 specify from 1 to 11 units of 30 minutes, yielding timeouts from 30 minutes to 5.5 hours. A value of 252 signifies a timeout of 21 minutes. A value of 253 sets a vendor-defined timeout period between 8 and 12 hours, and the value 254 is reserved. 255 is interpreted as 21 minutes plus 15 seconds. Note that some older drives may have very different interpretations of these values.
It may make the system run cooler and power efficient (especially on a Home Server you are rarely using all of the pool drives at the same time).
=Troubleshooting=
==hda-diskmount==
If ''hda-diskmount'' does not mount the hard drive, or you can manually prefer to do it by completing manually, complete the following steps:
Create the mount point (choose one '''NOT''' in use) [[Open Terminal as root|In in a Terminal, as root]], execute by executing the following:
<blockquote><div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
mkdir -p /var/hda/files/drives/drive1