Changes

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

edits