LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-10-2009, 12:48 AM   #1
Neilevan814
LQ Newbie
 
Registered: May 2008
Posts: 9

Rep: Reputation: 0
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!
 
Old 02-10-2009, 02:17 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
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.
 
Old 02-10-2009, 02:21 AM   #3
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
Please delete this post. Sorry, slow network -> error -> double post…

Last edited by theYinYeti; 02-10-2009 at 02:23 AM.
 
Old 02-10-2009, 11:48 PM   #4
Neilevan814
LQ Newbie
 
Registered: May 2008
Posts: 9

Original Poster
Rep: Reputation: 0
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
 
Old 02-11-2009, 03:57 AM   #5
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
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.
 
Old 02-11-2009, 11:40 PM   #6
Neilevan814
LQ Newbie
 
Registered: May 2008
Posts: 9

Original Poster
Rep: Reputation: 0
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
 
Old 02-11-2009, 11:58 PM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,036

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
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.
 
Old 02-12-2009, 03:13 AM   #8
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

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

Yves.
 
Old 02-19-2009, 03:19 AM   #9
Neilevan814
LQ Newbie
 
Registered: May 2008
Posts: 9

Original Poster
Rep: Reputation: 0
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.
 
Old 02-19-2009, 04:07 AM   #10
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
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.
 
Old 02-19-2009, 04:20 AM   #11
Lancelot1
Member
 
Registered: Dec 2007
Location: Amsterdam
Distribution: (K)Ubuntu
Posts: 102

Rep: Reputation: 15
Quote:
Originally Posted by theYinYeti View Post
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!
 
  


Reply

Tags
apache2, partitionioning, ssh public key


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgrading to larger hard disks - How do I set about it. arnoversfeld Linux - Hardware 3 06-14-2008 10:42 AM
Upgrading Fedora Core 4 after doing minimal set up manchandap Linux - Software 5 05-31-2006 07:18 AM
saving a compiled folder for future installation as zip? webazoid Linux - Newbie 2 07-06-2004 07:01 PM
How to set a Gnome theme as default for all users and future users ? MDesigner Linux - Newbie 1 06-28-2004 11:12 AM
Upgrading Debian - Past and Future... TheSwine Debian 4 01-05-2004 11:03 AM


All times are GMT -5. The time now is 09:30 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration