Results 1 to 18 of 18

Thread: BOINC + RAMdisk on Linux/Windows [Tutorial]

  1. #1
    Xtreme Addict Evantaur's Avatar
    Join Date
    Jul 2011
    Location
    Finland
    Posts
    1,043

    BOINC + RAMdisk on Linux/Windows [Tutorial]

    BOINC + RAMdisk[Tutorial]

    Why? Well to improve your SSD/HDD's lifespan (or allow you to run your system from USB stick), also it's a lot faster, consumes less electricity than a mechanical drive, and it's fun . Only downside is(was) you'd lose all your data every time you restart, and I've already fixed that issue.



    so what you need:
    - RAM (depending on your distro ~1.5gb + 125mb/thread), i'd recommend 4G for 8 threads
    - BOINC

    LINUX
    There are two ways of doing this (for fresh install), depending how you install your BOINC client

    - Way of the Warrior (Download client from Boinc site)
    - Easy way (apt-get way)
    if you have already installed boinc you should use "Existing system" instead

    Windows
    Last edited by Evantaur; 10-26-2014 at 01:23 PM.

    I like large posteriors and I cannot prevaricate

  2. #2
    Xtreme Addict Evantaur's Avatar
    Join Date
    Jul 2011
    Location
    Finland
    Posts
    1,043
    1. Way of the Warrior (Download client from BOINC site)

    Step 1 - Installing BOINC

    Code:
    cd /tmp
    wget http://boinc.berkeley.edu/dl/boinc_7...c-linux-gnu.sh
    chmod +x boinc_7.0.65_x86_64-pc-linux-gnu.sh
    ./boinc_7.0.65_x86_64-pc-linux-gnu.sh
    cd BOINC
    sudo cp boinc /sbin/boinc; sudo cp boinccmd /sbin/boinccmd; sudo cp boincmgr /sbin/boincmgr
    sudo mkdir /var/lib/boinc-client
    sudo chown $(whoami) /var/lib/boinc-client
    Step 2 - Creating file structure for BOINC

    Code:
    boinc --dir /var/lib/boinc-client
    on debian/ubuntu server it whined about libXss.so.1: cannot open shared object file: No such file or directory

    you can fix it simply with
    Code:
    sudo apt-get install libxss1
    you should see something like this



    you're done with that part... exit with CTRL + C

    your file structure should look something like this:

    Code:
    evantaur@ubuntu:~$ ls /var/lib/boinc-client
    all_projects_list_temp.xml  client_state_prev.xml  client_state.xml  daily_xfer_history.xml  gui_rpc_auth.cfg  lockfile  notices  time_stats_log
    Step 3 - Setting up the RAMdisk

    Code:
    mkdir /var/lib/boinc-client/slots
    sudo nano /etc/fstab
    add this line to the end
    Code:
    none /var/lib/boinc-client/slots  tmpfs  nodev,nosuid,noexec,nodiratime,size=2G 0 0
    adjust size=2G accordingly, 2G is fine for 8 threads
    press CTRL + X and save it

    then run

    Code:
    sudo mount -a
    df -h should print out something like this

    Code:
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda1       2.0G  971M  910M  52% /
    none            4.0K     0  4.0K   0% /sys/fs/cgroup
    udev            174M  4.0K  174M   1% /dev
    tmpfs            37M  288K   37M   1% /run
    none            5.0M     0  5.0M   0% /run/lock
    none            183M     0  183M   0% /run/shm
    none            100M     0  100M   0% /run/user
    none            200M     0  2G 0% /var/lib/boinc-client/slots <----
    Step 4 - Setting up init script

    Code:
    cd
    wget http://nikita.tnnet.fi/~evntr/scripts/ramboinc/ramboinc
    nano ramboinc
    find BOINCUSER= and change boinc to your username


    now it's time to install it
    Code:
    sudo cp ramboinc /etc/init.d/
    sudo update-rc.d ramboinc defaults
    sudo chmod +x  /etc/init.d/ramboinc
    you should now be able to start boinc with

    Code:
    sudo /etc/init.d/ramboinc start
    Last edited by Evantaur; 06-22-2013 at 03:09 PM.

    I like large posteriors and I cannot prevaricate

  3. #3
    Xtreme Addict Evantaur's Avatar
    Join Date
    Jul 2011
    Location
    Finland
    Posts
    1,043
    2. Easy way (apt-get way)

    Step 1 - Installing Boinc

    Code:
    sudo apt-get install boinc && sudo apt-get clean
    sudo /etc/init.d/boinc-client stop && sudo update-rc.d -f boinc-client remove
    sudo mv /etc/init.d/boinc-client ~/boinc-client.old
    Step 2 - Setting up RAMdisk

    Code:
    mkdir /var/lib/boinc-client/slots 
    sudo nano /etc/fstab
    add this line to the end
    Code:
    none /var/lib/boinc-client/slots  tmpfs  nodev,nosuid,noexec,nodiratime,size=2G 0 0
    adjust size=2G accordingly, 2G is fine for 8 threads
    press CTRL + X and save it

    then run

    Code:
    sudo mount -a
    df -h should print out something like this

    Code:
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda1       2.0G  971M  910M  52% /
    none            4.0K     0  4.0K   0% /sys/fs/cgroup
    udev            174M  4.0K  174M   1% /dev
    tmpfs            37M  288K   37M   1% /run
    none            5.0M     0  5.0M   0% /run/lock
    none            183M     0  183M   0% /run/shm
    none            100M     0  100M   0% /run/user
    none            200M     0  2G 0% /var/lib/boinc-client/slots <----
    Step 4 - Setting up init script

    Code:
    cd
    wget http://nikita.tnnet.fi/~evntr/scripts/ramboinc/ramboinc
    nano ramboinc
    find BOINCUSER= and change boinc to your username


    now it's time to install it
    Code:
    sudo cp ramboinc /etc/init.d/
    sudo update-rc.d ramboinc defaults
    sudo chmod +x  /etc/init.d/ramboinc
    you should now be able to start boinc with

    Code:
    sudo /etc/init.d/ramboinc start
    Last edited by Evantaur; 06-22-2013 at 03:09 PM.

    I like large posteriors and I cannot prevaricate

  4. #4
    Xtreme Addict Evantaur's Avatar
    Join Date
    Jul 2011
    Location
    Finland
    Posts
    1,043
    Existing system


    Way of the warrior (BOINC site) WARNING!... i have not tested this!

    before we even start anything, we need to know where your boinc data is stored..for example if you downloaded boinc_x.x.x.sh to your home dir and ran it there it would be /home/<user>/BOINC

    you can check if it exists with

    Code:
    f [ -d ~/BOINC ]; then echo -ne "\nyes\nyour boinc data is most likely stored in:\n/home/$(whoami)/BOINC\n\n"; fi

    to make it easier we'll make variable for this path now

    Code:
    BOINCDIR=/insert/your/boinc/data/folder/here
    Step 1, stop boinc

    Code:
    boinccmd --quit
    move current slots to backup

    Code:
    sudo mv -r $BOINCDIR/slots BOINCDIR/slots_backup
    Step 2 - Setting up RAMdisk

    Code:
    mkdir /var/lib/boinc-client/slots
    sudo nano /etc/fstab
    add this line to the end
    Code:
    none /var/lib/boinc-client/slots  tmpfs  nodev,nosuid,noexec,nodiratime,size=2G 0 0
    modify /var/lib/boinc-client/slots to your data directory, (/home/user/BOINC/slots) and size=2G, 2G is fine for 8 threads
    press CTRL + X and save it

    then run

    Code:
    sudo mount -a
    df -h should print out something like this

    Code:
    Filesystem      Size  Used Avail Use% Mounted on
    none            200M     0  2G 0% /home/user/BOINC/slots <----
    Step 4 - Setting up init script

    Code:
    cd
    wget http://nikita.tnnet.fi/~evntr/scripts/ramboinc/ramboinc
    nano ramboinc
    find BOINCUSER= and change boincto your username
    and BOINCDIR=/var/lib/boinc-client should be where your BOINC data is stored

    now it's time to install it
    Code:
    sudo cp ramboinc /etc/init.d/
    sudo update-rc.d ramboinc defaults
    sudo chmod +x  /etc/init.d/ramboinc
    you should now be able to start BOINC with

    Code:
    sudo /etc/init.d/ramboinc start

    --------------------------------------------------------------------------------------------


    Easy way (apt-get way)
    Step 1, stop boinc

    Code:
    sudo /etc/init.d/boinc-client stop
    remove/move boinc-client init script
    Code:
    sudo update-rc.d -f boinc-client remove
    sudo mv /etc/init.d/boinc-client ~/boinc-client.old
    moving current slots to backup

    Code:
    sudo mv -r /var/lib/boinc-client/slots /var/lib/boinc-client/slots_backup
    now go to "Easy way, step 2"
    Last edited by Evantaur; 06-22-2013 at 03:21 PM.

    I like large posteriors and I cannot prevaricate

  5. #5
    Xtreme Cruncher
    Join Date
    Jan 2009
    Location
    Nashville
    Posts
    4,162
    Nice work

  6. #6
    Xtreme Member
    Join Date
    May 2008
    Location
    Sydney, Australia
    Posts
    242
    Quote Originally Posted by Evantaur View Post
    Only downside is (was) you'd lose all your data every time you restart, and I've already fixed that issue.
    Can't see the fix, but I haven't been following this topic. (Link?) Do you periodically suspend BOINC and copy a snapshot of the data onto non-volatile storage, or does the RAMdisc driver automatically do journalling onto a n-v medium?

    In your `df -h`output, the "Size" of the ramdisc is shown as 200M not 2G ... ?? ( none 200M 0 2G 0% /var/lib/boinc-client/slots <---- )

    [OT] BTW, lots of this Linux stuff is mumbo-jumbo to me, though I've used and administered *nix systems in the past. (Had a user a/c on the 2nd machine in the continent to run genuine Unix - version 6 on DEC PDP-11/70)
    Had a first dabble with BOINC on Linux a few days ago when my 2600K with XP-64 crashed. Thought it was hardware, but it eventually responded to a repair reinstall of XP - PITA. While it was offline, stuck in my 16G USB stick that's got Kali installed. Got the libsso problem with the Berkeley BOINC 7.0.64, but apt-get fetched & installed 7.0.27 from the supplied repositories. Though the machine was online & could surf the net, BOINC would do nothing except say "Update requested by user" when urged. Maybe there is a problem because I installed Kali & BOINC on my C2D lappie, where it did download WCG tasks, but BOINC didn't like swapping machines. Anyway, I gave up, and a very flaky XP-64 is running again. Linux seems not user-friendly at all, and to be a huge learning curve.[/OT]

  7. #7
    Xtreme Addict Evantaur's Avatar
    Join Date
    Jul 2011
    Location
    Finland
    Posts
    1,043
    Quote Originally Posted by BlindFreddie View Post
    Can't see the fix, but I haven't been following this topic. (Link?) Do you periodically suspend BOINC and copy a snapshot of the data onto non-volatile storage, or does the RAMdisc driver automatically do journalling onto a n-v medium?
    yes, the fix is my customized start up/shut down script that copies it from/to hard drive before shutting down, and back to ram before starts boinc... you'll still lose your running data if hard reset (downloaded but not yet started WUs remains since only slots directory is in RAM)

    In your `df -h`output, the "Size" of the ramdisc is shown as 200M not 2G ... ?? ( none 200M 0 2G 0% /var/lib/boinc-client/slots <---- )
    tempfs("ram disk") is dynamic filesystem and increases only as it needs to, also might have something to do with it that i made this tutorial in a virtual machine (to ensure that everything works and i'm not missing anything)


    Linux seems not user-friendly at all, and to be a huge learning curve.
    it really depends a lot of distro, ubuntu used to be user friendly back when it still had gnome desktop (now uses unity that is more for a laptops IMO), for starters i'd recommend linux mint or xubuntu(ubuntu with XFCE desktop environment . just try it in Live CD or virtual machine firts
    Last edited by Evantaur; 06-29-2013 at 01:58 PM. Reason: typo

    I like large posteriors and I cannot prevaricate

  8. #8
    Xtreme Legend
    Join Date
    Mar 2008
    Location
    Plymouth (UK)
    Posts
    5,279
    Zorin is probably the most "Windows like" distro for day to day but I use Mint Cinnamon and find it not too big of a problem most of the time

    Evantaur: Do you think it may be worth using Cron to do an auto backup every few hours?


    My Biggest Fear Is When I die, My Wife Sells All My Stuff For What I Told Her I Paid For It.
    79 SB threads and 32 IB Threads across 4 rigs 111 threads Crunching!!

  9. #9
    Xtreme Addict Evantaur's Avatar
    Join Date
    Jul 2011
    Location
    Finland
    Posts
    1,043
    Quote Originally Posted by OldChap View Post
    Evantaur: Do you think it may be worth using Cron to do an auto backup every few hours?
    every 2 hours maybe... it takes about 2 hours to finish a WU, i personally wouldn't bother with it but i can add backup command if needed

    I like large posteriors and I cannot prevaricate

  10. #10
    Xtreme Member
    Join Date
    Jul 2012
    Posts
    219
    Thank you for this.
    Fixed my issue with a temp cruncher dropping the threads due to the slow i/o of a usb linux install. Wasnt an issue on the tri core, but the new machines 8 core was too much.
    Richland 6790K @ 4.713 Ghz / 2208 NB / 1123 gpu / 2304 Ram [96 Bclk]
    F2A85-M Pro, Mushkin Black 2133, iGPU (8760D)
    9.7L case (excluding 230mm fan) or 11.6L w/2nd rad fan

  11. #11
    Xtreme Addict Evantaur's Avatar
    Join Date
    Jul 2011
    Location
    Finland
    Posts
    1,043
    you're welcome , it makes me happy when someone finds my stuff useful

    I like large posteriors and I cannot prevaricate

  12. #12
    Xtreme Addict Evantaur's Avatar
    Join Date
    Jul 2011
    Location
    Finland
    Posts
    1,043
    for windows

    STILL CLEANING UP!!!!!

    STEP 1

    Install boinc as you normally would

    after that install Softperfect RAMdisk

    STEP 2

    make sure BOINC is not running

    STEP 3

    delete BOINC from startup

    XP/VISTA/7

    press win + r and type msconfig
    [IMAGE OF MSCONFIG]

    8/8.1/10
    CTRL+SHIFT+ESC

    Click "More Details"
    go to "start-up" tab
    find any boinc related program and make sure you set it disabled

    [PICTURE OF TASKMANAGER]
    STEP 4

    download BOINC_silent.bat and copy it to your c:\program files\BOINC
    Code:
    @echo off
    start /b "BOINC" "c:\Program Files\BOINC\boincmgr.exe" /s
    exit
    open softperfect RAMdisk

    click image -> Create image
    image file name "C:\ProgramData\BOINC\slots.img" (doesn't matter really but i'd use this path so it's easier when taking backups)

    filesystem "NTFS"
    set label if you wish

    click "done"

    click Disk -> add boot disk

    set path to your image file C:\ProgramData\BOINC\slots.img
    set drive letter to Q (you can use something else too but you'll need to replace it later when making symbolic link)
    tick [x] save contents to image

    click ok

    you should now have your boinc drive mounted

    click tools -> applications
    click add

    use "c:\program files\BOINC\BOINC_silent.bat"

    press win+r and type in C:\ProgramData\BOINC\slots

    copy everything inside it to your new ramdisk, after you're done delete slots from C:\ProgramData\BOINC\

    now run cmd as admin
    copy paste this in it, it'll create symbolic link to your ramdisk

    cd c:\programdata\BOINC\
    mklink /d slots q:

    STEP 5
    reboot
    ?
    profit
    Last edited by Evantaur; 10-27-2014 at 08:24 AM. Reason: fixed start command in boinc.bat :J

    I like large posteriors and I cannot prevaricate

  13. #13
    Xtreme crazy bastid
    Join Date
    Apr 2007
    Location
    On mah murder-sickle!
    Posts
    5,878
    I'm experimenting with this in Slackware. It's a little bit different than how Ubuntu works, but seems to be running happily enough so far. I'll see how it goes and either share what I've done or go back to ye olde fashioned way.

    [SIGPIC][/SIGPIC]

  14. #14
    Xtreme Mentor
    Join Date
    Apr 2004
    Location
    CT, USA!!!
    Posts
    2,821
    I have a few boxes running off 8gb sticks, great move considering the savings is like $40 per box and noiseless.

  15. #15
    Xtreme crazy bastid
    Join Date
    Apr 2007
    Location
    On mah murder-sickle!
    Posts
    5,878
    Ok, had this up and running for a few days now. It seems to be returning more points than before. Not bucket loads, just a little up-kick on the graph within BOINC manager. I haven't shut the machine down for anything yet, so I'm still not 100% certain how the control script will behave but so far so good. CPU v elapsed time is at 98.5% roughly for the units as well.

    [SIGPIC][/SIGPIC]

  16. #16
    Xtreme Member
    Join Date
    Dec 2008
    Posts
    480
    http://nikita.tnnet.fi/~evntr/scripts/ramboinc/ramboinc is unreachable for me. Anyone got a copy they can send me?


  17. #17
    Xtreme crazy bastid
    Join Date
    Apr 2007
    Location
    On mah murder-sickle!
    Posts
    5,878
    Code:
    #!/bin/bash
    ### BEGIN INIT INFO
    # Provides:          RAM boinc disk
    # Required-Start:    $remote_fs $syslog
    # Required-Stop:     $remote_fs $syslog
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Start daemon at boot time
    # Description:       Enable service provided by daemon.
    # Version            0.1
    ### END INIT INFO
    # BoincRAM disk script by Evantaur @xtremesystems
    # http://www.xtremesystems.org
    # ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    # Config Part here
    #___________________________________________________________
    
    #Boinc data directory 
    BOINCUSER=boinc
    BOINCDIR=/var/lib/boinc-client
    
    # Ok that's enough :)=
    #___________________________________________________________
    
    
    #copying slots
    start() {
    if [ $(pidof boinc) ]; then
    echo "boinc is already running"
    exit 0
    fi
    SLOTSEXIST=$(ls -1 $BOINCDIR/slots/ | wc -l)
    if [ "$SLOTSEXIST" -gt "0" ]; then
    echo "slots already copied"
    else
    	if [ -d $BOINCDIR/slots_backup ]; then
    	echo "Copying Backup to ramdisk"
    	cp -r $BOINCDIR/slots_backup/* $BOINCDIR/slots/
    	chown -hR $BOINCUSER:$BOINCUSER $BOINCDIR
    	else
    	echo "no backup found...starting without"
    	fi
    fi
    echo starting boinc
    su $BOINCUSER -c "boinc --dir $BOINCDIR --daemon && if [ -d $BOINCDIR/slots_backup ]; then rm -r $BOINCDIR/slots_backup; fi"
    }
    
    stop() {
    
    if [ $(pidof boinc) ]; then
    echo "boinc is running"
    boinccmd --quit
    fi
    if [ -d $BOINCDIR/slots_backup ]; then
    echo "Removing Existing Backup"
    rm -r $BOINCDIR/slots_backup
    fi
    echo "Copying ramdisk to backup"
    mkdir $BOINCDIR/slots_backup
    cp -r $BOINCDIR/slots/* $BOINCDIR/slots_backup
    chown -hR $BOINCUSER:$BOINCUSER $BOINCDIR/slots_backup
    echo "Copying done"
    }
    
    case $@ in
    	start )
            	start ;;
    	stop )
    	        stop ;;
           restart )
    		stop && sleep 15; start ;;
    	*) echo "Usage: $0 start|stop|restart" ;;
    esac

    [SIGPIC][/SIGPIC]

  18. #18
    Xtreme Member
    Join Date
    Dec 2008
    Posts
    480
    Thanks D_A and jeanguy2, and of course Evantaur.


Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •