THIS ONLY WORKS WITH THE 6.34 CLIENT INSTALLED PER THE INSTRUCTIONS IN THE PREVIOUS UBUNTU SETUP GUIDE (Ubuntu 10.10.) IF YOU INSTALLED UBUNTU FOLLOWING THE DIRECTIONS IN THE CURRENT GUIDE (Ubuntu 12.04 with the fahinstall.sh scipt), YOU SHOULD NOT FOLLOW THIS GUIDE - IT IS ALREADY INSTALLED.
ALSO, IT DOES NOT WORK WITH v7, NOR DO I PLAN ON MAKING IT WORK WITH v7
These are instructions for setting up a temporary file system to use for running F@H - basically a ramdisk. The reason to to this is that it makes disk write times almost instantaneous. The down side is that it is a temporary file system, meaning it is lost when the system powers down or reboots. Any risk and inconvenience of folding on a temporary file system is remedied by using scripts and a cron job to keep everything backed up and to automatically set everything up correctly when powering up your system. All of this has been validated pretty thoroughly, and it is definately worth the time to set up on any Linux machine.
***NOTE 1*** This was tested on Ubuntu 10.10 and 12.04 LTS. It should work on any Ubuntu version. The only issue you might run into is with rc.local and/or the /etc/init.d script not executing in later versions of Desktop (12.04 and 12.10.) If you run into issues with the startup script running, let me know.
***NOTE 2*** Based on my testing, the easiest thing to screw up is to not replace "<user>" with your Linux user in the steps where this is required (rc.local edit, fstab edit, /etc/init.d script, and smb.conf file.) Please be aware of this and don't forget to edit the lines after you copy/paste them.
First, remove any backup/restore scripts from /usr/bin if they exist. If you get a "file not found" type of error, that is fine.
Download these scripts to /usr/bin so they can be used from anywhere. You will need to use sudo to download and chmod them.
Create a backup by running the fahbackup script.
Verify the backup - you will now have a fahbackup-data directory in your home directory. In that directory, you will have a directory called current. In that directory, you should have a file named <cureent date/time>.tar. Entering this:
should return something like this, only with the current date/time as the file name:
If it exists, you are ready to proceed. First, stop the client.
Next, delete the contents of your fah directory (don't worry - you just backed everything up.)
Get your user ID and group ID - run the following two commands and note the results (if you have a typical Ubuntu install with a single user, these will both be 1000):
Update /etc/fstab to mount a tmpfs filesystem on boot.
Add this line to the bottom of the file, replacing <user> with your Linux user, <userd ID> with your user ID, and <group ID> with your group ID:
Save the file (Ctrl X - Y - Enter) and mount the new tmpfs file system to the fah directory
Restore you fah directory with the fahrestore script
Check the contents of your ~/fah directory to make sure everything looks correct. Entering:
should return something like this:
If it returns nothing, the restore did not work
Update /etc/rc.local so it restores the directory when the system boots up.
Add this line before the exit 0 line. Again, replace <user> with your Linux user.
Save your changes (Ctrl X - Y - Enter)
Set up a cron job to run the backup script hourly. The backup process does not affect folding performance, so you should not see any ppd drop running it hourly. Also note that you need to run this as your Linux user - DO NOT run this with sudo.
If you haven't used crontab -e before, you will be prompted for an editor - choose nano. Add this line to the bottom of the file that opens. If the file is empty, that is fine - add this as the first line.
Save your changes (Ctrl X - Y - Enter)
Next, you want to set the system up to create a backup when you shut down, reboot, or if the cron daemon stops. To do this, first make a simple script in /etc/init.d
The script itself is just two lines. Again, replace <user> with your Linux user.
Save the file (Ctrl X - Y - Enter), then make the script executable
Finally, add symlinks to this script in rc0.d, rc1.d, and rc6.d:
One note here - shutdowns and reboots can take up to a couple of minutes with these backup scripts in place. Just be aware that if you see your machine seem to hang on reboot, it is probably normal. Just give it a couple of minutes and everything should be fine.
Samba setup: If you are using a Desktop Linux version and you used the GUI tool to share your folding directory for remote monitoring with HFM, you will need to switch to using the smb.conf file to configure file sharing. The GUI tool does not work with tmpfs file systems, so anything that relies on this share (such as HFM) will not work. Don't worry though - the configuration is not that difficult.
First, back up your current samba config file (smb.conf)
Next, create a user share - replace <user> with your user:
Open /etc/samba/smb.conf in nano:
Find this line (it is towards the top):
Delete the # and change it to:
Save the file (Ctrl X - Y - Enter) and reload samba
Make sure your share is accessible from your HFM machine. The path for HFM should be something like \\machinename\fah.
You should verify that your backup and restores scripts work on a reboot. Check the time on your last backup, and verify that you have a restored fah directory. Reboot your system, then verify that you still have a restored fah directory and that your latest backup has the date and time you rebooted. If you do, you are set. Restart your fah client like you normally do. You should also make sure your crob job is working by making sure that your latest backup (in ~/fahbackup-data/current/) updates each hour. If it does, you are finished!
While this looks compilcated, it really isn't. I would expect it to take 15 minutes or less per machine, even with reboot testing. It is definitely worth the time to set up. If you run into any problems, the best way to get help will be in irc (irc.dp.cx - #hardocp) - ask for tear or musky. Otherwise, posts any issues here. Any feedback on these instructions is also appreciated.
ALSO, IT DOES NOT WORK WITH v7, NOR DO I PLAN ON MAKING IT WORK WITH v7
These are instructions for setting up a temporary file system to use for running F@H - basically a ramdisk. The reason to to this is that it makes disk write times almost instantaneous. The down side is that it is a temporary file system, meaning it is lost when the system powers down or reboots. Any risk and inconvenience of folding on a temporary file system is remedied by using scripts and a cron job to keep everything backed up and to automatically set everything up correctly when powering up your system. All of this has been validated pretty thoroughly, and it is definately worth the time to set up on any Linux machine.
***NOTE 1*** This was tested on Ubuntu 10.10 and 12.04 LTS. It should work on any Ubuntu version. The only issue you might run into is with rc.local and/or the /etc/init.d script not executing in later versions of Desktop (12.04 and 12.10.) If you run into issues with the startup script running, let me know.
***NOTE 2*** Based on my testing, the easiest thing to screw up is to not replace "<user>" with your Linux user in the steps where this is required (rc.local edit, fstab edit, /etc/init.d script, and smb.conf file.) Please be aware of this and don't forget to edit the lines after you copy/paste them.
First, remove any backup/restore scripts from /usr/bin if they exist. If you get a "file not found" type of error, that is fine.
Code:
sudo rm -f /usr/bin/fahbackup
sudo rm -f /usr/bin/fahrestore
Code:
cd /usr/bin
sudo wget http://darkswarm.org/fahtools/fahbackup
sudo wget http://darkswarm.org/fahtools/fahrestore
sudo chmod +x fahbackup
sudo chmod +x fahrestore
Code:
fahbackup
Code:
ls ~/fahbackup-data/current
Code:
2012-11-29-0734.tar
Code:
pkill fah6
Code:
rm -r ~/fah/*
Code:
id -u
id -g
Code:
sudo nano /etc/fstab
Code:
tmpfs /home/<user>/fah tmpfs rw,uid=<user ID>,gid=<group ID> 0 0
Code:
sudo mount -a
Code:
fahrestore
Code:
ls ~/fah
Code:
client.cfg FAHlog.txt queue.dat thekraken-prev.log
fah6 langouste-helper.sh thekraken-FahCore_a3.exe unitinfo.txt
FahCore_a3.exe machinedependent.dat thekraken-FahCore_a5.exe work
FahCore_a5.exe MyFolding.html thekraken.log
Update /etc/rc.local so it restores the directory when the system boots up.
Code:
sudo nano /etc/rc.local
Code:
sudo -u <user> fahrestore
Set up a cron job to run the backup script hourly. The backup process does not affect folding performance, so you should not see any ppd drop running it hourly. Also note that you need to run this as your Linux user - DO NOT run this with sudo.
Code:
crontab -e
Code:
00 * * * * fahbackup > /dev/null 2>&1
Next, you want to set the system up to create a backup when you shut down, reboot, or if the cron daemon stops. To do this, first make a simple script in /etc/init.d
Code:
sudo nano /etc/init.d/fahbackup-rc
Code:
#!/bin/bash
sudo -u <user> fahbackup
Code:
sudo chmod +x /etc/init.d/fahbackup-rc
Code:
sudo ln -s /etc/init.d/fahbackup-rc /etc/rc0.d/K10fahbackup-rc
sudo ln -s /etc/init.d/fahbackup-rc /etc/rc1.d/K10fahbackup-rc
sudo ln -s /etc/init.d/fahbackup-rc /etc/rc6.d/K10fahbackup-rc
Samba setup: If you are using a Desktop Linux version and you used the GUI tool to share your folding directory for remote monitoring with HFM, you will need to switch to using the smb.conf file to configure file sharing. The GUI tool does not work with tmpfs file systems, so anything that relies on this share (such as HFM) will not work. Don't worry though - the configuration is not that difficult.
First, back up your current samba config file (smb.conf)
Code:
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
Code:
net usershare add fah /home/<user>/fah "" "Everyone:f" "guest_ok=y"
Code:
sudo nano /etc/samba/smb.conf
Code:
# security = user
Code:
security = share
Code:
sudo service smbd reload
You should verify that your backup and restores scripts work on a reboot. Check the time on your last backup, and verify that you have a restored fah directory. Reboot your system, then verify that you still have a restored fah directory and that your latest backup has the date and time you rebooted. If you do, you are set. Restart your fah client like you normally do. You should also make sure your crob job is working by making sure that your latest backup (in ~/fahbackup-data/current/) updates each hour. If it does, you are finished!
While this looks compilcated, it really isn't. I would expect it to take 15 minutes or less per machine, even with reboot testing. It is definitely worth the time to set up. If you run into any problems, the best way to get help will be in irc (irc.dp.cx - #hardocp) - ask for tear or musky. Otherwise, posts any issues here. Any feedback on these instructions is also appreciated.
Last edited: