Some of the problems I faced:
- Amahi 7 supports only installing from a DVD; I don't want a dvd drive
- Amahi 7 USB install guide did not work for me
- Amahi 7 does not have greyhole integrated yet, so a manual install has to be done
- hda-greyhole did not work well with Fedora 19's Samba
- After installing hda-greyhole and configuring samba to use it, I could no longer access the share and was getting the following errors:
Sep 5 01:48:23 amahi smbd: Error loading module '/usr/lib64/samba/vfs/greyhole.so': /usr/lib64/samba/libsmbd_base.so: version `SAMBA_4.0.0' not found (required by /usr/lib64/samba/vfs/greyhole.so)
Sep 5 01:48:23 amahi smbd: [2013/09/05 01:48:23.379707, 0] ../source3/smbd/vfs.c:184(vfs_init_custom)
Sep 5 01:48:23 amahi smbd: error probing vfs module 'greyhole': NT_STATUS_UNSUCCESSFUL
Sep 5 01:48:23 amahi smbd: [2013/09/05 01:48:23.379830, 0] ../source3/smbd/vfs.c:349(smbd_vfs_init)
Sep 5 01:48:23 amahi smbd: smbd_vfs_init: vfs_init_custom failed for greyhole
Sep 5 01:48:23 amahi smbd: [2013/09/05 01:48:23.379946, 0] ../source3/smbd/service.c:632(make_connection_snum)
Sep 5 01:48:23 amahi smbd: vfs_init failed for service Music
Sep 5 01:48:23 amahi smbd: [2013/09/05 01:48:23.389801, 0] ../lib/util/modules.c:56(load_module)
Standard disclaimer applies; use the details here at your own risk, you could certainly destroy all your data and risk a bricked system! Also, this is outside of Amahi supported practices.
I run a headless system so all commands after the installation of Fedora, are run in a bash terminal.
I ran all commands as root (i.e. I executed sudo su – in the terminal first)
This assumes a fair amount of knowledge, like being able to use ping and edit files.
In a nutshell
- Upgrade Memory
- Update Bios
- Install Fedora 19
- Install Amahi
- Add Hard Drive
- Change Share locations
- Install Greyhole
I installed more RAM (Corsair CMV8GX3M1A1333C9 Value Select 8GB (1x8GB) DDR3 1333 Mhz CL9 Mainstream Desktop Memory Module”) first after taking out the 2GB it came with as I prefer my RAM to be exactly the same in my servers.
The case is easy to take apart; after you take off all the cables connected to the motherboard (conveniently easy to get to as it is at the front) the motherboard comes out easily as it sits on a metal sliding base. The only issue I had was taking off the two thumb screws holding the motherboard in place as they were too tight to remove by hand…but HP provide a handy L-shape star wrench to use.
The official bios for this board has been modded to support 6 ports of AHCI SATA 3gb/s. You can find the modded bios here: http://www.avforums.com/forums/networking-nas/1521657-hp-n36l-n40l-n54l-microserver-updated-ahci-bios-support.html
To create a bootable USB key with the bios just download the .rar file, extract, and execute RunMe.exe.
Install Fedora 19
Prepare your USB stick
Download Unetbootin: http://unetbootin.sourceforge.net/unetbootin-windows-latest.exe
Unetbootin is a standalone executable so doesn't need to be installed. You will need admin rights.
Make sure you have a USB stick with enough space in your machine, then execute UNetbootin.
In the UNetbootin window for Distribution select Fedora 19_Live_x64
Make sure under type at the bottom, "USB Drive" is selected and that next to Drive it shows your USB stick, else you run the risk of overwriting your data.
Once UNetbootin finishes, don’t reboot, just exit.
Remove your USB stick and boot off it on your server. By default it should be able to boot off USB, however you may need to enable booting off USB in the Bios if that is not already set .
Complete Fedora installation by following the instructions that appear.
Log on, turn on SSH and make available after reboot:
service sshd start chkconfig sshd on
Make sure you can connect to the internet (ping google.com for example). If you can’t, try manually adding DNS servers to /etc/resolv.conf (you could add the openDNS servers for example: 22.214.171.124 and 126.96.36.199)
To install Amahi execute:
rpm -Uvh http://f19.amahi.org/noarch/hda-release-6.9.0-1.noarch.rpm yum -y install mariadb-libs mariadb-server yum -y install hda-ctl hda-platform hda-install
If all went well, your Amahi control panel (https://www.amahi.org/users) should show your new install as running (might take a minute or two to catchcup)
Optionally you can turn off DHCP in your router at this stage
Add Hard Drive
I used parted for prepping my new 4TB hard drive, which appeared as /dev/sdb (read here: http://rainbow.chard.org/2013/01/30/how-to-align-partitions-for-best-performance-using-parted/)
parted /dev/sdbat the parted prompt
mklabel gpt mkpart primary ext4 4096s 100% align-check opt 1 quit
mkfs.ext4 -L greyhole01 /dev/sdb1mount
hda-diskmountusing the output from the above command, first backup /etc/fstab, and then add to /etc/fstab.
For me this meant I added the following to the bottom of my fstab:
UUID=e68bc54a-b795-4ce0-802f-213f4ab71e60 /var/hda/files/drives/drive1 ext4 defaults 1 2
Change Share Locations
I changed my default share paths from the drive that the OS lived on to my new drive using the Amahi web interface (after creating the following folder /var/hda/files/drives/drive1/shares/). This is so I have plenty of space before greyhole can move files and as it is a drive in the pool, when Greyhole moves the files it should happen quicker if it decides to store a copy on the same drive (of course copies that need to be moved to other pooled drives will take more time).
As I’d already followed the installation instructions for installing greyhole on Amahi, before finding out that Amahi 7 didn’t work, I didn’t have to recreate the DB schema. Here is what I had previously done:
yum -y install hda-greyhole hda-create-db-and-user greyhole mysql -u greyhole -pgreyhole greyhole < /usr/share/greyhole/schema-mysql.sql
To upgrade greyhole, I removed hda-greyhole first:
yum remove hda-greyhole
and installed it from the greyhole repository
curl -o /etc/yum.repos.d/greyhole.repo http://www.greyhole.net/releases/rpm/greyhole.repo yum update greyhole
I edited the /etc/greyhole.conf file, adding in my storage_pool_drive:
storage_pool_drive = /var/hda/files/drives/drive1/gh, min_free: 10gb
...and changed the db_user and db_pass to (security minded people should change this at some point):
db_user = greyhole db_pass = greyhole
In /etc/samba/smb.conf I added the following two lines to the shares I wanted to participate in the pool:
dfree command = /usr/bin/greyhole-dfree vfs objects = greyhole
I then restarted Samba and greyhole
Service smb restart Service greyhole restart
I now have a working Amahi 7 with greyhole system. I’ve tested it and all seems to work very well.
The combination that did not work:
Amahi Greyhole: hda-greyhole-0.9.31-1.x86_64
The combination that does work:
I'm fairly sure I've made a few mistakes in creating this both in terms of steps taken to get Amahi+Greyhole running, and producing this document. Please feel free to, constructively correct me :-)
Some links that gave me solutions and others that helped get me pointed in the right direction
Amahi Install related
HD Installation related
Too many others to list