LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Move mysql stuff to hda1 (mineos(tinycorelinux)) and auto reboot on crash (https://www.linuxquestions.org/questions/linux-newbie-8/move-mysql-stuff-to-hda1-mineos-tinycorelinux-and-auto-reboot-on-crash-862828/)

mrgreaper 02-15-2011 08:35 AM

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.

then, symlink it:

ln -sf /mnt/hda1/database/mysql /usr/local/var/mysql
ln -sf /mnt/hda1/database/my.cnf /usr/local/etc/my.cnf

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)?


thnx in advance

mrgreaper 02-15-2011 01:42 PM

im guessing tinylinuxcore is not widely used

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)

please help

mrgreaper 02-16-2011 08:10 AM

please i really need some help

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**

wfinden01 03-10-2011 04:21 PM

Hello

If you still need help with this

I did get it to work, thought in a roundabout way

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

Hope this helps

P.s I have only just started using tinycore linux

EDDY1 03-10-2011 04:38 PM

I'm not at all familiar with what it is that you're doing , but you may have conflicting addresses:
Quote:

ln -sf /mnt/hda1/database/mysql /usr/local/var/mysql
ln -sf /mnt/hda1/database/my.cnf /usr/local/etc/my.cnf
Quote:

mv: cant preserve ownership of `/mnt/sda1/database/mysql' operation not permited
(one for each file

wfinden01 03-10-2011 05:06 PM

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)

EDDY1 03-10-2011 05:25 PM

@wfinde01 Are you the original poster?

EDDY1 03-10-2011 05:32 PM

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

EDDY1 03-10-2011 05:44 PM

@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.

wfinden01 03-10-2011 05:57 PM

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

^ this is from: http://www.thelinuxlink.net/lvlinux/...mmands/ln.html

EDDY1 03-10-2011 06:08 PM

Believe me I know nothing about what is to be accomplished, just observing and putting in my 2 cents.


All times are GMT -5. The time now is 09:32 PM.