Fresh Amahi install and existing Greyhole shares

thomasps
Posts: 138
Joined: Fri Feb 18, 2011 1:49 pm

Fresh Amahi install and existing Greyhole shares

Postby thomasps » Tue Dec 20, 2011 11:53 am

Background:
I need to do a fresh re-install of Amahi. Previosuly, I had Greyhole running on most of my shares, but something happened to Fedora (or the disk it's installed on) which requires me to re-install everything. I have several HD managed by Greyhole besides the HD where the OS is installed. Because of the problem, I don't think I will be able to connect via SSH to my machine to do any sort of pre-reinstall operations.

So, assume my OS drive has completely failed and have a bunch of drives managed by Greyhole (with some shares having multiple copies for redundancy).

On the wiki, I found this useful:
Reconnect the Greyhole storage pool after re-install of Fedora / Amahi
•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!


Questions:
1. When it says to use "hda-diskmount to remount all of them", should I follow the instructions (Wiki: http://wiki.amahi.org/index.php/Adding_ ... orage_pool)
where I edit fstab and add each drive?

2. The Wiki article says to "re-mount the drives in the same paths they used to have" if possible. Assuming I can get a hold of my old pre-crash fstab, is it safe to just copy the old entries onto the new fstab? For example:

Code: Select all

UUID=9d972abc-1639-44df-a60e-668618d40236 /var/hda/files/drives/sdb1 ext4 defaults 1 2
The UUID should never change for the same HD, right?

3. The article says: "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!"

Code: Select all

ls -1 /var/hda/files/drives/*/gh/ | grep -v : | sort -u
Do I need to manually check inside each drive? Or does the code above tell me everything I need to know for all drives? Any chance someone could post the kind of output I can expect to see?

4. Finally, I have to ask, is this method current, safe and tried? I love Greyhole and never had any problems with it (thanks Guillaume!), but this is a different scenario. Assuming the data drives are healthy, is there any other tip or suggestions to follow? I want to make sure I have all the info and details ready for when I'm going to re-install everything tonight :cry:

Thnaks so much for any assistance!

HHCosmin
Posts: 24
Joined: Sun Jan 23, 2011 5:06 am

Re: Fresh Amahi install and existing Greyhole shares

Postby HHCosmin » Fri Dec 30, 2011 9:54 am

just went through this and it's wasn't pretty. the os disk went bad so here it goes.

1. i think it's simpler to just attach all the disks that were in the pool (and still work) and to a hda-diskmount once. the command will mount all that is unmounted. do not close the console and write the UUID lines somewhere or in the etc/fstab file. just run hda-diskmount, edit /etc/fstab with the resulting UUID (be root), save, run gryhole -fcsk

2. uuid should be as it was but the mount point will be dependent on the port the disk is connected. so this says (in this particular case) to keep the disks connected their old sata/pata/usb ports

3. probably you did not have that many shares. it's safer to check all the drives. each share should exist at least on one drive (or many) but it's not guaranteed to exist on all. usually the data gets spread out to all disks. just check all, note the names EXACTLY (case sensitive)

4 this method worked for me but it's not for the beginers in linux (like i mostly am). it should work because of the way greyhole works. you could lose the os drive and several data disks. if you run the procedure presented here (connect drives physicaly, do hda-diskmount, edit /etc/fstab, create the shares with the exact names) you will be able to get back all the data if you have redundancy.

i have 5 drives, lost the os drive (that had a data partition also and was part of the pool) and also managed to erase the data from other data drive. some shares had no redundancy. so the the os drive went belly up and because my infinite wisdom (cloned it with ghost and ghost does not know ext4 but also does not say anything about it). i lost part of data that had no redundancy as it is normal, lost data that had redundancy as i had double failure but was still able to get back data that was on the 3 remaining disks.

PS: big tip: the hds-diskmount will give a list like this
UUID=9d972abc-1639-44df-a60e-668618d40236 /var/hda/files/drives/sdb1 ext4 defaults 1 2
this is ok and works but if a disk goes bad the os won;t boot because the UUID will fail to mount. just add "nofail" after the "default"
UUID=9d972abc-1639-44df-a60e-668618d40236 /var/hda/files/drives/sdb1 ext4 defaults,nofail 1 2
this is useful for removable disks but also for this case. if a disk goes boom you will be able to boot into fedora

thomasps
Posts: 138
Joined: Fri Feb 18, 2011 1:49 pm

Re: Fresh Amahi install and existing Greyhole shares

Postby thomasps » Mon Jan 09, 2012 9:52 am

In the end I was able to restore all my data. Thanks for the suggestions. I did take all possible precautions beforehand. For example a labelled each and every sata cable to its corresponding disk, label all disks so that the system after the re-install would be as close as possible to the before crashing state.

One of the biggest surprises that took a while, was that I was hoping to salvage some files from the old OS disk which was still somewhat working. So I booted a live Linux CD and discovered none support lvm out of the box. LVM is the preferred way to install Fedora with Amahi.

In the process I also discovered another data disk had failed (an old ide drive). Fortunately, it was a smallish drive and greyhole did not seem to have stored anything on it yet.

The other think is that I did not remember how many copies of a given share I had originally selected and could not find this info. I used my best recollection, I hope that is not a big problem. It took almost two days after fsdisk to rebalance everything.

Your nofail option tip is great!!! If a drive fails, there's no easy way to amend fstab short of a live CD with LVM support, which I discovered is not straight forward: nano does not let me change fstab on the unbootable system.

Who is online

Users browsing this forum: No registered users and 15 guests