Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Keeping OS separate from ALL data (not just /home)

  • 13-12-2009 1:46pm
    #1
    Registered Users, Registered Users 2 Posts: 3,745 ✭✭✭


    My query specifically concerns Ubuntu, but Im sure this is the same for a lot of Linux distros.

    When I reinstalled Ubuntu 9.10 I used a separate /home partition. The other day it wouldn't load so I installed 9.04 on another partition, then set fstab settings to point /home to the 9.10 /home partition and most settings and data got carried through. However a few things didn't, such as the MySQL databases for my server, and in fact the default location of Apache.

    My question is: what sub-directories of root should be on separate partitions to ensure that ALL personal data can be used by different distributions?

    I know /home must be, and I think /var holds Apache stuff (as well as other things). Is there any others?

    :)


Comments

  • Registered Users, Registered Users 2 Posts: 545 ✭✭✭ravydavygravy


    Its a bit tricky - you don't want to preserve all of /var, just the bits related to mysql or apache or whatever... (/var/lib/mysql for example has all your mysql DBs)

    Why not just backup this data to your home folder (or to another machine) on a regular basis? It could be as simple as putting something like this in your crontab:
    ### Backup all dbs every hour, on the hour
    05 * * * * mysqldump --quick -uroot -pxxxx --all-databases > db_backup.sql && gzip db_backup.sql
    

    I personally gave up using multiple partitions years ago, apart for my dual boot WinXP/Fedora netbook which has a separate fat32 partition which has all my music and videos - mouted in WinXP as D: and as /data in fedora


  • Closed Accounts Posts: 4,564 ✭✭✭Naikon


    Some configuration files can be spread over /usr/share and /usr/local.
    /home, /var, and /etc tend to be the main ones though.


  • Closed Accounts Posts: 228 ✭✭gnxx


    I've tried this for almost 20 years now ... still can't get it 100% :-)

    You can get all user data onto a separate partition. We run apache, mysql and applications from their own partition. We've made some changes to the various config files.

    We did take the two partition approach ( / and /data ) for a while but had problems with /var and /tmp.

    We now always put /var and /tmp onto their own partitions. This is mainly to avoid an errant program filling the / partition. For example, mail queues or system logs can fill /var.

    I've configuration files etc that are modified for mysql and apache -- drop me a PM if you want them.


  • Registered Users, Registered Users 2 Posts: 3,745 ✭✭✭Eliot Rosewater


    The original rationale for separating them was that I could do web dev, which includes editing mySQL databases, on either Ubuntu distro I have now, or any other distro in the future.

    I tried editing the MySQL config to point to /home/data but the MySQL server wouldst restart. I then reset the settings, and it wouldn't restart again. But once I restated the whole OS, it was fine.

    I think the solution might be to create subdirectories on the /home partition to hold data that would otherwise be on other partitions, edit config settings accordingly, and then save a copy of these config settings on the /home partition so in case of a new install I would just have to paster them over. I did this to an extent - my Apache server points to /home/server already.

    From reading here I would need to do a lot of tinkering to get full data separation.


  • Closed Accounts Posts: 228 ✭✭gnxx


    The original rationale for separating them was that I could do web dev, which includes editing mySQL databases, on either Ubuntu distro I have now, or any other distro in the future.

    I tried editing the MySQL config to point to /home/data but the MySQL server wouldst restart. I then reset the settings, and it wouldn't restart again. But once I restated the whole OS, it was fine.

    I think the solution might be to create subdirectories on the /home partition to hold data that would otherwise be on other partitions, edit config settings accordingly, and then save a copy of these config settings on the /home partition so in case of a new install I would just have to paster them over. I did this to an extent - my Apache server points to /home/server already.

    From reading here I would need to do a lot of tinkering to get full data separation.

    From memory, I had huge problems getting mysql to move its data into a specified location. We had to modify the mysqld script to specify a --data-dir. Note that the mysql setup program ignores this, so when you first initialise your database the data will be in the default directory and will need to be moved. Remember after moving that you will need to fix permissions.


  • Advertisement
Advertisement