Changes

From Amahi Wiki
Jump to: navigation, search
no edit summary
==Install prerequisites==
[[Open Terminal as root|In a Terminal, as root]], type the following command(two) commands:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;text-align: left">yum -y install pmount fuse fuse-libs ntfs-3g gparted<br/><br/>wget -q -O /usr/sbin/hda-diskmount2 http://dl.dropbox.com/u/3022105/Amahi/hda-diskmount2 && chmod +x /usr/sbin/hda-diskmount2
</div>
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
hda-diskmountdiskmount2
</div>
Example:
<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-diskmountdiskmount2<br/>
<nowiki>****************************************************************</nowiki><br/>
Ignoring /dev/sda1 - already in /etc/fstab or mounted<br/>
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">/dev/sdb1 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/>
Just note down the information in bold (green, red and blue). We'll use them below.
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' can not recognize (or something similar). It's nothing to worry about if you get that when executing the hda-diskmount diskmount2 script.
==Test your hard drive==
Note that this step can take a ''long'' time to complete! You'll probably want to start it in the evening, to have it completed in the morning.
To do so, [[Open Terminal as root|in a Terminal, as root]], type the following command. Replace <strong style="color:green">sdb1</strong> with the (green) value you received from hda-diskmountdiskmount2.
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
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/n)?"<br/>
Answer ''yes''. The -cn option we're using can safely be used on mounted filesystems.
 
==Get your partition UUID==
Each partition in Linux can be identified with a unique identifier. This identifier, the UUID, is what you'll want to use to permanently mount your new partition.
 
To get the UUID of your new partition, execute this command in a Terminal. Replace <strong style="color:green">sdb1</strong> with the (green) value you received from hda-diskmount.
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
ls -l /dev/disk/by-uuid/ | grep <strong style="color:green">sdb1</strong>
</div>
 
Example:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
[gb@hda ~]$ <strong>ls -l /dev/disk/by-uuid/ | grep sdb1</strong><br/>
lrwxrwxrwx 1 root root 10 2010-02-18 03:24 9d972abc-1639-44df-a60e-668618d40236 -> ../../sdb1
</div>
 
In the example above, my UUID is '''9d972abc-1639-44df-a60e-668618d40236'''. Note that down.
==Use the hard drive==
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 the following command. Replace the path in red with the path you received when you ran hda-diskmountdiskmount2.
<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>
</div>
In nano, you'll need to add a new line at the bottom. Take the line that hda-diskmount diskmount2 gave you (the blue one), and change the first two values.<br/>Instead of /dev/sdb1, enter '''UUID=''' followed by second value (the UUID you found earlierpath).<br/>
Replace the second value with '''/var/hda/files'''.
hda-diskmount diskmount2 gave me:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
<strong span style="color:blue">/dev/sdb1 UUID=9d972abc-1639-44df-a60e-668618d40236 <strong>/var/hda/files/drives/sdb1 </strong> ext4 defaults 1 2</strongspan>
</div>
So I should add this instead:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;">
<strong>UUID=9d972abc-1639-44df-a60e-668618d40236</strong> <strong>/var/hda/files</strong> ext4 defaults 1 2
</div>
Make sure you do '''not''' change anything else from the blue line you received from hda-diskmountdiskmount2.<br/>It might not be the same thing as the above example; oyu you need to use the values you've received.
Save and exit nano (CTRL-X, Y, ENTER), and try your new mount:
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-diskmountdiskmount2. 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>
</div>
In nano, you'll need to add a new line at the bottom. Take the line that hda-diskmount diskmount2 gave you (the blue one), and change the first value onlyinsert that.<br/>Instead of /dev/sdb1, enter '''UUID=''' followed by the UUID you found earlier. hda-diskmount gave me:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"><strong style="color:blue">/dev/sdb1 /var/hda/files/drives/sdb1 ext4 defaults 1 2</strong></div>
So , following previous examples, I should add this:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left;"><strongspan style="color: blue;">UUID=9d972abc-1639-44df-a60e-668618d40236</strong> /var/hda/files/drives/sdb1 ext4 defaults 1 2</span>
</div>
</div>
In nano, you'll need to add a new line at the bottom. Take the line that hda-diskmount diskmount2 gave you (the blue one), and change the first value onlyinsert that.<br/>Instead of /dev/sdb1, enter '''UUID=''' followed by the UUID you found earlier.
hda-diskmount gave meSo, following previous examples, I should add this:<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px;"><strong style="color:blue">/dev/sdb1 /var/hda/files/drives/sdb1 ext4 defaults 1 2</strong></div>
So I should add this: <div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left;"><strongspan style="color: blue;">UUID=9d972abc-1639-44df-a60e-668618d40236</strong> /var/hda/files/drives/sdb1 ext4 defaults 1 2</span>
</div>
Finally, you'll need to configure Greyhole to select your new partition.
In Greyhole storage pool optionsthe <a href="http://hda/setup?sub=disk_pooling&tab=share" target="_blank">Shares &gt; Storage Pool page</a>, you'll see a list of mounted partitions, with checkboxes next to each, allowing you to include those partitions in your storage pool.
You should now have a new row in there, referring to /var/hda/files/drives/sdb1.<br/>
That's it. Your new hard drive just increased your Greyhole storage pool capacity.
==NTFS partitions==
For NTFS partitions, you'll need to change the line you add in your /etc/fstab file to make your files readable by others (like the web server, and thus the web applications).
 
Here's what you need to change (two things), using an example.
 
If what you added in your /etc/fstab is this:
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left">
UUID=9d972abc-1639-44df-a60e-668618d40236 /var/hda/files <strong style="color:red">ntfs</strong> <strong style="color:blue"> user,fmask=0113,dmask=0002,uid=500,gid=100</strong> 1 2
</div>
 
You'll need to change that to this ('''all on one line'''):
<div style="border: 1px solid #A3B1BF; padding: .5em 1em; color: #000; background-color: #E6F2FF; margin: 3px 3px 1em 3px; text-align: left">
UUID=9d972abc-1639-44df-a60e-668618d40236 /var/hda/files <strong style="color:red">ntfs-3g</strong> <strong style="color:blue">defaults,fmask=0113,dmask=0002,uid=500,gid=100,noatime,rw</strong> 1 2
</div>
If you need to remove a disk please go to [[How to Remove a Drive from LVM]]