Changes

From Amahi Wiki
Jump to: navigation, search
More hard drives can be added in your Amahi HDA <center>{{MessageBox|backgroundcolor = #faa|image =Warning.png|heading =WARNING|message = This is recommended only for additional storage space''Advanced'' users, proceed with caution.}}</center><div style="border: 1px solid #A3B1BF; padding: .8em 1em; background-color: #E6F2FF; margin: 0px 1em;">
We'll detail how to add such hard drives, and how to put them to good use''NOTE:''' The Amahi [https://www.amahi.org/apps/disk-wizard Disk Wizard] application (Amahi 8 or greater '''ONLY''') provides this capability from the Dashboard UI.
</div><br />The purpose of this tutorial is to make partitioning, formatting, and mounting hard drives in the Amahi server simple for those new to Linux.  In order to keep this process simple, it's important '''NOT''' to connect additional hard drive(s) until the end of the [[Adding_a_second_hard_drive_to_your_HDA#Preparation|Preparation]] step.  =Important NotesDisclaimer=* [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).
* This is an '''advanced''' how-to on how to add additional drives to your HDA.=Prerequisites=* Amahi cannot be held responsible for any data breakage or destruction arising from the use or misuse of this script. We provide it [[Open Terminal as root|In a service in good will. You accept this automatically if you use the script.Terminal, as root]], verify disk tools are installed by executing:<br />
Fedora<div style=Step by step instructions="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left"> dnf -y install pmount fuse fuse-libs ntfs-3g util-linux-ng parted nano</div>
==Make sure your drive is detected by the BIOS==It should be listed in the drives that appear when you boot your computer, before :'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the package manager for Fedora boot screen appears23 and greater. You can also enter you BIOS and confirm they appear thereUbuntu <div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left"> sudo apt-get -y install gparted</div>
==Make sure your drive is detected by Fedora==Open a Terminal, and type the following command:'''NOTE:''' Hard drives must be formatted as '''MBR''' not '''GUID/GPT''' for ''hda-diskmount'' to work correctly.
=Preparation=[[Open_Terminal_as_root|In terminal as root]], execute the following to capture current hard drive configuration:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color: #000E6F2FF; margin: 3px 3px 1em 3px;"> ls -l /dev/disk/by-id/ > before.txt cat before.txt</div> :EXAMPLE: lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V -> ../../sda lrwxrwxrwx 1 root root 10 2010-02-18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V-part1 -> ../../sda1 Power ''OFF'' the HDA and install/connect any additional hard drive(s).<br /> =Identify=Power ''ON'' the HDA and collect data about the new hard drive configuration. Again, save this to a text file for reference. [[Open_Terminal_as_root|In a terminal as root]], execute the following to capture current hard drive configuration:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> ls -1 l /dev/disk/by-id/ | egrep -v "part|scsi"> after.txt cat after.txt
</div>
Look for the line that match the hard drive you added:EXAMPLE: lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V -> ../../sda lrwxrwxrwx 1 root root 10 2010-02-18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V-part1 -> ../../sda1 lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-ST31000528AS_6VP08W65 -> ../../sdb
:'''FYI:''' IDE and /SATA hard drives will start with '''ata-''' and USB hard drives will start with '''usb-'''.<br/>Look for your hard drive model and serial number.
Example:=Partition/Format=Compare the difference between before.txt and after.txt to determine the new hard drive(s) device name. This can be done automatically.
[[Open Terminal as root|In a Terminal, as root]], execute the following:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">[gb@hda ~]$ ls -1 /dev/disk/by-id/ | egrep -v "part|scsi"<br/>ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V<br/>ata-ST31000528AS_6VP08W65<br/>ata-ST3750640A_3QD0LJN8<br/>ata-ST3750640A_5QD27A57<br/>ata-WDC_WD10EADS-00L5B1_WD-WCAU4C700358<br/>usb-ST310003_33AS_9E1CA6FFFFFF-0:0<br/>usb-ST375064_0A_2009031309E2-0:0 diff before.txt after.txt
</div>
==Install prerequisites==:EXAMPLE: lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-ST31000528AS_6VP08W65 -> ../../sdb At this point, partition and format the hard drive(s) if they are new. For hard drive(s) that contain data to be preserved, skip to the [[Adding_a_second_hard_drive_to_your_HDA#Mount|Mount]] step.
[[Open Terminal as root|In a Terminal==Command-line (Fedora)==To partition the hard drive(s), substitute sdX with hard drive device name, such as root]], type the following command''sdb'':
[[Open Terminal as root|In a Terminal, as root]], execute the following:<blockquote><div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color: #000E6F2FF; margin: 3px 3px 1em 3px;"> parted /dev/sdX</div></blockquote>Up to 2TB, at the ''(parted)'' prompt, enter:# mklabel msdos (answer ''yes'' if prompted)# mkpart primary 0% 100%# quit<br />Greater than 2TB, at the ''(parted)'' prompt, enter:# mklabel gpt (answer ''yes'' if prompted)# mkpart primary 0% 100%# quit<br />Verify the new partition was created:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">yum -y install pmount fuse fuse ls -libs ntfsl /dev/disk/by-3g gpartedid/
</div>
:EXAMPLE:
lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V -> ../../sda
lrwxrwxrwx 1 root root 10 2010-02-18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V-part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-ST31000528AS_6VP08W65 -> ../../sdb
<span style="color:#FF0000">'''lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-ST31000528AS_6VP08W65-part1 -> ../../sdb1'''</span>
 
The new partition is named sdX1 (i.e. sdb1 in <span style="color:#FF0000">'''RED'''</span>).
 
Format the partition, execute (can substitute ext3):
<blockquote><div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
mkfs.ext4 -j /dev/sdX1
</div></blockquote>
 
Repeat the [[Adding_a_second_hard_drive_to_your_HDA#Partition/Format|Partition/Format]] step for each hard drive to be partitioned and formatted.
 
==GParted (Ubuntu)==
From the HDA desktop (or using VNC), [[Open_Terminal_as_root|In a terminal as root]] and type '''gparted''' to launch the application.
 
Here's a general introduction on [http://www.youtube.com/watch?v=vdWkdrnNGRg YouTube]. Just use ''ext3'' or ''ext4'' instead of ''fat32'' if you follow that tutorial.
==For drives > 2.0 TB, following these steps:* Choose hard disk in the dropdown menu (top right)* Select Device > Create Partition and format the hard drive==Table... > Advanced > (Choose 'gpt')* Create partition
This step is optional, and should only be executed if you want to delete the content of your new hard drive, or if the hard drive has not yet been formatted.
You should (unless you have a good reason not to) use GParted to partition and format your hard drive.:<b>NOTE:<br/b>From the HDA desktop (or using VNC), [[Open Terminal as roothttp://gparted.org GParted]] and type '''gparted''' to launch supports GUID-partitioned drives, however, the GParted applicationhda-mount script do not support currently.
To know what device (Repeat the [[Adding_a_second_hard_drive_to_your_HDA#Partition/devFormat|Partition/sdX) you need Format]] step for each hard drive to select in GParted, use the following command, in a Terminal:be partitioned and formatted.
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">Mount=ls -l Mount the hard drive(s)/dev/disk/by-id/</div>partition(s) for use in the HDA.
Find the row corresponding :'''NOTE:''' If you prefer not to your hard driveuse ''hda-diskmount'', and look at the end of the line refer to identify the correct device to select in GParted[[Adding_a_second_hard_drive_to_your_HDA#hda-diskmount|Troubleshooting ''hda-diskmount]].
Example[[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 style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">[gb@ hda ~]$ <strong>ls -l /dev/disk/by-id/</strong><br/>total 0<br/>lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V -> ../../sda<br/>lrwxrwxrwx 1 root root 10 2010-02-18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V-part1 -> ../../sda1<br/>lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-ST31000528AS_6VP08W65 -> ../../<strong>sdb</strong>diskmount
</div>
In the above example, :EXAMPLE: **************************************************************** Ignoring /dev/sdb would be what I would select sda1 - already in GParted/etc/fstab or mounted **************************************************************** Mounted /dev/<strong style="color:green">sdb1</strong> as '<strong style="color:red">/var/hda/files/drives/drive1</strong>' (read-write) You may want your system to mount it every time you boot. sda in my primary hard drive To do so, add this line VERY CAREFULLY to /etc/fstab and reboot: <strong style="color:blue">UUID=547b073d-e591-4913-b4fb-7c5084353979 /var/hda/files/drives/drive1 ext4 defaults 1 2</strong> **************************************************************** All Linux, Windows and sdb my second hard drive.Mac partitions on non-removable disks have been mounted
YouThe line in <span style="color:#0000FF">''ll probably want to create a single partition, and format it as 'BLUE'ext3''.<br/span>Note that Windows can't read ext3 partitions, so if is what you want need to read your disk on Windows, you should format as NTFS instea, copy and you should do that on Windows before you connect add to the bottom of ''/etc/fstab''. This is '''REQUIRED''' for the hard drive in your HDA.<br/>Remember that using NTFS partitions on Linux will (s) to be slower that using ext3 partitions, so you should only use NTFS if you really need itpermanently mounted.
There are many easy to follow guides online on how to use GPartedwill be multiple lines for multiple hard drive(s) added. You should Google for one, to find one that seems clear to Ensure youcopy and add '''ONLY''' those which were not present in the ''before.<br/>[http://www.mepisguides.com/Mepis-6/Install/gparted/gparted-set-partition.html Heretxt''s one] that looks simple. Just use ext3 instead of fat32 in you follow that tutorialfile.
==Mount The new hard drive storage space can be used for [[Adding_a_second_hard_drive_to_your_HDA#All Shares|All Shares]], [[Adding_a_second_hard_drive_to_your_HDA#Some Shares|Some Shares]], or the [[Adding_a_second_hard_drive_to_your_HDA#Greyhole Storage Pool|Greyhole Storage Pool]]. Follow the guidance below based on desired usage for each hard drive==.
A script is provided with Amahi that will look for unmounted partitions in your system, and mount any it finds==All Shares==Host '''ALL''' shares on the new hard drive.
[[Open Terminal as root|In a TerminalMove all the shares data to the new drive, as root]], type replacing path in '''<span style="color: red;">RED</span>''' with the path from the following command''hda-diskmount'' output line in <span style="color:#0000FF">'''BLUE'''</span>.<br />
[[Open Terminal as root|In a Terminal, as root]], execute the following:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
mv /var/hda-diskmount/files/* <strong style="color:red">/var/hda/files/drives/drive1/</strong>
</div>
Example:'''NOTE:''' There may be a '''WARNING''' that can be ignored indicating ''/var/hda/files/drives cannot be moved to a subdirectory of itself''. Unmount the new hard drive:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
[root@hda ~]$ hda-diskmount<br umount /><nowiki>****************************************************************<var/nowiki><brhda/>Ignoring files/dev/sda1 - already in /etcdrives/fstab or mounted<brdrive1/><nowiki>****************************************************************</nowiki><br/div>Mounted /dev/<strong style="color:green">sdb1</strong> Mount the new hard drive permanently as '<strong style="color:red">'/var/hda/files/drives/sdb1</strong>' (read-write)<br/> You may want your system to mount it every time you boot.<br/> To do so, add this line VERY CAREFULLY to ' by editing ''/etc/fstab and reboot'':<br/> <strong div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color:blue#E6F2FF; margin: 3px 3px 1em 3px;">/dev/sdb1 /var/hda/files/drives/sdb1 ext4 defaults 1 2</strong><br/><nowiki>****************************************************************< nano /nowiki><bretc/>All Linux, Windows and Mac partitions on non-removable disks have been mounted<br/>fstab
</div>
Add the line to ''/etc/fstab'' provided in the ''hda-diskmount'' output in '''<span style="color: blue;">BLUE</span>''' and change the second value (path) to ''/var/hda/files''.
Do '''not''' edit :EXAMPLE hda-diskmount output (Original): <span style="color: blue;">UUID=547b073d-e591-4913-b4fb-7c5084353979 <strong>/var/hda/files/drives/etcdrive1</fstab just yet. What you'll need to add there will depend on how you want to use the extra storage. More about that below.strong> ext4 defaults 1 2<br/span>Just note down the information in bold :EXAMPLE hda-diskmount output (green, red and blueModified). We'll use them below.: UUID=547b073d-e591-4913-b4fb-7c5084353979 <strong>/var/hda/files</strong> ext4 defaults 1 2
If you get something like :EXAMPLE /etc/fstab: # # /etc/fstab # Created by anaconda on Sat Nov 9 01:46:39 2013 # # Accessible filesystems, by reference, are maintained under '/dev/disk'Disk # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # UUID=1ebbf241-528c-465e-889f-acc15400dd8c /dev ext4 defaults 1 1 UUID=087b15a5-c3ca-4615-b6ee-bf5f399a803e /dmboot ext4 defaults 1 2 UUID=75346b8e-b162-458c-b0e9-a8d48ec2bc82 swap swap defaults 0 0 UUID=ad85eeb9-18f0-4b85-9bfa-b88a5d1489b3 swap swap defaults 0 doesn't contain a valid partition table'' or ''mount0 <span style="color: unknown file system type #0000FF">'lvm2pv''UUID=547b073d-e591-4913-b4fb-7c5084353979 /var/hda/files ext4 defaults 1 2' its because you have LVM's that 'fdisk' can not recognize (or something similar)</span>Finally, execute the following:<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/</div>The last command will display contents of the new hard drive. It's nothing to worry about if you get that when executing All shares are now located on the hda-diskmount scriptnew hard drive.
==Test your hard driveSome Shares==Optionally, you can test your Host '''SOME''' shares on the new hard drive for bad blocks.To do so, [[Open Terminal as root|in a Terminal, as root]], type the following command. Replace <strong style="color:green">sdb1</strong> with the (green) value you received from hda-diskmount.
Move some shares data to the new drive by executing the following command (replace path in '''<span style="color: red;">RED</span>''' with the path from the ''hda-diskmount'' output line in <span style="color:#0000FF">'''BLUE'''</span>; sharename will be the share to move to the new drive).<br />
 
[[Open Terminal as root|In a Terminal, as root]], execute the following:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
e2fsck -cn mv /devvar/hda/files/<strong>sharename</strong> <strong style="color:greenred">sdb1/var/hda/files/drives/drive1/</strong>
</div>
Repeat the process with every share to be moved to the new drive.
==Get your partition UUID==Each partition in Linux can be identified with a unique identifier. This identifier, Unmount the UUID, is what you'll want to use to permanently mount your new partitionhard drive: <div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> umount /var/hda/files/drives/drive1</div>
To get Mount the UUID of your new partition, execute this command in a Terminal. Replace <strong style="colorhard drive permanently by editing ''/etc/fstab'':green">sdb1</strong> with the (green) value you received from hda-diskmount.<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">ls -l nano /dev/disk/by-uuid/ | grep <strong style="color:green">sdb1<etc/strong>fstab
</div>
Add the line to ''/etc/fstab'' provided in the ''hda-diskmount'' output in '''<span style="color: blue;">BLUE</span>'''.
:EXAMPLE /etc/fstab:
#
# /etc/fstab
# Created by anaconda on Sat Nov 9 01:46:39 2013
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=1ebbf241-528c-465e-889f-acc15400dd8c / ext4 defaults 1 1
UUID=087b15a5-c3ca-4615-b6ee-bf5f399a803e /boot ext4 defaults 1 2
UUID=75346b8e-b162-458c-b0e9-a8d48ec2bc82 swap swap defaults 0 0
UUID=ad85eeb9-18f0-4b85-9bfa-b88a5d1489b3 swap swap defaults 0 0
<span style="color:#0000FF">'''UUID=547b073d-e591-4913-b4fb-7c5084353979 /var/hda/files/drives/drive1 ext4 defaults 1 2'''</span>
Verify the hard drive(s)/partition(s) configuration is correct in ''/etc/fstab''.
ExampleNext, execute the following:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
[gb@hda ~]$ <strong> mount -a ls -l /devvar/diskhda/by-uuid/ | grep sdb1</strong><br/>lrwxrwxrwx 1 root root 10 2010-02-18 03:24 9d972abc-1639-44df-a60e-668618d40236 -> ..files/..drives/sdb1drive1
</div>
The last command will display contents of the new hard drive. All shares are now located on the new hard drive.
 
'''<u>HDA Dashboard Update</u><br />'''
The location of each share that was moved to the new hard drive will need updated. Select ''Setup'' followed by the ''Shares'' section. Expand each share that was moved individually and change the location (path) accordingly.
 
For example, the original movies location was <span style="color:red">/var/hda/files/movies</span> but the new location might be <span style="color:blue">/var/hda/files/drives/drive1/movies</span>.
 
Repeat for any other shares that you have moved to the new hard drive. Verify these shares are accessible from another machine within your network.
 
'''NOTE:''' If any services depend on the location of a moved share, ensure they are configured to use the new share location. For example, if [https://www.amahi.org/apps/dlna DLNA] is installed, check the configuration file to verify it can find the new share location. Secondly, validate that that all such services start correctly and behave as expected. If the service doesn't start, it may be that it's looking for a specific share location during the service start up.
In the example above, my UUID is '''9d972abc-1639-44df-a60e-668618d40236'''. Note that down==Greyhole Storage Pool==Use new hard drive for [[Storage_pooling|Greyhole Storage Pool]].
[[Open Terminal as root|In a Terminal, as root]], mount the new hard drive permanently by editing ''/etc/fstab'':<div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> nano /etc/fstab</div>Add the line to ''/etc/fstab'' provided in the ''hda-diskmount'' output in '''<span style=Use "color: blue;">BLUE</span>'''.:EXAMPLE /etc/fstab: # # /etc/fstab # Created by anaconda on Sat Nov 9 01:46:39 2013 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # UUID=1ebbf241-528c-465e-889f-acc15400dd8c / ext4 defaults 1 1 UUID=087b15a5-c3ca-4615-b6ee-bf5f399a803e /boot ext4 defaults 1 2 UUID=75346b8e-b162-458c-b0e9-a8d48ec2bc82 swap swap defaults 0 0 UUID=ad85eeb9-18f0-4b85-9bfa-b88a5d1489b3 swap swap defaults 0 0 <span style="color:#0000FF">'''UUID=547b073d-e591-4913-b4fb-7c5084353979 /var/hda/files/drives/drive1 ext4 defaults 1 2'''</span>Verify the hard drive==(s)/partition(s) configuration is correct in ''/etc/fstab''.
You have a choice here on how Refer to use your new hard drive storage space. We'll offer some examples[[Greyhole#Amahi 6|Greyhole (Amahi 6)]] for Ubuntu or [[Greyhole#Amahi 7|Greyhole (Amahi 7)]] for Fedora to configure the [[Storage_pooling|Greyhole Storage Pool]].
=Verify/Test==Use Verify the hard drive for all shares===If you want all your shares to be on your new hard drive, here's how to do that/partition is mounted.
First, you'll need to move all you shares data into your new drive.<br/>[[Open Terminal as root|In a Terminal, as root]], type execute the following command. Replace the path in red with the path you received when you ran hda-diskmount.:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">mv /var/hda/files/* <strong style="color:red">/var/hda/files/drives/sdb1/</strong> df -h
</div>
You'll get a warning about "cannot move `/var/hda/files/drives' to a subdirectory of itself"; that is fine, ignore that.
Next, you'll need to unmount your new hard drive, and remount it as :EXAMPLE: Filesystem Size Used Avail Use% Mounted on /dev/sda5 16G 4.3G 11G 30% / devtmpfs 493M 0 493M 0% /dev tmpfs 498M 84K 498M 1% /dev/shm tmpfs 498M 364K 498M 1% /run tmpfs 498M 0 498M 0% /sys/fs/cgroup tmpfs 498M 1.1M 497M 1% /tmp /dev/sda1 190M 75M 102M 43% /boot /dev/sdb1 917G 398G 473G 46% /var/hda/files/drives/drive1
The hard drive(s) and the mount point (path) should be listed for each hard drive added. If not, then further investigation will be needed to determine the problem.
<br />
 
=Tips=
==Mount Order==
The following guide will outline how to manually order hard drives and mount them automatically on boot.
 
[[Open Terminal as root|In a Terminal, as root]], executing the following command to obtain the UUID for each hard drive:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
umount /var/hda/files/drives/sdb1/ blkid
</div>
:EXAMPLE:
/dev/sda1: LABEL="Seagate-Alpha2TB" UUID="55d9333f-d801-425a-b2af-d65c5966d56f" TYPE="ext4"
/dev/sdb1: LABEL="Seagate-Beta2TB" UUID="5bd5498f-30c1-4780-948e-ca46656507d2" TYPE="ext4"
/dev/sdc1: LABEL="WD-Charlie2TB" UUID="a7337504-376a-4d36-9f7a-1a24c0f55fbd" TYPE="ext4"
/dev/sdd1: LABEL="WD-Delta2TB" UUID="8d881dcb-8de3-4621-b9bd-00025196868a" TYPE="ext4"
/dev/sde1: LABEL="root" UUID="4d6f8004-d190-4234-a03b-b68de988abf0" TYPE="ext4"
/dev/sde3: LABEL="home" UUID="d0531fa1-9311-4d53-b838-f35898adbd98" TYPE="ext4"
/dev/sde5: LABEL="swap" UUID="3c39206c-ba60-47ff-a1fe-f5821b2ab543" TYPE="swap"
 
In this case, there are four data drives (sda1, sdb1, sdc1, sdd1) and the Operating system assigned to a fifth drive, sde.
Take note of the UUID's for each drive. Easiest to cut and paste UUID's straight from the terminal.
 
Edit ''/etc/fstab'' to mount each drive:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
nano /etc/fstab
</div>
Then '''very carefully''' add the following line for each disk into the end of the fstab file. Ensure correct UUID, hard drive number and hard drive file system (ext4 in this case) are added.
 
:EXAMPLE:
UUID=55d9333f-d801-425a-b2af-d65c5966d56f /var/hda/files/drives/drive1 ext4 defaults 1 2
 
It should look something like the following when lines are added for each of the five drives in this example.
 
:EXAMPLE:
# Mounting Greyhole Drives for Drive Pool.
#
# Drive1 = Seagate-Alpha2TB in Microserver Bay 1 from left
UUID=55d9333f-d801-425a-b2af-d65c5966d56f /var/hda/files/drives/drive1 ext4 defaults 1 2
#
# Drive2 = Seagate-Beta2TB in Microserver Bay 2 from left
UUID=5bd5498f-30c1-4780-948e-ca46656507d2 /var/hda/files/drives/drive2 ext4 defaults 1 2
#
# Drive3 = WD-Charlie2TB in Microserver Bay 3 from left
UUID=a7337504-376a-4d36-9f7a-1a24c0f55fbd /var/hda/files/drives/drive3 ext4 defaults 1 2
#
# Drive4 = WD-Delta2TB in Microserver Bay 4 from left
UUID=8d881dcb-8de3-4621-b9bd-00025196868a /var/hda/files/drives/drive4 ext4 defaults 1 2
#
# Drive5 = 250GB OS Drive mounted in Optical Drive bay
UUID="4d6f8004-d190-4234-a03b-b68de988abf0 /var/hda/files/drives/drive5 ext4 defaults 1 2
#
#
In nano, you:'ll need to add a new line at the bottom. Take the line that hda-diskmount gave you (the blue one), and change the first two values.<br/>Instead of /dev/sdb1, enter ''NOTE:'UUID=''' followed by Lines beginning with # are comments where the UUID you found earlier.<br/>Replace remainder of the second value with '''/var/hda/files'''.line is ignored
hda-diskmount gave meVerify 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;">
<strong style="color:blue">/dev/sdb1 /var/hda/files/drives/sdb1 ext4 defaults 1 2</strong> mount -a
</div>
If there are errors,most likely a line was not added properly. If this is not corrected, the machine may not boot and hang trying to mount the hard drives!
So I should add this insteadOnce there are no errors, reboot machine:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
<strong>UUID=9d972abc-1639-44df-a60e-668618d40236</strong> <strong>/var/hda/files</strong> ext4 defaults 1 2 reboot
</div>
Verify the hard drives have successfully mounted in the '''HDA Dashboard'''.
 
If all drives mounted successfully, it should look something like this (Ubuntu):
 
:EXAMPLE:
[[File:Gstreet_greyhole_pool.png|options|caption]]
Make sure ==Bad Blocks==Optionally, you do '''not''' change anything else from the blue line you received from hda-diskmountcan test your new drive for bad blocks.<br/>It might not be the same thing as the above example; oyu need to use the values you've received.
Save and exit nano (CTRL-X), and try your new mount:'''NOTE:''' This can take a ''long'' time to complete! Recommend starting it in the evening so it will be completed the next day.
[[Open Terminal as root|In a Terminal, as root]], execute following command (replace '''sdb1''' with the (<strong style="color:blue">BLUE</strong>) value you received from ''hda-diskmount''):
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
mount e2fsck -acn /dev/'''sdb1'''
</div>
You'll receive a message stating '''WARNING!!!''' ''Running e2fsck on a mounted filesystem may cause SEVERE filesystem damage. Do you really want to continue (y/n)?''<br/>
 
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
That's itTo force to spin down after 10 minutes of being idle, add these lines to <code>/etc/rc. All your shares in local</code>:<pre># power drives down after 10 minutes idle/sbin/varhdparm -S120 /hdadev/files are now on your new hard drivesda/sbin/hdparm -S120 /dev/sdb...</pre>
===Use the hard drive for only some shares===If you want only some of your shares to be Most drives will power down on your new hard drive, here's how to do thattheir own without doing this.
FirstOnce stopped, you'll need to move your shares data, if any, into your new the drive.<br/>[[Open Terminal may take as long as root|In 30 seconds to respond to a Terminalsubsequent disk access, as root]], type the following commandthough most drives are much quicker. Replace the path in red with The encoding of the path you received when you ran hda-diskmountS timeout value is somewhat peculiar. Replace '''something''' with A value of zero means "timeouts are disabled": the name 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 the share you want 30 minutes, yielding timeouts from 30 minutes to have on your new drive (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 share should already exists)value 254 is reserved.<div style="border: 1px solid #A3B1BF; padding: 255 is interpreted as 21 minutes plus 15 seconds.5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">mv /var/hda/files/<strong>something</strong> <strong style="color:red">/var/hda/files/ Note that some older drives/sdb1/</strong></div> may have very different interpretations of these values.
Repeat with every share It may make the system run cooler and power efficient (especially on a Home Server you want on your new driveare rarely using all of the pool drives at the same time).
Next, =Troubleshooting===hda-diskmount==If ''hda-diskmount'' does not mount the hard drive or you'll need prefer to make do it manually, complete the mount permanentfollowing steps:
Create the mount point (choose one '''NOT''' in use) [[Open Terminal as root|in a Terminal, as root]] by executing the following:<blockquote><div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">umount mkdir -p /var/hda/files/drives/sdb1drive1</div><br/blockquote>nano Identify the hard drive to mount and copy the UUID from the output that corresponds to the hard drive (i.e. sdb)<blockquote><div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> ls -l /dev/disk/etcby-uuid/fstab</div></blockquote>
In nano, you'll need to add a new line at the bottom:EXAMPLE: lrwxrwxrwx 1 root root 10 Dec 29 18:10 1b8597e0-5d95-4474-b093-53099c8c81c9 -> ../.. Take the line that hda/sda1 lrwxrwxrwx 1 root root 10 Dec 29 18:10 1c161033-c695-4291-aba1-diskmount gave you (the blue one), and change the first value only257d3987edf7 -> ../..<br/dm-0 lrwxrwxrwx 1 root root 10 Dec 29 18:10 b7017251-cb54-438b-92a3-781537c565e6 ->../../sdbInstead of lrwxrwxrwx 1 root root 10 Dec 29 18:10 c1fe62b3-41dc-4a67-8a6b-09f90b7893ba -> ../dev../sdb1, enter dm-1 lrwxrwxrwx 1 root root 10 Dec 29 18:10 e0f5a9bd-f52b-431e-89af-61da70659bdd -> ../../dm-2 lrwxrwxrwx 1 root root 10 Dec 29 18:10 <span style="color:#FF0000">'''UUID=547b073d-e591-4913-b4fb-7c5084353979''' followed by the UUID you found earlier</span> -> ../../sdb1
In nano, you:The UUID for sdX1 (i.e. sdb1 is <span style="color:#FF0000">'''RED'''ll need </span>).Add the following to add a new line at the bottomend of ''/etc/fstab'', replacing the UUID as captured in the previous step<blockquote><div style="border: 1px solid #A3B1BF; padding: . Take the line that hda5em 1em; background-diskmount gave you color: #E6F2FF; margin: 3px 3px 1em 3px;"> nano /etc/fstab</div></blockquote>:EXAMPLE: # # /etc/fstab # Created by anaconda on Sat Nov 9 01:46:39 2013 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(the blue one5), findfs(8), mount(8) and add it as/or blkid(8) for more info # UUID=1ebbf241-528c-465e-889f-acc15400dd8c / ext4 defaults 1 1 UUID=087b15a5-c3ca-4615-b6ee-bf5f399a803e /boot ext4 defaults 1 2 UUID=75346b8e-b162-458c-b0e9-a8d48ec2bc82 swap swap defaults 0 0 UUID=ad85eeb9-18f0-4b85-9bfa-isb88a5d1489b3 swap swap defaults 0 0 <span style="color:#0000FF">'''UUID=547b073d-e591-4913-b4fb-7c5084353979 /var/hda/files/drives/drive1 ext4 defaults 1 2'''</span>
hda-diskmount gave me:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"><strong style="color:blue">/dev/sdb1 The new entry will be mounted as ''/var/hda/files/drives/drive1'' (i.e. sdb1 ext4 defaults 1 2in '''</strongspan style="color:#0000FF">BLUE</divspan>''')
So I Mount the hard drive<blockquote><div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> mount -a</div></blockquote>:If all goes well, there should add this:not be any output. If there are errors, stop and diagnose the problem.
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: Accomplish [[Adding_Hard_Drives_101#E6F2FF; margin: 3px 3px 1em 3px;"><strong>UUID=9d972abc-1639-44df-a60e-668618d40236<Verify/strong> Test|Verify/var/hda/files/drives/sdb1 ext4 defaults 1 2Test]] step to ensure the hard drive is properly mounted.<br /div>
Save and exit nano (CTRL-X), and try your new mount:Repeat this process for each hard drive to be mounted.
<div style="border: 1px solid #A3B1BF; padding: =Partitions > 2.5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">1TB==If by following this tutorial you are unable to mount -a</divhard drives with partitions >2.1TB, refer to the [[Partitions_Over_2.1_TB|Partitions over 2.1TB]] guidance.
That=Help=If you need assistance, please post in the [https://forums.amahi.org Amahi Forums] or receive '''LIVE''s it' support on the [http://talk. Your share(s) are now on your new hard driveamahi.org Amahi IRC channel].
12,424

edits