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.
* This is an how[http://en.wikipedia.org/wiki/GUID_Partition_Table GUID-to on how to add additional partitioned] hard drives to your HDA.* Amahi cannot be held responsible for any data breakage or destruction arising from the use or misuse of this script. We provide it (such as those previously used in a service Mac or have GPT partition tables) are not supported in good will. You accept this automatically if you use the scripttutorial.* This page and script does not support GUID-partitioned drives. You can find what your partition is like with <code>fdisk -l</code>
=Make sure your drive * [http://en.wikipedia.org/wiki/GNU_nano nano] is detected by Fedora=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).
=Prerequisites=[[Open Terminal as root|In a Terminal, and type the following commandas root]], verify disk tools are installed by executing:<br />
Fedora<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;text-align: left">ls dnf -1 /dev/disk/byy install pmount fuse fuse-id/ | egrep libs ntfs-v "part|scsi"3g util-linux-ng parted nano
</div>
Look :'''NOTE:''' <code>yum</code> (deprecated) has been replaced with <code>dnf</code> as the package manager for the line that match the hard drive you addedFedora 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"> sudo apt-get -y install gparted</div>
IDE and SATA hard drives will start with :'''ata-NOTE:''' and USB hard Hard drives will start with must be formatted as '''MBR'usb-'' not '''.<brGUID/>Look GPT''' for your hard drive model and serial number''hda-diskmount'' to work correctly.
Example=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: #E6F2FF; margin: 3px 3px 1em 3px;"> ls -l /dev/disk/by-id/ > before.txt cat before.txt</div>
<div style="border: 1px solid #A3B1BF; paddingEXAMPLE: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">[gb@hda ~]$ ls - lrwxrwxrwx 1 /dev/disk/byroot root 9 2010-id/ | egrep 02-v "part|scsi"<br/>18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V<br-> ../>ata-ST31000528AS_6VP08W65<br../>sdaata lrwxrwxrwx 1 root root 10 2010-ST3750640A_3QD0LJN8<br/>ata02-ST3750640A_5QD27A57<br/>18 03:24 ata-WDC_WD10EADSHitachi_HDS722020ALA330_JK1131YAGDU37V-00L5B1_WDpart1 -WCAU4C700358<br/>usb-ST310003_33AS_9E1CA6FFFFFF-0:0<br../>usb-ST375064_0A_2009031309E2-0:0<../div>sda1
=Install prerequisites=Power ''OFF'' the HDA and install/connect any additional hard drive(s).<br />
[[Open Terminal as root|In =Identify=Power ''ON'' the HDA and collect data about the new hard drive configuration. Again, save this to a Terminal, as root]], type the following (two) commands: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; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left">yum ls -y install pmount fuse fusel /dev/disk/by-libs ntfs-3g gparted util-linux-ngid/ > after.txt cat after.txt
</div>
=Partition and format the hard drive=: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
This step is optional, :'''FYI:''' IDE/SATA hard drives will start with '''ata-''' and should only be executed if you want to delete the content of your new hard drive, or if the USB hard drive has not yet been formatteddrives will start with '''usb-'''.<br/>
You should (unless you have a good reason not to) use GParted =Partition/Format=Compare the difference between before.txt and after.txt to partition and format your determine the new hard drive.<br/>Not having X installed would qualify as a good reason! In such cases, either use SSH X11 Forwarding (Google that if you'd like to use thiss), or [[Adding_a_second_hard_drive_to_your_HDA#Using_cfdisk|use cfdisk]] from a [[Open Terminal as root|Terminal, as root]]device name. This can be done automatically.
You'll probably want to create a single partition, and format it [[Open Terminal as ''ext3''.<br/>Note that Windows can't read ext3 partitions, so if you want dual-boot Windows on your Amahi PC, or if you intend to connect this hard drive to root|In a Windows computer laterTerminal, you should format as NTFS insteadroot]], and you should do that on Windows before you connect execute the drive in your HDA.<br/>following:Remember that using NTFS partitions on Linux will be slower that using ext3 partitions, so you should only use NTFS if you really need it.<br/>How much slowerdiv style="border: 1px solid #A3B1BF; padding: compare the blue bars (NTFS.5em 1em; background-3G) with the red bars (ext3) on [httpcolor: #E6F2FF; margin://www 3px 3px 1em 3px;"> diff before.tuxeratxt after.comtxt</products/tuxera-ntfs-commercial/performance/ this graph].div>
To know what device (/dev/sdX) you need to partition and format, use the following command, in a [[Open Terminal as :EXAMPLE: lrwxrwxrwx 1 root|Terminal, as root]] 9 2010-02-18 03:24 ata-ST31000528AS_6VP08W65 -> ../../sdb
<div style="border: 1px solid 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#A3B1BF; padding: Mount|Mount]] step.5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">ls -l /dev/disk/by-id/</div>
Find ==Command-line (Fedora)==To partition the row corresponding to your hard drive(s), and look at the end of the line to identify the correct substitute sdX with hard drive device to use.name, such as ''sdb'':
Example[[Open Terminal as root|In a Terminal, as root]], execute the following:<blockquote><div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">[gb@hda ~]$ <strong>ls -l parted /dev/disk/by-id/sdX</strongdiv><br/blockquote>total Up to 2TB, at the ''(parted)'' prompt, enter:# mklabel msdos (answer ''yes'' if prompted)# mkpart primary 0% 100%# quit<br/>lrwxrwxrwx 1 root root 9 2010-02-18 03Greater than 2TB, at the ''(parted)'' prompt, enter:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V -> ../../sda# mklabel gpt (answer ''yes'' if prompted)# mkpart primary 0% 100%# quit<br/>lrwxrwxrwx 1 root root 10 2010Verify the new partition was created:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-02-18 03color: #E6F2FF; margin:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V-part1 -> ../../sda1<br/ 3px 3px 1em 3px;">lrwxrwxrwx 1 root root 9 2010ls -02-18 03:24 ata-ST31000528AS_6VP08W65 -> ..l /dev/..disk/<strong>sdb<by-id/strong>
</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>).
In Format the above examplepartition, /dev/sdb would be what I would select in GParted execute (or use on the cfdisk commandcan substitute ext3):<blockquote><div style="border: 1px solid #A3B1BF; padding: . sda in my primary hard drive, and sdb my second hard drive5em 1em; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> mkfs.ext4 -j /dev/sdX1</div></blockquote>
==Using GParted==From Repeat the HDA desktop (or using VNC), [[Open Terminal as rootAdding_a_second_hard_drive_to_your_HDA#Partition/Format|Partition/Format]] step for each hard drive to be partitioned and type '''gparted''' to launch the GParted applicationformatted.
Select ==GParted (Ubuntu)==From the device HDA desktop (/dev/sdXor using VNC) that you found above.<br/>, [[Open_Terminal_as_root|In a terminal as root]] and type '''gparted''' to launch the above example, /dev/sdb would be what I would select in GPartedapplication.
There are many easy to follow guides online Here's a general introduction on how to use GParted. You should Google for one, to find one that seems clear to you.<br/>[http://www.mepisguidesyoutube.com/Mepis-6/Install/gparted/gparted-set-partition.html Here's onewatch?v=vdWkdrnNGRg YouTube] that looks simple. Just use ''ext3 '' or ''ext4'' instead of ''fat32 in '' if you follow that tutorial.
==Using cfdisk==For drives > 2.0 TB, following these steps:* Choose hard disk in the dropdown menu (top right)From a [[Open Terminal as root|terminal, as root]], type * Select Device > Create Partition Table... > Advanced > (Choose 'gpt''cfdisk /dev/sdX''' to launch the cfdisk application.)* Create partition
Make sure to replace /dev/sdX with the actual device (eg. /dev/sdb) that you found above.
If your hard drive contains existing partitions, select them one by one at the top (using up:<b>NOTE:</down arrow keys), then select the '''b> [ Delete http://gparted.org GParted]''' action (using supports GUID-partitioned drives, however, the left/right arrow keys), then hit ENTERhda-mount script do not support currently.
You should now only have Free Space listed at Repeat the top.<br[[Adding_a_second_hard_drive_to_your_HDA#Partition/Format|Partition/>Select the '''[ New Format]]''' action, and accept the default (Primary, step for each hard drive to be partitioned and size)formatted.
You should now have a single partition listed at =Mount=Mount the top, of type Linux.<brhard drive(s)/>Select partition(s) for use in the '''[ Write ]''' action, then '''[ Quit ]'''HDA.
Now that :'''NOTE:''' If you partitioned your driveprefer not to use ''hda-diskmount'', you need refer to format your newly created partition[[Adding_a_second_hard_drive_to_your_HDA#hda-diskmount|Troubleshooting ''hda-diskmount]].<br/>To format as EXT3, use this command:
[[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;">mkfs.ext3 hda-j /dev/sdX1diskmount
</div>
Replace ext3 with ext4 :EXAMPLE: **************************************************************** Ignoring /dev/sda1 - already in the above command /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 format your partition as EXT4 instead of EXT3mount it every time you boot. 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 Mac partitions on non-removable disks have been mounted
The line in <span style="color:#0000FF">'''/dev/sdX1BLUE''' in the above command refers to the partition your created in cfdisk.<br/span>Go back in cfdisk, is what you need to copy and check add to the bottom of ''Name'/etc/fstab' column if you're unsure.<br/>If you see This is ''sdb1'REQUIRED' in the name column, you should use '''/dev/sdb1''' in for the above commandhard drive(s) to be permanently mounted.
=Mount the There will be multiple lines for multiple hard drive=(s) added. Ensure you copy and add '''ONLY''' those which were not present in the ''before.txt'' file.
A script is provided with Amahi that will look The new hard drive storage space can be used for unmounted partitions in your system[[Adding_a_second_hard_drive_to_your_HDA#All Shares|All Shares]], and mount any it finds[[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.
[[Open Terminal as root|In a Terminal, as root]], type ==All Shares==Host '''ALL''' shares on the following command:new hard drive.
Move all the shares data to the new drive, replacing path in '''<span style="color: red;">RED</span>''' with the path from the ''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; text-align: left;">[root@hda ~]$ hda-diskmount<br/><nowiki>****************************************************************</nowiki><br/>Ignoring /dev/sda1 - already in /etc/fstab or mounted<br/><nowiki>****************************************************************</nowiki><br/>Mounted /dev/<strong style="color:green">sdb1</strong> as '<strong style="color:red"> umount /var/hda/files/drives/sdb1</strong>' (read-write)<brdrive1/> You may want your system to mount it every time you boot.<br/> To do so, add this line VERY CAREFULLY to /etc/fstab and reboot:<br/> <strong style="color:blue">UUID=9d972abc-1639-44df-a60e-668618d40236 /var/hda/files/drives/sdb1 ext4 defaults 1 2</strong><br/><nowiki>****************************************************************</nowiki><br/>All Linux, Windows and Mac partitions on non-removable disks have been mounted<br/>
</div>
Mount the new hard drive permanently as ''/var/hda/files'' 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="color: blue;">BLUE</span>''' and change the second value (path) to ''/var/hda/files''.
 
:EXAMPLE hda-diskmount output (Original):
<span style="color: blue;">UUID=547b073d-e591-4913-b4fb-7c5084353979 <strong>/var/hda/files/drives/drive1</strong> ext4 defaults 1 2</span>
:EXAMPLE hda-diskmount output (Modified):
UUID=547b073d-e591-4913-b4fb-7c5084353979 <strong>/var/hda/files</strong> ext4 defaults 1 2
Do :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">'not''' edit UUID=547b073d-e591-4913-b4fb-7c5084353979 /var/etchda/fstab just yet. What youfiles ext4 defaults 1 2'''ll need to add there will depend on how you want to use </span>Finally, execute the extra storage. More about that belowfollowing:<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/<br/div>Just note down The last command will display contents of the information in bold (green, red and blue)new hard drive. We'll use them below All shares are now located on the new hard drive.
Note about ext4 in the blue line above: that doesn==Some Shares==Host '''SOME'''t necessarily mean your partition is formatted as ext4. It means shares on the ext4 driver will be used to mount your partition. Since that driver is backward compatible, it can be safely used to mount ext2, ext3 and ext4 partitionsnew hard drive.
If you get something like Move some shares data to the new drive by executing the following command (replace path in ''Disk /dev'<span style="color: red;">RED</dm-0 doesnspan>'t contain a valid partition table'' or with the path from the ''mount: unknown file system type hda-diskmount'lvm2pv'output line in <span style="color:#0000FF">'' its because you have LVM's that BLUE'fdisk' can not recognize (or something similar). It's nothing </span>; sharename will be the share to move to worry about if you get that when executing the hda-diskmount scriptnew 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;"> mv /var/hda/files/<strong>sharename</strong> <strong style=Test your hard drive=="color:red">/var/hda/files/drives/drive1/</strong>Optionally, you can test your new drive for bad blocks.<br/div>Note that this step can take a ''long'' time Repeat the process with every share to complete! You'll probably want be moved to start it in the evening, to have it completed in new drive. Unmount the morningnew 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/drive1</div>
To do soMount 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="color: blue;">BLUE</span>'''.:EXAMPLE /etc/fstab: # # /etc/fstab # Created by anaconda on Sat Nov 9 01:46:39 2013 # # Accessible filesystems, by reference, [[Open Terminal as root|in a Terminalare maintained under '/dev/disk' # See man pages fstab(5), as root]]findfs(8), type the following command. Replace 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 <strong span style="color:green#0000FF">sdb1'''UUID=547b073d-e591-4913-b4fb-7c5084353979 /var/hda/files/drives/drive1 ext4 defaults 1 2'''</strongspan> with Verify the hard drive(greens) value you received from hda-diskmount/partition(s) configuration is correct in ''/etc/fstab''.
Next, execute the following:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
e2fsck mount -cn a ls /devvar/<strong style="color:green">sdb1<hda/strong>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.
You'll receive a warning that says "WARNING!!! Running e2fsck on a mounted filesystem may cause SEVERE filesystem damage. Do you really want to continue (y''<u>HDA Dashboard Update</n)?"u><br/>'''Answer The location of each share that was moved to the new hard drive will need updated. Select ''Setup''yesfollowed by the ''Shares'' section. The -cn option we're using can safely be used on mounted filesystemsExpand each share that was moved individually and change the location (path) accordingly.
For example, the original movies location was <span style=Use "color:red">/var/hda/files/movies</span> but the hard drivenew location might be <span style="color:blue">/var/hda/files/drives/drive1/movies</span>.
You Repeat for any other shares that you have a choice here on how moved to use your the new hard drive storage space. We'll offer some examplesVerify these shares are accessible from another machine within your network.
==Use '''NOTE:''' If any services depend on the hard drive 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 all shares==a specific share location during the service start up.
If you want all your shares to be on your ==Greyhole Storage Pool==Use new hard drive, here's how to do thatfor [[Storage_pooling|Greyhole Storage Pool]].
First, you'll want to move all you previous shares data, if any, into your new drive.<br/>You only need to do this next command if you have data that you care about in the /var/hda/files/* folders.<br/>[[Open Terminal as root|In a Terminal, as root]], type mount the following command. Replace the path in red with the path you received when you ran hda-diskmount.new hard drive permanently by editing ''/etc/fstab'':<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">mv /var nano /hdaetc/files/* <strong style="color:red">/var/hda/files/drives/sdb1/</strong>fstab
</div>
YouAdd the line to ''/etc/fstab'' provided in the ''hda-diskmount'' output in '''ll get a warning about <span style="color: blue;"cannot move `>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' to a subdirectory of itself"; that ''</span>Verify the hard drive(s)/partition(s) configuration is fine, ignore thatcorrect in ''/etc/fstab''.
Next, you'll need Refer to unmount your new hard drive, and remount it as /var/hda/files[[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=Verify the hard drive/partition is mounted. [[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;">umount /var/hda/files/drives/sdb1/ df -h
</div>
<div style="border: 1px solid #A3B1BF; paddingEXAMPLE: Filesystem Size Used Avail Use% Mounted on /dev/sda5 16G 4.5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">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% /tmpnano /dev/etcsda1 190M 75M 102M 43% /fstabboot< /dev/sdb1 917G 398G 473G 46% /var/hda/files/drives/div>drive1
In nano, you'll need to add a new line at the bottom. Take the line that hda-diskmount gave you The hard drive(the blue ones), and change the second value mount point (the path)should be listed for each hard drive added. If not, then further investigation will be needed to determine the problem.<br/>Replace the second value with '''/var/hda/files'''.
hda-diskmount gave me:=Tips=<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"><span style="color:blue">UUIDMount Order==9d972abc-1639-44df-a60e-668618d40236 <strong>/var/hda/files/The following guide will outline how to manually order hard drives/sdb1</strong> ext4 defaults 1 2</span></div>and mount them automatically on boot.
So I should add this instead[[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;">
UUID=9d972abc-1639-44df-a60e-668618d40236 <strong>/var/hda/files</strong> ext4 defaults 1 2 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"
Make sure you do '''not''' change anything else from In this case, there are four data drives (sda1, sdb1, sdc1, sdd1) and the blue line you received from hda-diskmount.<br/>It might not be the same thing as the above example; you need Operating system assigned to use the values you've receiveda fifth drive, sde.
Save Take note of the UUID's for each drive. Easiest to cut and exit nano (CTRL-X, Y, ENTER), and try your new mount: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;">
mount -a<br nano />ls /var/hda/filesetc/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.
That last command should show you the content of you new hard drive.:EXAMPLE: UUID=55d9333f-d801-425a-b2af-d65c5966d56f /var/hda/files/drives/drive1 ext4 defaults 1 2
That's it. All your shares It should look something like the following when lines are added for each of the five drives in /var/hda/files are now on your new hard drivethis 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=Use the hard drive for only some shares8d881dcb-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 # #
If you want only some :'''NOTE:''' Lines beginning with # are comments where the remainder of your shares to be on your new hard drive, here's how to do that.the line is ignored
First, you'll want to move your previous shares data, if any, into your new drive.<br/>You only need to do this next command if you have data that you care about in the /var/hda/files/* folders (that you want on the new drive).<br/>[[Open Terminal as root|In a Terminal, as root]], type Verify there are no issues by executing the following command. Replace the path in red with the path you received when you ran hda-diskmount. Replace '''something''' with the name of the share you want to have on your new drive (the share should already exists).:
<div style="border: 1px solid #A3B1BF; padding: .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/drives/sdb1/</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!
Repeat with every share you want on your new drive. NextOnce there are no errors, you'll need to make the mount permanentreboot machine:
<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<br/>nano /etc/fstab reboot
</div>
Verify the hard drives have successfully mounted in the '''HDA Dashboard'''.
In nanoIf all drives mounted successfully, you'll need to add a new line at the bottom. Take the line that hda-diskmount gave you, and insert that.<br/>it should look something like this (Ubuntu):
So, following previous examples, I should add this:EXAMPLE:[[File:Gstreet_greyhole_pool.png|options|caption]]
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left;"><span style="color: blue;">UUIDBad Blocks==9d972abc-1639-44df-a60e-668618d40236 /var/hda/files/drives/sdb1 ext4 defaults 1 2</span>Optionally, you can test your new drive for bad blocks.<br/div>
Save and exit nano (CTRL-X, Y, ENTER), 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 -a<brcn />ls /var/hda/files/drivesdev/'''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.
That last command should show you the content of you new hard drive.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. Your share(s) are now on your new hard drivelocal</code>:<pre># power drives down after 10 minutes idle/sbin/hdparm -S120 /dev/sda/sbin/hdparm -S120 /dev/sdb...</pre>
==Use the hard drive in your Greyhole storage pool==Most drives will power down on their own without doing this.
If you want 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 add your new hard drive 20 minutes. Values from 241 to 251 specify from 1 to your Greyhole storage pool11 units of 30 minutes, here's how yielding timeouts from 30 minutes to do 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 thatsome older drives may have very different interpretations of these values.
First, you'll need to It may make the mount permanent. [[Open Terminal as root|In system run cooler and power efficient (especially on a Terminal, as root]], type Home Server you are rarely using all of the following command:pool drives at the same time).
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; backgroundTroubleshooting===hda-color: #E6F2FF; margin: 3px 3px 1em 3px;">diskmount==umount /var/If ''hda/files/drives/sdb1<br/>nano /etc/fstab</div>-diskmount'' does not mount the hard drive or you prefer to do it manually, complete the following steps:
In nano, youCreate the mount point (choose one '''NOT'''ll need to add in use) [[Open Terminal as root|in a new line at Terminal, as root]] by executing the bottomfollowing:<blockquote><div style="border: 1px solid #A3B1BF; padding: . Take 5em 1em; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> mkdir -p /var/hda/files/drives/drive1</div></blockquote>Identify the line that hda-diskmount gave you, hard drive to mount and insert copy the UUID from the output thatcorresponds 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/by-uuid/</div><br/blockquote>
So, following previous examples, I should add this:EXAMPLE: lrwxrwxrwx 1 root root 10 Dec 29 18:10 1b8597e0-5d95-4474-b093-53099c8c81c9 -> ../../sda1 lrwxrwxrwx 1 root root 10 Dec 29 18:10 1c161033-c695-4291-aba1-257d3987edf7 -> ../../dm-0 lrwxrwxrwx 1 root root 10 Dec 29 18:10 b7017251-cb54-438b-92a3-781537c565e6 -> ../../sdb lrwxrwxrwx 1 root root 10 Dec 29 18:10 c1fe62b3-41dc-4a67-8a6b-09f90b7893ba -> ../../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">'''547b073d-e591-4913-b4fb-7c5084353979'''</span> -> ../../sdb1
:The UUID for sdX1 (i.e. sdb1 is <span style="color:#FF0000">'''RED'''</span>).Add the following to the end of ''/etc/fstab'', replacing the UUID as captured in the previous step<blockquote><div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left;"> 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(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: blue;#0000FF">'''UUID=9d972abc547b073d-1639e591-44df4913-a60eb4fb-668618d40236 7c5084353979 /var/hda/files/drives/sdb1 drive1 ext4 defaults 1 2'''</span></div>
Save and exit nano :The new entry will be mounted as ''/var/hda/files/drives/drive1'' (CTRL-X, Y, ENTERi.e. sdb1 in '''<span style="color:#0000FF">BLUE</span>'''), and try your new mount:
Mount the hard drive<blockquote><div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> mount -a</div></blockquote>:If all goes well, there should not be any output. If there are errors, stop and diagnose the problem.
Finally, you'll need to configure Greyhole to select your new partition. To configure Greyhole, Advanced Settings must be enabled under Accomplish [[http:Adding_Hard_Drives_101#Verify/Test|Verify/hda/setup?sub=settings&tab=setting Setup &gt; SettingsTest]]step to ensure the hard drive is properly mounted.<br />
In the [http://hda/setup?sub=disk_pooling&tab=share Shares &gt; Storage Pool page] of your Amahi dashboard, you'll see a list of mounted partitions, with checkboxes next to Repeat this process for each, allowing you hard drive to include those partitions in your storage poolbe mounted.
You should now have a new row in there, referring ==Partitions > 2.1TB==If by following this tutorial you are unable to /var/hda/files/mount hard drives/sdb1with partitions > 2.<br/>Select it (click 1TB, refer to the checkbox)[[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 itsupport on the [http://talk.amahi. Your new hard drive just increased your Greyhole storage pool capacityorg Amahi IRC channel].
12,424

edits