LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Best partition set up for future upgrading OS or re-installation (http://www.linuxquestions.org/questions/linux-general-1/best-partition-set-up-for-future-upgrading-os-or-re-installation-703521/)

Neilevan814 02-10-2009 01:48 AM

Best partition set up for future upgrading OS or re-installation
 
Okay, I hope I will be clear here. I want to set up a very minimal use apache server and ssh server on my new desktop computer build. What I want to attempt to do, since this will also serve a purpose for storing data, music, movie, etc type files, is to have a large disk of which one partition will be solely a data store. My question is if I partition my installation disk to have a separate partition for /home,for /var, for /etc, if I need to reinstall ubuntu or upgrade will this set up preserve my ssh server and apache server settings? Will I have to reconfigure fstab on the reinstalled OS to resume the use of my /home, /var, and /etc partitions then? I hope this makes sense because I am not sure, but am trying to get the whole picture. Thanks in advance for the help!

theYinYeti 02-10-2009 03:17 AM

A reinstall never keeps settings, and it is not advisable to do so (although it is possible) as the versions of software from the newly installed distribution may be configured entirely differently from the versions of software from the replaced distribution.

However, if you intend to upgrade keeping the same “family” (eg: from Mandriva 2008 to Mandriva 2009), then… why not. RPM has a feature that would help you in this regard: important installed configuration files replace the old ones but these are saved with the extension “.rpmsave”, and less important installed configuration files are only stored with the extension “.rpmnew” without replacing the old ones. Then there's the “etc-update” program that will help you review the differences and keep the good file or merge them.

Were it my own project, given it's not a production server but rather a minimal home-use one, here's how I*would setup things: Two partitions: / and /keep (adapt this name to your liking; I personally use “/ici”, which in French means “/here”), plus swap of course.
Then setup directories like this:
Code:

/                        (root partition, controled by the distribution)
/keep                    (partition controled by you, to be kept intact upon reinstall)
/keep/home              (parent directory of all home-directories)
/keep/home/you          (your home directory :) )
/keep/av                (or any other name, such as “media”: place for pictures, movies, music…)
/keep/.sys              (hidden directory for system files that are important to you)
/keep/.sys/_etc_httpd    (where the real configuration is for Apache)
/keep/.sys/_etc_ssh      (where the real configuration is for SSH)
/keep/.sys/_var_www_html (where your web pages are)

On first install, you would have to do this:
Code:

# mv /etc/httpd    /keep/.sys/_etc_httpd
# mv /etc/ssh      /keep/.sys/_etc_ssh
# mv /var/www/html /keep/.sys/_var_www_html
# ln -s /keep/.sys/_etc_httpd    /etc/httpd
# ln -s /keep/.sys/_etc_ssh      /etc/ssh
# ln -s /keep/.sys/_var_www_html /var/www/html

From then on, you'll be able to safely overwrite the / partition because your home directories, media data, web pages, and important configuration files are on another partition: /keep. I use this kind of partition layout because for home use, it allows great flexibility regarding how much space is available, without the need to use LVM, which is easy to setup, but not that easy to maintain.

Yves.

theYinYeti 02-10-2009 03:21 AM

Please delete this post. Sorry, slow network -> error -> double post…

Neilevan814 02-11-2009 12:48 AM

Great scheme
 
Thank you very much for your input. I believe this is the type of answer I have been searching for. This will help me out immensely.

Thanks a lot for your efforts!
Sincerely, Neil

theYinYeti 02-11-2009 04:57 AM

You're welcome :)

Feel free to ask for details if needed. I have been successfully using this kind of layout for years and I'm very happy with it.
At home, I also have /ici/.sys/_opt (linked-to from /opt) and /ici/.sys/_usr_local (linked-to from /usr/local), both of which I use for self-compiled application (from source code).

Yves.

Neilevan814 02-12-2009 12:40 AM

Thanks for the support
 
I suppose as a preliminary after thought. How large of a partition should I choose for / ? I just want to make sure there is room on this partition to grow with added applications in the future if needed.

Thanks so much, Neil

i92guboj 02-12-2009 12:58 AM

That depends on the distro and your setup.

For a regular distro 5-10gb should be more than enough.

If you are a gamer then you'll need more.

If you are going to have separate partitions for /var. /tmp and /usr then you'll be fine with a few dozen or hundred MB's in /... it all comes down to what are you planning to install, what directories will be holding the big stuff, and if you are going to separate partitions for those.

