Difference between revisions of "Reconnect existing Greyhole storage pool"

From Amahi Wiki
Jump to: navigation, search
Line 6: Line 6:
 
This will allow you to rebuild your [[Greyhole]] Storage Pool much faster without needing to rebuild all links in your share before they can be used.
 
This will allow you to rebuild your [[Greyhole]] Storage Pool much faster without needing to rebuild all links in your share before they can be used.
  
* Before re-installing Fedora/Ubuntu, please disconnect all data drives. This will prevent you from potentially destroying any data during the re-installation process.
+
Before re-installing Fedora/Ubuntu, please disconnect all data drives. This will prevent you from potentially destroying any data during the re-installation process. Then, install Fedora/Ubuntu and Amahi using our installation guide.
* Install Amahi using our installation guide.
 
* Connect your data drives back to your server.
 
* Use the contents of your previous /etc/fstab to mount your data drives in their old paths.
 
  
Note: This would allow you to remount the drives on the previous paths in your previous installation. For example, if you have one 1TB and one 2TB harddrive, and they were mounted as /var/hda/files/drives/drive1 and /var/hda/files/drives/drive2 repectively, it would be more efficient to remount your data drives on your new Amahi installation. This can be done by copying and pasting all of the mounts for your Greyhole Storage Pool into the /etc/fstab of your new Amahi installation.
+
* Ubuntu: http://docs.amahi.org/ubuntu-12.html
 +
* Fedora: http://docs.amahi.org/fedora-14.html
  
Warning: Before you continue, you should check the ownership of the files and folders in /var/hda/files to ensure that it belongs to  
+
Next, connect your data drives back to your server, then use the contents of your previous /etc/fstab to mount your data drives in their old paths (hint: copy and paste the lines that have mount points in /var/hda/files/drives/). When you're finished, mount the drives with:
 +
 
 +
{{Code|mount -a}}
 +
 
 +
Note: This would allow you to remount the drives on the previous paths in your previous installation. For example, if you have one 1TB and one 2TB harddrive, and they were mounted as /var/hda/files/drives/drive1 and /var/hda/files/drives/drive2 repectively, it would be more efficient to remount your data drives on your new Amahi installation in the same locations. If you didn't backup your fstab, simply remount the drives like you were installing them for the first time:
 +
 
 +
{{Code|hda-diskmount}}
 +
 
 +
{{Warning|Warning: Before you continue, you should check the ownership of the files and folders in /var/hda/files to ensure that it belongs to  
 
   <user>:<group>
 
   <user>:<group>
  
 
and not under 500:users. This can be resolved by running the following commands as root:
 
and not under 500:users. This can be resolved by running the following commands as root:
  
      chown -R 1000:users /var/hda/files
+
{{Code|chown -R 1000:users /var/hda/files
      chmod -R g+w /var/hda/files
+
chmod -R g+w /var/hda/files}} }}
  
 
Then this is what needs to be done:
 
Then this is what needs to be done:
Line 25: Line 31:
 
* Enable "Advanced Settings" with the Amahi Dashboard: Setup->Settings to allow access to Setup > Shares > Storage Pool.
 
* Enable "Advanced Settings" with the Amahi Dashboard: Setup->Settings to allow access to Setup > Shares > Storage Pool.
 
* Re-create your original shares in the Amahi Dashboard: Setup->Shares.
 
* Re-create your original shares in the Amahi Dashboard: Setup->Shares.
**  You should make sure to select "Use Pool" and select the correct number of extra copies. If you don't remember all of your original shares, you can check your old /etc/greyhole.conf file (which includes the extra number of copies) or within the "gh" folder found at the root of your data drives.
+
**  You should make sure to select "Use Pool" and select the correct number of extra copies. If you don't remember all of your original shares, you can check your old /etc/greyhole.conf file (which includes the extra number of copies) or run the following:
* Run Greyhole's fsck command to rebuild your shares.
 
 
 
== Previous Guide ==
 
 
 
<!--After re-install, recreate all your shares exacty as they were.<br>
 
