LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-14-2008, 08:11 AM   #1
JMJ_coder
Member
 
Registered: Apr 2006
Distribution: Fedora
Posts: 478

Rep: Reputation: 30
Reusing /home partition


Hello,

During the installation process for Unix/Linux systems, you can partition the hard disk to have a separate /home. So the disk might look something like this:

Code:
/     - hda0 - 50 MB
swap  - hda1 -  2 MB
/home - hda2 - 10 MB
The general premise of this structure is that if you need, for whatever reason, to reinstall the system, you can reuse your /home partition and preserve your own data.



My question is, how do you do this? Assuming you have the drive partitioned as above and you are reinstalling the system - how do you install the system without it re-formatting your /home partition?
 
Old 05-14-2008, 08:26 AM   #2
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
The installer should give you the option to mount other partitions to various parts of the filesystem, in which case you tell it to mount that partition as the new /home but don't format it.

Alternately, you could tell the installer nothing about that partition so that it installs everything to the first partition, and then manually set up /home on the other partition after the system is installed.
 
Old 05-14-2008, 08:41 AM   #3
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Just like MS3FGX described. I'll add to it only that even though the installation programs may differ in their outlook, they all (if they do allow you to do manual partition, which all should) provide you with two things to do in the "partitioning step": first create the partitions to use, then map the partitions to mount points. Sometimes partitioning is done first and "marking partitions to mountpoints" later (Slackware setup, for example), sometimes they are done in the same place (Ubuntu alternate disc setup, for example).

Slackware for example asks you to partition your disk prior to running the setup program, using fdisk or cfdisk, and this step you do as you'd usually do, but just leave the partition where your /home used to be, intact. Then you proceed to setup and set up swap, then set up root partition and then set the partition that contains home directories to be mounted under /home - Slackware's setup says at this point something like "select any extra partitions you want to use and choose their mountpoints". Simply set it to be mounted under /home then, and the setup does as wanted. The partition won't get formatted, because you didn't format it prior to setup, and when setup asks, you say "no thanks, don't format".

Or if the partitioning tool has something like one window for selecting the filesystem for a given partition and the other options including mount point, you fill the information as needed (but don't change filesystem - that forces you to format the partition) and make sure the box "format partition" is not checked. And continue.

The same applies to other mount points than home as well; they are simply partitions that contain a filesystem and data, and the setup wants to know where (in the filesystem tree) you want to mount them and possibly if you'd like to format them to use some filesystem, which is not necessary. It's just the same if you would do it after the setup yourself, add entries to /etc/fstab, but easier during the setup..and if you start thinking about it, you could mount the home partition as /stuff, then set the necessary configurations (like $HOME variable and such) to point there and you could have your "home" called "stuff" instead, and it would probably work - unless some programs have hard-wired path for /home, which they shouldn't have. I think only root partition must be selected (and set a mount point of /) during setup, so the system knows where root is, but the rest are up to you to add.

Don't forget to reuse swap partition either, if you want. It's small compared to nowadays' disk spaces, but reusing is always saving space.
 
Old 05-14-2008, 12:57 PM   #4
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 3,896

Rep: Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774Reputation: 774
Code:
/     - hda0 - 50 MB
swap  - hda1 -  2 MB
/home - hda2 - 10 MB
It might look something very like that, but with the 'M' replaced by a 'G'?

The previous answers were correct, but I'd just like to add one thing: remember that the Unix-y way of doing things stores the configuration files for the various programs that you use in the home directory as hidden files (files whose name starts with a '.'). The potential issue here is that if you are upgrading from one verion to another of your distro, or, more likely, if you are distro hopping, there is an issue whether these configuration files should be stored or blown away and a fresh set installed.

I'm not sure that there is an 'algorithmic solution' that is guaranteed to always work, but if you have difficulties with a certain app after the process, you might try blowing away the old config file manually and re-installing.
 
  


Reply


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
,dmrc problem after moving /home partition to NTFS partition yeehung Linux - Newbie 1 11-14-2007 06:17 AM
Reusing a custom built kernel on a new installation dizzi Slackware 4 08-01-2007 03:57 PM
reusing ubuntu6.10 splash screen madonion87 Ubuntu 2 10-31-2006 09:47 PM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 10:19 PM
Reusing .config during kernel rebuild ssu4716 Linux - General 1 04-01-2002 12:06 PM


All times are GMT -5. The time now is 02:53 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