Move mysql stuff to hda1 (mineos(tinycorelinux)) and auto reboot on crash
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Move mysql stuff to hda1 (mineos(tinycorelinux)) and auto reboot on crash
ok im attempting to run a minecraft server on mineos (which is based on tinycorelinux)
on certain files and folders persist from one reboot to another, i added myql to it and by default it puts the following files
Databases stored in /usr/local/var/mysql
Config file /usr/local/etc/my.cnf
the advice from the creator of mineos is
Quote:
move the relevant files/dirs
/usr/local/var/mysql
/usr/local/etc/my.cnf
to somewhere on your /mnt/hda1. doesnt matter where, but choose an appropriate place.
or better yet:
add these symlink commands to your /opt/bootlocal.sh so on every reboot they are recreated (this is recommended over saving it to filetool.lst). Since its on the HD, it'll always be current, regardless of reboots and filetool.sh saves, and you will have the symlinks on each reboot, so you can just one-and-done it.
but i have no idea how to do that or where to even begin looking!
to me it would seem a better solution would be to tell mysql to save its databases and config file in hda1:/mysql rather then using symlinks(google pretty much describes thema s the same as windows shortcuts)
thats problem 1
problem 2,
the server will be running in a vmware machine which i will not have physical access to (a mate is running it on a true server pc) with putty and winscp this is not a problem 99% of the time BUT its crashed twice and on the screeen to fthe machine was what looked like a load of memory addresses and it could no longer be accessed by putyy or winscp i had to reset it
Im guessing that was tinycorelinux version of windows BSOD can i tell it to reset itself should that happen (in the same way you can have windows reset if it bsods)?
how would i do this in another linux? maybe the commands are the same
if it helps to edit files i have to type nano and to download mysql i had to type ab mysql.tzx (then pick it from the menu) then bizzarely and counter intuitively i had to press q then i (this is not a noob friendly os)
i havent just sat here waiting
i tried mv /usr/local/var/mysql /mnt/sda1/database/mysql ...cant rename no such file or folder (there bleeping hell is!)
so i go and create the database folder with mkdir
and then try again
mv: cant preserve ownership of `/mnt/sda1/database/mysql' operation not permited
(one for each file
so i tryed sudo in front of it all ....cant rename .... no such file (arghhhhhhhh)
i have also tried over other option that pops up when you do ab mysql.tcz at one point it downloaded them but refused to install as they were already downloaded
i have googled tiny core linux mysql databse move all the threads i read were no where near what i need
i tried tinycore linux custom install database again nothing of relevence
im at my wits end here i have spent hours trying to fix this, please please please help!
**clarification was hda1 but in my attempts to get this to work i so corrupted the virtual machine i had to reinstall this time i tryed a serial virtual hd instead of a ide one in the hopes that would be the magic key to getting this to work**
what is did is i created a script file in /mnt/hda1/ and called it mysql_set.sh
this is what it contains
Code:
!/bin/sh
# put other system startup commands here
sudo rm -r /usr/local/var/mysql/
sudo rm /usr/local/etc/my.cnf
# change hda1 to whatever drive that the file are stored one
# eg if you have it stored on sda1 then it will be this
# ln -sf /mnt/sda1/database/mysql /usr/local/var/mysql
ln -sf /mnt/hda1/database/mysql /usr/local/var/mysql
ln -sf /mnt/hda1/database/my.cnf /usr/local/etc/my.cnf
I then add this to the bootlocal.sh file in /opt/
such that the file now looks like this
Code:
#!/bin/sh
# put other system startup commands here
mnt/hda1/mysql_set.sh
To quickly explain it
When tinycorelinux loads up it create all the directory in the ram this includes the
/usr/local/var/mysql/
and
/usr/local/etc/my.cnf
and as far as i know you can't put symlink to it if it already exist
Therefore I removed them at startup, then symlink them in to where i removed them
from
Can you just explain what you mean by "conflicting addresses" (is newish to linux, been using on and off for 3 years)
but currently I have no problems
Quote:
mv: cant preserve ownership of `/mnt/sda1/database/mysql' operation not permited
(one for each file
I had no problems with that, I stopped the MySQL server before moving them, I also moved them as root
One difference is I am running a clean non-remaster version of tinycore, compared to the orginal problem of "mrgreaper" tincore OS being tinecore re-masted as "MineOS" to support Minecraft server
edit:
--------------------------------------------------------------------------------------------------
My friend was running MineOS for a while, until we started having some issues with it, and then we moved it to another distribution
I have had tinycore crash on me (that was prior to moving it to the databases and htdocs to HDD, tinycore doesn't run to well if you exceed the amount of ram you have and swap)
I take this to mean you're not the original poster & your script is most likely the solution that the op needs. What I pointed out on conflicting addresses or devices, I highlighted in red.
Quote:
One difference is I am running a clean non-remaster version of tinycore, compared to the orginal problem of "mrgreaper" tincore OS being tinecore re-masted as "MineOS" to support Minecraft server
@winfind01 I could be wrong though as I see you have the same device names, so I see why you may have been offended by statement. But I did say may have conflicting addresses.
Yer I see what you mean by conflicting address, I did that script based on my own server, will put in comment(s) to suit
if they are running if form a diiferent localion than just hda1 then thre will be a problem with just inserting that script
I think "mrgreaper" is running it on sda
It can be modify to suit
Quote:
Originally Posted by www.thelinuxlink.net
Syntax: ln [option] [target] [link name]
-s, --symbolic: Make symbolic links instead of hard links -S [suffix], --suffix=[Suffix]: Override the usual backup suffix. See below
-target-directory=[directory]: Specify the directory in which to create the links.
-f, --Force: Remove existing destination file(s
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.