Add the shares to the storage pool.<br>
 
As root, run greyhole --fsck.<br>
 
This  will recreate the symlinks in the landing zone /var/hda/files.<br>-->
 
* Disconnect all data drives before you reinstall. This will prevent you from destroying them by mistake during the Fedora/Amahi install!
 
* Install Amahi per the regular instructions.
 
* Connect the data drives, and use hda-diskmount to remount all of them.
 
Note that if you can, it would be faster if you can re-mount the drives in the same paths they used to have.
 
 
 
'''Example:''' If you have one 1TB and one 2TB, and the 1TB was mounted as /var/hda/files/drives/drive1, and the 2TB was mounted as /var/hda/files/drives/drive2, it would be better to re-mount that like that on your new HDA. If you mount them otherwise, it will still work, but Greyhole will work a while to re-build the links in your share before they can be usable.
 
* Select the drives in the Amahi Dashboard: Setup > Shares > Storage Pool
 
* Re-create your shares in the Amahi Dashboard: Setup > Shares.
 
Make sure to select 'Use Pool', and select the correct number of extra copies.
 
If you don't remember all the shares you had, just check inside the 'gh' folder found at the root of your drives to get a reminder!
 
  
'''Example:'''
 
 
{{Code|ls -1 /var/hda/files/drives/*/gh/ <nowiki>|</nowiki> grep -v : <nowiki>|</nowiki> sort -u}}
 
{{Code|ls -1 /var/hda/files/drives/*/gh/ <nowiki>|</nowiki> grep -v : <nowiki>|</nowiki> sort -u}}
 +
* Run Greyhole's fsck command to rebuild your shares:
  
* Launch a fsck to have Greyhole rebuild your shares.
 
 
{{Code|greyhole --fsck}}
 
{{Code|greyhole --fsck}}
  
 
Until this completes, some of your files will be missing from your shares.
 
Until this completes, some of your files will be missing from your shares.

Revision as of 18:08, 27 August 2012

In order to speed up the entire process, you should backup the following files somewhere safe:

 /etc/greyhole.conf

and

 /etc/fstab

This will allow you to rebuild your Greyhole Storage Pool much faster without needing to rebuild all links in your share before they can be used.

Before re-installing Fedora/Ubuntu, please disconnect all data drives. This will prevent you from potentially destroying any data during the re-installation process. Then, install Fedora/Ubuntu and Amahi using our installation guide.

Next, connect your data drives back to your server, then use the contents of your previous /etc/fstab to mount your data drives in their old paths (hint: copy and paste the lines that have mount points in /var/hda/files/drives/). When you're finished, mount the drives with:

bash code
​mount -a​


Note: This would allow you to remount the drives on the previous paths in your previous installation. For example, if you have one 1TB and one 2TB harddrive, and they were mounted as /var/hda/files/drives/drive1 and /var/hda/files/drives/drive2 repectively, it would be more efficient to remount your data drives on your new Amahi installation in the same locations. If you didn't backup your fstab, simply remount the drives like you were installing them for the first time:

bash code
​hda-diskmount​


Warning!
Warning: Before you continue, you should check the ownership of the files and folders in /var/hda/files to ensure that it belongs to
 <user>:<group>

and not under 500:users. This can be resolved by running the following commands as root:

bash code
​chown -R 1000:users /var/hda/files chmod -R g+w /var/hda/files​


Then this is what needs to be done:

  • Enable "Advanced Settings" with the Amahi Dashboard: Setup->Settings to allow access to Setup > Shares > Storage Pool.
  • Re-create your original shares in the Amahi Dashboard: Setup->Shares.
    • You should make sure to select "Use Pool" and select the correct number of extra copies. If you don't remember all of your original shares, you can check your old /etc/greyhole.conf file (which includes the extra number of copies) or run the following:
bash code
​ls -1 /var/hda/files/drives/*/gh/ | grep -v : | sort -u​
  • Run Greyhole's fsck command to rebuild your shares:
bash code
​greyhole --fsck​


Until this completes, some of your files will be missing from your shares.