Changes

From Amahi Wiki
Jump to: navigation, search
<center>{{MessageBox|
backgroundcolor = #faa|
image =Warning.png|
heading =WARNING|
message = This is recommended only for advanced ''Advanced'' users, proceed with caution.}}</center>[[Adding_drives_to_your_HDA|Adding drives to your HDA]] is another <div style="how toborder: 1px solid #A3B1BF; padding: .8em 1em; background-color: #E6F2FF; margin: 0px 1em;" on doing this, a bit shorter and less elaborate, which can be good for some people, specially a novice unfamiliar with doing any of this.>
More hard drives can be added in your '''NOTE:''' The Amahi HDA for additional storage space[https://www.amahi.org/apps/disk-wizard Disk Wizard] application (Amahi 8 or greater '''ONLY''') provides this capability from the Dashboard UI.
We'll detail how to add such hard drives, and how to put them to good use.
 
=Important Notes=
 
* This is a how-to on adding additional 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 as a service in good will. You accept this automatically if you use the script.
* This page and script does not support GUID-partitioned drives (such as drives previously in a Mac or have GPT partition tables). You can find what your partition is like with <code>fdisk -l</code>
 
=Ensure drive is detected by OS =
 
Open a Terminal or remotely connect (ssh, ...) to the OS, and type the following command:
 
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color: #E6F2FF; margin: 0 1em;">
ls -1 /dev/disk/by-id/ | egrep -v "part|scsi"
</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.
Look for In order to keep this process simple, it's important '''NOT''' to connect additional hard drive(s) until the line that matches end of the hard drive you added[[Adding_a_second_hard_drive_to_your_HDA#Preparation|Preparation]] step.
IDE and SATA hard drives =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 start with '''ata-''' and USB hard drives will start with '''usb-'''.<br/>Look for your hard drive model and serial numberYou accept this automatically if you use the script.
Example* [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.
<div style="border: 1px solid #A3B1BF; padding* [http: //en.wikipedia.5em 1em; color: #000; backgroundorg/wiki/GNU_nano nano] is used as the command-colorline text editor (refer to [http: #E6F2FF; margin: 3px 3px 1em 3px;"> [gb@hda ~]$ ls -1 /dev/diskwww.howtogeek.com/howto/by-id42980/ | egrep -v "part|scsi" atathe-Hitachi_HDS722020ALA330_JK1131YAGDU37V atabeginners-ST31000528AS_6VP08W65 ataguide-ST3750640A_3QD0LJN8 atato-ST3750640A_5QD27A57 atanano-WDC_WD10EADSthe-00L5B1_WDlinux-WCAU4C700358 usbcommand-ST310003_33AS_9E1CA6FFFFFF-0:0 usbline-ST375064_0A_2009031309E2text-0:0<editor/div>beginners guide to nano] as needed).
=Prerequisites=
[[Open Terminal as root|In a Terminal, as root]], verify disk tools are installed by executing:<br />
[[Open Terminal as root|In a Terminal, as root]], type the following (two) commands: * 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 gparted util-linux-ngparted 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">
sudo apt-get -y install gparted
</div>
Drives :'''NOTE:''' Hard drives must be formatted as '''MBR''' not '''GUID/GPT''' for ''hda-diskmount '' to recognize the diskwork correctly.
=Partition and Format Hard DrivePreparation=[[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>
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:EXAMPLE: lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V -> ../You should (unless you have a good reason not to) use GParted to partition and format your hard drive.<br/>sdaNot 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 this), or [[Adding_a_second_hard_drive_to_your_HDA#Using_cfdisk|use cfdisk]] from a [[Open Terminal as lrwxrwxrwx 1 root|Terminal, as root]]10 2010-02-18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V-part1 -> ../../sda1
YouPower 'll probably want to create a single partition, and format it as 'OFF'ext3''.<brthe HDA and install/>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 any additional hard drive to a Windows computer later, you should format as NTFS instead, and you should do that on Windows before you connect the drive in your HDA(s).<br/>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 slower: compare the blue bars (NTFS-3G) with the red bars (ext3) on [http://www.tuxera.com/products/tuxera-ntfs-commercial/performance/ this graph].
To know what device (/dev/sdX) you need to partition =Identify=Power ''ON'' the HDA and format, use collect data about the following commandnew hard drive configuration. Again, in save this to a [[Open Terminal as root|Terminal, as root]]: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;"> ls -l /dev/disk/by-id/> after.txt cat after.txt
</div>
Find the row corresponding to your hard drive, and look at the end of the line to identify the correct device to use. Example:<div style="borderEXAMPLE: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"><small> [gb@hda ~]$ ls -l /dev/disk/by-id/ total 0
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
</small>
</div>
In the above example, :'''FYI:''' IDE/dev/sdb would be what I would select in GParted (or use on the cfdisk command). sda in my primary SATA hard drive, drives will start with '''ata-''' and sdb my second USB hard drivedrives will start with '''usb-'''.<br/>
==Using GParted=Partition/Format=From Compare the HDA desktop (or using VNC), [[Open Terminal as root]] difference between before.txt and type '''gparted''' after.txt to launch determine the GParted applicationnew hard drive(s) device name. This can be done automatically.
Select [[Open Terminal as root|In a Terminal, as root]], execute the device (following:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> diff before.txt after.txt</dev/sdX) that you found above.div>
In the above example, :EXAMPLE: lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-ST31000528AS_6VP08W65 -> ../dev../sdb would be what I would select in GParted.
There At this point, partition and format the hard drive(s) if they are many easy new. For hard drive(s) that contain data to follow guides online on how to use GParted. You should Google for onebe preserved, skip to find one that seems clear to youthe [[Adding_a_second_hard_drive_to_your_HDA#Mount|Mount]] step.
Here==Command-line (Fedora)==To partition the hard drive(s), substitute sdX with hard drive device name, such as ''sdb''s a general introduction on [http://www.youtube.com/watch?v=vdWkdrnNGRg YouTube]. Just use ext3 or ext4 instead of fat32 in you follow that tutorial.
If you have [[Open Terminal as root|In a drive > 2.0 TBTerminal, there is an in-depth guide below (that may be outdated). Insteadas root]], it is possible to use GParted with execute the following steps:* select the correct drive in the dropdown on the top right of GParted* click Device <blockquote> Create Partition Table..<div style="border: 1px solid #A3B1BF; padding: . 5em 1em; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> parted /dev/sdX</div> Advanced </blockquote> Up to 2TB, at the ''(parted)'' prompt, enter:# mklabel msdos (Choose answer ''yes'gpt'if prompted)* then create your partition as normally instructed# mkpart primary 0% 100%# quit** I use <br /ext4>** add an appropriate labelGreater than 2TB, at the ''(parted)'' prompt, enter:# mklabel gpt (answer ''yes'' if prompted)# mkpart primary 0% 100%# quit<bbr />NOTEVerify 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-id/</bdiv> :EXAMPLE: lrwxrwxrwx 1 root root 9 2010-02-18 03:24 GParted supports GUIData-partitioned drives, however, these directions and script do not support it at the momentHitachi_HDS722020ALA330_JK1131YAGDU37V -> ../../sda lrwxrwxrwx 1 root root 10 2010-02-18 03:24 ata-Hitachi_HDS722020ALA330_JK1131YAGDU37V-part1 -> ../../sda1==Using cfdisk==From a [[Open Terminal as lrwxrwxrwx 1 root|terminal, as root]], type 9 2010-02-18 03:24 ata-ST31000528AS_6VP08W65 -> ../../sdb <span style="color:#FF0000">'''cfdisk lrwxrwxrwx 1 root root 9 2010-02-18 03:24 ata-ST31000528AS_6VP08W65-part1 -> ../dev../sdXsdb1''' to launch the cfdisk application. If you have a GUID-partitioned drive, cfdisk will complain. GUID partitions are not supported.</span>
Make sure to replace /dev/sdX with the actual device The new partition is named sdX1 (egi.e. sdb1 in <span style="color:#FF0000">'''RED'''</dev/sdbspan>) that you found above.
If your hard drive contains existing partitions, select them one by one at Format the top (using up/down arrow keys)partition, then select the '''[ Delete ]''' action execute (using the left/right arrow keyscan substitute ext3), then hit ENTER:<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>
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 ==GParted (Ubuntu)==From the topHDA desktop (or using VNC), of type Linux.<br/>Select the '''[ Write [Open_Terminal_as_root|In a terminal as root]] and type ''' action, then '''[ Quit ]gparted'''to launch the application.
Now that you partitioned your drive, you need to format your newly created partitionHere's a general introduction on [http://www.youtube.<brcom/>To format as EXT3, watch?v=vdWkdrnNGRg YouTube]. Just use this command:''ext3'' or ''ext4'' instead of ''fat32'' if you follow that tutorial.
<div style="border: 1px solid #A3B1BF; padding: For drives > 2.5em 1em; color0 TB, following these steps: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"* Choose hard disk in the dropdown menu (top right)* Select Device > mkfsCreate Partition Table...ext3 -j /dev/sdX1> Advanced > (Choose 'gpt')</div>* Create partition
Replace ext3 with ext4 in the above command to format your partition as EXT4 instead of EXT3.
'''/dev/sdX1''' in the above command refers to the partition your created in cfdisk.:<br/b>Go back in cfdisk, and check the ''Name'' column if you're unsure.NOTE:<br/b>If you see ''sdb1'' in the name column, you should use ''' [http:/dev/sdb1''' in gparted.org GParted] supports GUID-partitioned drives, however, the above commandhda-mount script do not support currently.
==Partition over 2.1TB==Repeat the [[Partitions_Over_2.1_TBAdding_a_second_hard_drive_to_your_HDA#Partition/Format|Here is a work aroundPartition/Format]] step for drives with partitions over 2.1TB like the new 3 & 4TB TB driveseach hard drive to be partitioned and formatted.
=Mount Hard Drive= ==Using hda-diskmount script==A script is provided with Amahi that will look Mount the hard drive(s)/partition(s) for unmounted partitions use in your system, and mount any it findsthe HDA.
:'''NOTE:''' If you prefer not to use ''hda-diskmount'', refer to [[Open Terminal as rootAdding_a_second_hard_drive_to_your_HDA#hda-diskmount|In a Terminal, as rootTroubleshooting ''hda-diskmount]], type the following 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;">
hda-diskmount
</div>
Example:<div style="borderEXAMPLE: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left;"><small> [root@hda ~]$ hda-diskmount
****************************************************************
Ignoring /dev/sda1 - already in /etc/fstab or mounted
****************************************************************
Mounted /dev/<strong style="color:green">sdb1</strong> as '<strong style="color:red">/var/hda/files/drives/sdb1drive1</strong>' (read-write)
You may want your system to mount it every time you boot.
To do so, add this line VERY CAREFULLY to /etc/fstab and reboot:
<strong style="color:blue">UUID=9d972abc547b073d-1639e591-44df4913-a60eb4fb-668618d40236 7c5084353979 /var/hda/files/drives/sdb1 drive1 ext4 defaults 1 2</strong>
****************************************************************
All Linux, Windows and Mac partitions on non-removable disks have been mounted
</small>
</div>
Do The line in <span style="color:#0000FF">'''notBLUE''' edit </etc/fstab just yet. What span> is what you'll need to copy and add there will depend on how you want to use the extra storagebottom of ''/etc/fstab''. More about that below.<br/>Just note down This is '''REQUIRED''' for the information in bold hard drive(green, red and blues). We'll use them belowto be permanently mounted.
Note about ext4 There will be multiple lines for multiple hard drive(s) added. Ensure you copy and add '''ONLY''' those which were not present in the blue line above: that doesn't necessarily mean your partition is formatted as ext4'before. It means 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 partitionstxt'' file.
If you get something like ''Disk /dev/dm-0 doesn't contain a valid partition table'' or ''mount: unknown file system type 'lvm2pv''' its because you have LVM's that 'fdisk' The new hard drive storage space can not recognize (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 something similar)the [[Adding_a_second_hard_drive_to_your_HDA#Greyhole Storage Pool|Greyhole Storage Pool]]. It's nothing to worry about if you get that when executing Follow the hda-diskmount scriptguidance below based on desired usage for each hard drive.
If hda-diskmount does not recognize your new drive and you are trying to add a GPT partitioned 2+TB drive, you may need to edit your hda-diskmount script. You can a fix for this issue at this [https://forums.amahi.org/viewtopic.php?f=15&t=2326&pAll Shares==11617 forum thread]Host '''ALL''' shares on the new hard drive.
Failure Move all the shares data to recognize GPT the new drive:, replacing path in '''<div span style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: leftred;">RED<small/span> [root@hda ~]$ ''' with the path from the ''hda-diskmount **************************************************************** Ignoring /dev/sdf1 - already mounted Ignoring /dev/sdf1 - already '' output line in /etc/fstab as UUID<span style=b8c125e3-4199-4b56-a566-397fdd8bab8a **************************************************************** No usable Linux, Windows or Mac partitions found on your disks."color:#0000FF">'''BLUE'''</smallspan>.<br /div>
Example fix to /usr/sbin/hda-dismount[[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; text-align: left;"><small> # Now for the real work drivesntfs=`fdisk -l 2> mv /devvar/null | grep -i 'ntfs' | awk -F '/| ' '{print $3}'` drivesfat=`fdisk -l 2> hda/dev/null | grep -i 'fat32' | awk -F 'files/| ' '{print $3}'` driveshfs=`fdisk -l 2> /dev/null | grep -i 'HFS' | awk -F '/| ' '{print $3}'` drivesext=`fdisk -l 2> /dev/null | * <strong style="color:red">egrep -iw 'Linux|GPT'</strong> | egrep -v 'swap|LVM' | awk -F 'var/hda/files/drives/drive1/| ' '{print $3}'`</smallstrong>
</div>
If you have changed the order :'''NOTE:''' There may be a '''WARNING''' that can be ignored indicating ''/var/hda/files/drives cannot be moved to a subdirectory of your installed hard drives, hda-diskmount may return the following message: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;">
Ignoring umount /devvar/sda1 - already in /etc/fstab as hda/devfiles/sda1This device appears to be commented out of your drives/etcdrive1/fstab. You will need to remove it from there for hda-diskmount to be able to mount it.
</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''.
This might occur if you have made changes to the drive configuration order after you installed Amahi. :EXAMPLE hda-diskmount output (Original): If you want to stay with the reconfigured drive order, instructions on how to fix this are in the next section, Manually setting up the disk mount order.<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
: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=Setup Disk Mount Order"color:#0000FF">'''UUID=547b073d-e591-4913-b4fb-7c5084353979 /var/hda/files ext4 defaults 1 2'''</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 following last command will outline how to manually order your disks and mount drives automatically display contents of the new hard drive. All shares are now located on bootthe new hard drive.
1. First, get the UUID for each drive by opening a terminal and entering command  Ubuntu:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"><pre>gstreet@gstreet-MicroServer:~$ sudo blkid[sudo] password for gstreet:/dev/sda1: LABEL="Seagate-Alpha2TB" UUIDSome Shares="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"</pre></div> In this case, Host '''SOME''' shares on the user has four data drives (sda1, sdb1, sdc1, sdd1) and the Operating system assigned to a fifth new hard drive, sdeTake note of the UUID's for each drive. Easiest to cut and paste UUID's straight from the terminal - no typo's!
2. Then edit /etc/fstab Move some shares data to mount each the new drive - for novices, easiest to do this using a graphical editor. You might consider first making a copy called fstab.bak by executing the following command (use replace path in '''<span style="color: red;">RED</span>''' with the path from the ''hda-diskmount'' output line in <span style="save ascolor:#0000FF" command, close file and then gedit >'''BLUE'''</span>; sharename will be the share to move to the original fstab againnew drive) so that you can recover the original fstab file if you make mistakes.<br />
Ubuntu[[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;">
sudo gedit mv /etcvar/fstabhda/files/<strong>sharename</strong> <strong style="color:red">/var/hda/files/drives/drive1/</strong>
</div>
Repeat the process with every share to be moved to the new drive.
3. Then '''very carefully''' add Unmount the following line for each disk into the end of the fstab file. Make sure you paste in the right UUID, drive number and new hard drive file system (ext4 in this case). :
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
UUID=55d9333f-d801-425a-b2af-d65c5966d56f umount /var/hda/files/drives/drive1 ext4 defaults 1 2
</div>
It should look something like Mount the following when lines are added for each of the five drives in this example. Note lines beginning with # are comments where the remainder of the line is ignored) 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;"> # Mounting Greyhole Drives for Drive Pool. # # Drive1 = Seagate-Alpha2TB in Microserver Bay 1 from left UUID=55d9333f-d801-425a-b2af-d65c5966d56f nano /varetc/hdafstab</filesdiv>Add the line to ''/drivesetc/drive1 ext4 defaults 1 2 # # Drive2 = Seagate-Beta2TB fstab'' provided in Microserver Bay 2 from left UUID=5bd5498f-30c1-4780-948e-ca46656507d2 /var/the ''hda/files/drives/drive2 ext4 defaults 1 2 # # Drive3 = WD-Charlie2TB diskmount'' output in Microserver Bay 3 from left UUID'''<span style=a7337504-376a-4d36-9f7a-1a24c0f55fbd "color: blue;">BLUE</var/hda/files/drives/drive3 ext4 defaults 1 2span>'''. # # Drive4 = WD-Delta2TB in Microserver Bay 4 from left UUID=8d881dcb-8de3-4621-b9bd-00025196868a :EXAMPLE /varetc/hda/files/drives/drive4 ext4 defaults 1 2fstab:
#
# Drive5 = 250GB OS Drive mounted in Optical Drive bay/etc/fstab UUID="4d6f8004-d190-4234-a03b-b68de988abf0 /var/hda/files/drives/drive5 ext4 defaults 1 2# 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'''</divspan>Verify the hard drive(s)/partition(s) configuration is correct in ''/etc/fstab''.
Save Next, execute the file and quit the editor. To see if that will work at boot time, try withfollowing:
<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.
If '''<u>HDA Dashboard Update</u><br />'''The location of each share that gives you errors, there is a good chance was moved to the new hard drive will need updated. Select ''Setup'' followed by the ''Shares'' section. Expand each share that this line was not added properly and your machine may not reboot moved individually and get stuck mounting change the drives!location (path) accordingly.
Note that For example, the original movies location was <span style="color:red">/var/hda-diskmount command had already added lines to mount my OS drive which had two partitions (root or /, and home). Save file and closefiles/movies</span> but the new location might be <span style="color:blue">/var/hda/files/drives/drive1/movies</span>.
4) Save file and reboot Repeat for any other shares that you have moved to the new hard drive. Verify these shares are accessible from another machinewithin your network.
5) Check '''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 drives have successfully mounted in Amahi hda (Setup - Shares - Storage Pool)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 this case, if all drives mounted successfully, it should look like:==Greyhole Storage Pool==Use new hard drive for [[Storage_pooling|Greyhole Storage Pool]].
[[File:Gstreet_greyhole_pool.pngOpen Terminal as root|options|captionIn 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="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''.
==Test your hard drive==Optionally, you can test your new drive Refer to [[Greyhole#Amahi 6|Greyhole (Amahi 6)]] for bad blocks.<br/>Note that this step can take a ''long'' time to complete! You'll probably want to start it in the evening, Ubuntu or [[Greyhole#Amahi 7|Greyhole (Amahi 7)]] for Fedora to have it completed in configure the morning[[Storage_pooling|Greyhole Storage Pool]].
To do so, [[Open Terminal as root|in a Terminal, as root]], type the following command. Replace <strong style="color:green">sdb1<Verify/strong> with Test=Verify the (green) value you received from hda-diskmounthard 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;">e2fsck df -cn /dev/<strong style="color:green">sdb1</strong>h
</div>
You'll receive a warning that says "WARNING!!! :EXAMPLE: Filesystem Size Running e2fsck Used Avail Use% Mounted on a mounted filesystem may cause SEVERE filesystem damage /dev/sda5 16G 4. Do you really want to continue (y3G 11G 30% /n)?"<br devtmpfs 493M 0 493M 0% />devAnswer ''yes''. The -cn option we're using can safely be used on mounted filesystems. tmpfs 498M 84K 498M 1% /dev/shm tmpfs 498M 364K 498M 1% /run=Use Hard Drive= tmpfs 498M 0 498M 0% /sys/fs/cgroup tmpfs 498M 1.1M 497M 1% /tmp /dev/sda1 190M 75M 102M 43% /bootYou have a choice here on how to use your new hard drive storage space. We'll offer some examples. /dev/sdb1 917G 398G 473G 46% /var/hda/files/drives/drive1
==All shares==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 />
If you want all your shares =Tips===Mount Order==The following guide will outline how to be manually order hard drives and mount them automatically on your new hard drive, here's how to do thatboot.
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 executing the following command. Replace to obtain the path in red with the path you received when you ran hda-diskmount.UUID for each hard drive:
<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>blkid
</div>
You'll get a warning about :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="cannot move `8d881dcb-8de3-4621-b9bd-00025196868a" TYPE="ext4" /vardev/hdasde1: LABEL="root" UUID="4d6f8004-d190-4234-a03b-b68de988abf0" TYPE="ext4" /filesdev/drives' to a subdirectory of itselfsde3: LABEL="home" UUID="d0531fa1-9311-4d53-b838-f35898adbd98" TYPE="ext4" /dev/sde5: LABEL="swap" UUID="3c39206c-ba60-47ff-a1fe-f5821b2ab543" TYPE="swap"; that is fine, ignore that.
NextIn this case, you'll need there are four data drives (sda1, sdb1, sdc1, sdd1) and the Operating system assigned to unmount your new hard a fifth drive, and remount it as /var/hda/filessde.
<div style="border: 1px solid #A3B1BF; padding: Take note of the UUID's for each drive.5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> umount /var/hda/files/drives/sdb1/</div>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.
In nano, you'll need to add a new line at the bottom. Take the line that hda:EXAMPLE: UUID=55d9333f-d801-425a-b2af-diskmount gave you (the blue one), and change the second value (the path).<br/>Replace the second value with '''d65c5966d56f /var/hda/files'''./drives/drive1 ext4 defaults 1 2
hda-diskmount gave me:<div style="border: 1px solid #A3B1BF; padding: It should look something like the following when lines are added for each of the five drives in this example.5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> <span style="color:blue">UUID=9d972abc-1639-44df-a60e-668618d40236 <strong>/var/hda/files/drives/sdb1</strong> ext4 defaults 1 2</span></div>
So I should add this instead: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<div style # # Drive2 ="border: 1px solid Seagate-Beta2TB in Microserver Bay 2 from left UUID=5bd5498f-30c1-4780-948e-ca46656507d2 /var/hda/files/drives/drive2 ext4 defaults 1 2 #A3B1BF; padding: .5em 1em; color: #000; backgroundDrive3 = WD-color: Charlie2TB in Microserver Bay 3 from left UUID=a7337504-376a-4d36-9f7a-1a24c0f55fbd /var/hda/files/drives/drive3 ext4 defaults 1 2 # #E6F2FF; margin: 3px 3px 1em 3px;">Drive4 = WD-Delta2TB in Microserver Bay 4 from left UUID=9d972abc8d881dcb-16398de3-44df4621-a60eb9bd-668618d40236 <strong>00025196868a /var/hda/files</strong> drives/drive4 ext4 defaults 1 2< # # Drive5 = 250GB OS Drive mounted in Optical Drive bay UUID="4d6f8004-d190-4234-a03b-b68de988abf0 /var/div>hda/files/drives/drive5 ext4 defaults 1 2 # #
Make sure you do :'''notNOTE:''' change anything else from Lines beginning with # are comments where the remainder of the blue line you received from hda-diskmount.<br/>It might not be the same thing as the above example; you need to use the values you've received. Save and exit nano (CTRL-X, Y, ENTER), and try your new mount: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;">
mount -a
ls /var/hda/files/
</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!
That last command should show you the content of you new hard drive. That's it. All your shares in /var/hda/files Once there are now on your new hard drive. ==Some Shares== If you want only some of your shares to be on your new hard driveno errors, here's how to do that. 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 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 exist).reboot machine:
<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>reboot
</div>
Verify the hard drives have successfully mounted in the '''HDA Dashboard'''.
Repeat with every share you want on your new drive.If all drives mounted successfully, it should look something like this (Ubuntu):
Next, you'll need to make the mount permanent:EXAMPLE:[[File:Gstreet_greyhole_pool.png|options|caption]]
<div style="border: 1px solid #A3B1BF; padding: =Bad Blocks==Optionally, you can test your new drive for bad blocks.5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> umount /var/hda/files/drives/sdb1<br/> nano /etc/fstab</div>
In nano, you:'''NOTE:''' This can take a ''long''ll need time to add a new line at complete! Recommend starting it in the bottom. Take evening so it will be completed the line that hda-diskmount gave you, and insert that.<br/> So, following previous examples, I should add this: <div style="border: 1px solid #A3B1BF; padding: next day.5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left;"> <span style="color: blue;">UUID=9d972abc-1639-44df-a60e-668618d40236 /var/hda/files/drives/sdb1 ext4 defaults 1 2</span></div> Save and exit nano (CTRL-X, Y, ENTER), and try your new mount:
[[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 ls cn /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/>
That last command should show you the content of you new hard driveAnswer ''yes''.The <code>-cn</code> option we're using can safely be used on mounted file systems.==Spin Down Hard Drives==
NowLow power is a good thing to have in servers. If you do not use your server very often, you need may want to update force the location of hard drives to spin down faster than the moved shares within Amahidefault. Go to your <strong>Amahi Dashboard</strong>, click on <strong>Setup</strong>, then <strong>Shares</strong>Here is how.
Click on one of the shares that you have moved. This will open a panel revealing the share settings. Click on the location (the bit that First ensure ''hdparm'' package is shown with a dotted underline) and it will change to an edit box. Update the location to match the new share location. installed: sudo dnf install hdparm
For exampleTo force to spin down after 10 minutes of being idle, the original movies location was: add these lines to <span style="color:red"code>/varetc/hda/files/moviesrc.local</spancode>:<br/pre>The new location might be: <span style="color:blue"># power drives down after 10 minutes idle/sbin/varhdparm -S120 /hdadev/filessda/drivessbin/hdparm -S120 /sdb1dev/moviessdb...</spanpre>
Repeat for any other shares that you have moved. Check that you can access these shares from another machine within your networkMost drives will power down on their own without doing this.
FinallyOnce stopped, if you have any services that depend on the location 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 these shares, make sure they zero means "timeouts are configured to use disabled": the new share locationdevice will not automatically enter standby mode. For example Values from 1 to 240 specify multiples of 5 seconds, if you have a DLNA server installedyielding timeouts from 5 seconds to 20 minutes. Values from 241 to 251 specify from 1 to 11 units of 30 minutes, check its configuration files yielding timeouts from 30 minutes to make sure that it can find any media folders that have been moved5.5 hours. A value of 252 signifies a timeout of 21 minutes. SecondlyA value of 253 sets a vendor-defined timeout period between 8 and 12 hours, <em>check that all such services start correctly and behave as expected</em>. If the service doesn't start, it may be that it value 254 is testing for a specific location during the service startupreserved. Check the startup files in <strong>/etc/init 255 is interpreted as 21 minutes plus 15 seconds.d</strong> to see if this is the case Note that some older drives may have very different interpretations of these values.
That's it. Your shareIt may make the system run cooler and power efficient (sespecially on a Home Server you are rarely using all of the pool drives at the same time) are now on your new hard drive.
=Troubleshooting=Use Hard Drive in Greyhole Storage Pool==hda-diskmount==If ''hda-diskmount'' does not mount the hard drive or you prefer to do it manually, complete the following steps:
If you want to add your new 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; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"> mkdir -p /var/hda/files/drives/drive1</div></blockquote>Identify the hard drive to your Greyhole storage pool, here's how mount and copy the UUID from the output that corresponds to do thatthe 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></blockquote>
First, you'll need to make the mount permanent: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 -> ../.. [[Open Terminal as /dm-2 lrwxrwxrwx 1 root|In a Terminal, as root]], type the following command10 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;"> umount /var/hda/files/drives/sdb1
nano /etc/fstab
</div></blockquote>:EXAMPLE: # # /etc/fstabIn nano # Created by anaconda on Sat Nov 9 01:46:39 2013 # # Accessible filesystems, by reference, youare maintained under 'll need to add a new line at the bottom. Take the line that hda-diskmount gave you/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and insert that.<br/>or blkid(8) for more info # UUID=1ebbf241-528c-465e-889f-acc15400dd8c / ext4 defaults 1 1So, following previous examples, I should add this: UUID=087b15a5-c3ca-4615-b6ee-bf5f399a803e /boot ext4 defaults 1 2 UUID=75346b8e-b162-458c-b0e9-a8d48ec2bc82 swap swap defaults 0 0<div style UUID="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; backgroundad85eeb9-18f0-4b85-color: #E6F2FF; margin: 3px 3px 1em 3px; text9bfa-align: left;">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; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
mount -a
</div></blockquoteFinally:If all goes well, you'll need to configure Greyhole to select your new partitionthere should not be any output. To configure GreyholeIf there are errors, Advanced Settings must be enabled under [http://hda/setup?sub=settings&tab=setting Setup &gt; Settings]stop and diagnose the problem.
In the Accomplish [[http:Adding_Hard_Drives_101#Verify/Test|Verify/hda/setup?sub=disk_pooling&tab=share Shares &gt; Storage Pool pageTest]] of your Amahi dashboard, you'll see a list of step to ensure the hard drive is properly mounted partitions, with checkboxes next to each, allowing you to include those partitions in your storage pool.<br />
You should now have a new row in there, referring Repeat this process for each hard drive to /var/hda/files/drives/sdb1be mounted.
Select it (click ==Partitions > 2.1TB==If by following this tutorial you are unable to mount hard drives with partitions > 2.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