theYinYeti 02-12-2009 04:13 AM

I usually settle for 7G for a work PC, and 12G for a game/audio/video PC, with Mandriva.

Yves.

Neilevan814 02-19-2009 04:19 AM

Hello again, I am sorry for not getting back sooner. I wasn't aware you were still reading the thread and responding. I thank you. I am now doing a partitoning set up on a new HTPC build I put together tonight. I am sure I will re do my efforts several times before I am satisfied and committed with a scheme and a linux OS of favor. I have run into a question, though as to how to partition. I am starting on a 250gb drive. I have created an extended partition of 100gb. In this extended partition I have created a logical partition ext3 of 20 gb which I will mount as root, I logical partition ext3 of 20gb which I will mount as home, logical partition swap of 3 gb, and about an 80 gb ext3 logical partiton which I am only being given several named options to mount it as, so now I am stuck and was wondering if the partition scheme you have is all created withinan extended partiton or of you have created additional primary partitions, or what. Thanks for helping me out of my confusion.

theYinYeti 02-19-2009 05:07 AM

So you currently have, for a total of 123G:
/dev/sda5 mounted on / (20G)
/dev/sda6 mounted on /home (20G)
/dev/sda7 as swap (3G)
/dev/sda8 mounted on /some/place (80G)

In my partition scheme, I would rather have, for a total of 123G:
/dev/sda5 mounted on / (20G)
/dev/sda6 as swap (3G)
/dev/sda7 mounted on /keep (100G)

Of course, the installer insists on creating a /home directory and a first user, to which I give a bogus name. Next to (re)installation, I login using the bogus user, and create (first time) / reconnect (next times) the real users with their homes in /keep/home. Then I delete the bogus user, and the whole /home directory which is now useless. The only exception is the root user, the home of which I always keep under /root, because in case of maintenance/rescue, I don't want to have to have /keep mounted.

I hope this helps. Please tell me if I'm beside the point or if you need further explanations.

Yves.

Lancelot1 02-19-2009 05:20 AM

Quote:

Originally Posted by theYinYeti (Post 3438042)
A reinstall never keeps settings, and it is not advisable to do so (although it is possible) as the versions of software from the newly installed distribution may be configured entirely differently from the versions of software from the replaced distribution.

However, if you intend to upgrade keeping the same “family” (eg: from Mandriva 2008 to Mandriva 2009), then… why not. RPM has a feature that would help you in this regard: important installed configuration files replace the old ones but these are saved with the extension “.rpmsave”, and less important installed configuration files are only stored with the extension “.rpmnew” without replacing the old ones. Then there's the “etc-update” program that will help you review the differences and keep the good file or merge them.

Were it my own project, given it's not a production server but rather a minimal home-use one, here's how I*would setup things: Two partitions: / and /keep (adapt this name to your liking; I personally use “/ici”, which in French means “/here”), plus swap of course.
Then setup directories like this:
Code:

/                        (root partition, controled by the distribution)
/keep                    (partition controled by you, to be kept intact upon reinstall)
/keep/home              (parent directory of all home-directories)
/keep/home/you          (your home directory :) )
/keep/av                (or any other name, such as “media”: place for pictures, movies, music…)
/keep/.sys              (hidden directory for system files that are important to you)
/keep/.sys/_etc_httpd    (where the real configuration is for Apache)
/keep/.sys/_etc_ssh      (where the real configuration is for SSH)
/keep/.sys/_var_www_html (where your web pages are)

On first install, you would have to do this:
Code:

# mv /etc/httpd    /keep/.sys/_etc_httpd
# mv /etc/ssh      /keep/.sys/_etc_ssh
# mv /var/www/html /keep/.sys/_var_www_html
# ln -s /keep/.sys/_etc_httpd    /etc/httpd
# ln -s /keep/.sys/_etc_ssh      /etc/ssh
# ln -s /keep/.sys/_var_www_html /var/www/html

From then on, you'll be able to safely overwrite the / partition because your home directories, media data, web pages, and important configuration files are on another partition: /keep. I use this kind of partition layout because for home use, it allows great flexibility regarding how much space is available, without the need to use LVM, which is easy to setup, but not that easy to maintain.

Yves.

I don't know what the rules concerning stickies are but I think this post should be "rewarded" with a sticky. It's exactly the right info to keep up as it is imho very usefull for any future installs and upgrades. Thanks Yves!


All times are GMT -5. The time now is 01:56 AM.