URGENT: Need help with RAMDISK and Linux!

Discussion in 'Bukkit Help' started by SpaZMonKeY777, Aug 28, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    SpaZMonKeY777

    Anyone here familiar with Linux and RAMDISKs? I just recently upgraded my server to 32Gb of ram, and was following some guides to mount my world files into a ramdisk, but while doing so, it seemed to delete my entire world file and make a new one upon start of my server. Luckily I do have backups, and I am unzipping one right now.

    But now I have this RAMDISK mounted, and no idea how to fix it. If theres anyone out there that could help, I would be greatful! Thanks~
     
  2. Offline

    bastion

    Ramdisks are great except for one thing. when the system restarts, of course all your data is lost.

    have you modified your fstab file in /etc? if so please post the contents of that file

    have you written a script to save your ramdisk to a backup folder? if so post the contents

    have you written a script to copy the backup to ramdisk folder on reboot/startup? if so post the contents

    I use ramdisk for my ubuntu 12.04 lts install to store my worlds on.
     
  3. Offline

    SpaZMonKeY777

    Here are the contents of my /etc/fstab

    Code:
    LABEL=/                /                      ext3    defaults        1 1
    LABEL=/boot1            /boot                  ext3    defaults        1 2
    tmpfs                  /dev/shm                tmpfs  defaults        0 0
    devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
    sysfs                  /sys                    sysfs  defaults        0 0
    proc                    /proc                  proc    defaults        0 0
    LABEL=SWAP-sda3        swap                    swap    defaults        0 0
    /dev/sdb1              /newdisk                ext3    defaults    1 2
    tmpfs                  /root/AWNW/world        tmpfs  defaults,size=6144m        0 0
    
    I did not setup a script for saving/backing up because I have a plugin that does it. Would the plugin not suffice in this case? (And yes I realize running my server out of root is not the brightest idea, but I am very new to Linux and am learning as best I can lol)
     
  4. Offline

    bastion

    the root thing is not that big of a deal but you should move your stuff to another folder but you must also make sure your permissions dont cause you problems.

    the plugin will back up your stuff but it wont put your world back into your ramdisk on restart.

    Code:
    #!/bin/sh
     
    today=$(date +%Y_%m_%d_%H)
    folder="/data/worlds/"
    tmpfolder="/data/backup/tmp/*"
     
    # copy
    cp -rp $tmpfolder $folder
    you can change this to what ever you need the paths to be, you will need to add a cron job to run this file Reboot.

    you need to get familiar with cron it is your best freind.

    Code:
    #!/bin/sh
     
    today=$(date +%Y_%m_%d_%H)
    worldram="/data/worlds/*"
    tmpwr="/data/backup/tmp"
    logfile="log/$today.log"
     
     
    # remove tmp worlds for back up
    rm -rf $tmpwr/*
     
    # copy live to temp to avoid read locks
    cp -rup $worldram $tmpwr
    
    this is the script i run every 15 minutes as a cron job as a backup in case something happens to the server this allows me to only have 15 minutes of data loss.

    i also use the tmp files to create hourly, daily, weekly and monthly back ups, i just zip these files up. disk size is important to watch.
     
  5. Offline

    SpaZMonKeY777

    Okay I guess I will need to learn how to use Cron. What about the ramdisk I set up though? So I just need to unzip one of my backups into my world directory and start from there? Or did I do anything wrong after mounting what I put into the fstab there. Thanks for the help so far btw.
     
  6. Offline

    bastion

    your fstab looked fine, this is what my entry looks like:

    worlds /data/worlds tmpfs size=1G,mode=777,uid=mc,gid=mc 0 0

    the uid and gid are the user i have set up, i use mode 777 to make sure there are no read or write problems.

    so yes just unzip your backup folder into the ramdisk folder then start from there.
     
Thread Status:
Not open for further replies.

Share This Page