[mythtv-users] ramfs for mysql

Josu Lazkano josu.lazkano at gmail.com
Wed Jan 4 21:30:51 UTC 2012


2012/1/4 Mark Boyum <mark at boyum.us>:
> On Wed, Jan 4, 2012 at 1:02 PM, Simon Hobson <linux at thehobsons.co.uk> wrote:
>> Josu Lazkano wrote:
>>
>>>cp -R /var/lib/mysql /tmp/mysqltmp/
>>>chown -R mysql:mysql /tmp/mysqltmp/mysql/
>>
>> You don't need to fiddle with ownerships and permissions - just use
>> the "-p" option to cp and it will preserve ownership and permissions.
>>
>>>How could I copy all data on system stop and then copy again on system start?
>>
>> If you need to ask that, then it may not be the right option for you.
>>
>> You probably want to modify the mysql start/stop script. The system
>> calls this during startup & shutdown. You need to have the shutdown
>> option copy all the tables to a safe place after stopping the daemon,
>> and the startup option copy the safe copies to the ram disk before
>> starting the daemon.
>> If the system is running for a long time, you almost certainly want
>> to stop mysql from time to time and copy the tables to safe storage -
>> otherwise you risk losing potentially weeks or months of updates. If
>> you've modified the start/stop script, then this could be achieved by
>> a cronjob that just just stops and immediately starts mysql.
>> As a refinement, you could have the start option check to see if the
>> files on ram disk are the same age as those on real disk and skip the
>> copy - thus saving the copy back if the system hasn't been restarted
>> and so has the current DB files already on ram disk.
>>
>> --
>> Simon Hobson
>
> Would the rsync command be a better option than cp?
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users

Thanks again, I started a new page on the wiki: http://www.mythtv.org/wiki/Tmpfs

I will continue editing, feel free to add or modify the content. I am
not english speaker/writer, so I could make some mistakes.

I try it on LiveTV and it is much faster.

Best regards.

-- 
Josu Lazkano


More information about the mythtv-users mailing list