Raid 1/10 on Fedora 15 and /var full

Mat Kovach siddfinch at f-m.fm
Thu Jul 19 12:25:24 UTC 2012


Aero Maxx wrote:
> On 19/07/2012 11:08, Ed Greshko wrote:
> >On 07/19/2012 06:00 PM, Aero Maxx wrote:
> >>I have a raid 1/10 setup working great doing what it does, but the /var partition
> >>which I wasn't aware of until now is where my mysql database are stored and this
> >>isn't on the raid 10, thats not that much of an issue, I would be gutted if I lost
> >>the data though, but the main issue is that its now become full.
> >>
> >>Where you recommend for this /var to be put, or should I just make that partition
> >>bigger ? for it to be raided that would be very nice.
> >Actually, if I were running mysql I would configure it to have my databases on a
> >partition that doesn't get affected by upgrades.
> >
> >For example, I run plenty of VirtualBox VM's and I keep them on /opt/VMs.  That way
> >it is easy to exclude them when doing an install of the next version of
> >fedora....much like having /home on its own partition.
> >
> >
> I understand the concept, although am a little confused as to how I
> would achieve this, my databases at the moment are in /var/lib/mysql

You could create a directory on your raid'd filesystem, for sake of 
argument let call it /raidedfilesystem and move the mysql files there:

 - mkdir /raidedfilesystem/{db,backup}
 - service stop mysqld
 - chown root:root /raidedfilesystem/backup
 - chmod 770 /radided/filesystem/backup
 - tar czvfp /raidedfilesystem/backup/pre-move-var-lib-mysql-backup.tgz \
   /var/lib/mysql
 - chmod 770 /raidedfilesystem/backup/pre-move-var-lib-mysql-backup.tgz
 - cd /var/lib; find mysql | cpio -pmudv /raidedfilesystem/db
 - mv /var/lib/mysql /var/lib/mysql.orig
 - ln -s /radidedfilesystem/db/mysql /var/lib
 - service start mysqld

Once you have verified that everything is working as expected feel free
to dispose of /var/lib/mysql.orig and the tgz backup as you wish. If this
do not work correctly, you have to solutions to restore.

/mek


More information about the users mailing list