While doing the first installation of Ubuntu 12.04 I've made a separate partition for the system, to be able to reinstall it without having to clear all data. So I have /
on one partition, and second is divided in 2 logical partitions, one for swap, the other for /home
.
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00027dec
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 50479103 25238528 83 Linux
/dev/sda2 50479104 625142447 287331672 5 Extended
/dev/sda5 50481152 54478847 1998848 82 Linux swap / Solaris
/dev/sda6 54480896 625141759 285330432 83 Linux
I'd like to reinstall the system (I've messed up something with the repositories and there are some other problems, I'm not even sure if it's software or hardware...) My point is that if I reinstall the system on /
partition, the new /home
would be also on /
... Now, when I'm installing something, it goes automatically to /
and if I download or write something it's automatically placed in /home
. Is it possible to indicate to the newly installed system, that the /home
is on the other partition without reinstallation of /home
(and having to copy the data twice).
UPDATE
I've tried the first solution from the Marty's Fried reply: I've installed /
on previous /
("format" box checked) and /home
on previous /home
("format" box unchecked). First I've give an other username than previously. Everything seemed to work fine, only I hadn't my home
in my home
(there was a new user home
).
I've repeated the installation, and now all my files are easily accesible, but the system is not working well. I wanted to start by installing classic gnome (I can't find anything otherwise) and I'm not able to open the terminal. There is just the frame of the terminal window, flashing and moving towards the screen. Is it possible that in my home
partition there are some problems which may provoke this?
One thing you should realize is that a lot of configuration is in your home directory, so you might find that you don't get the results you hoped for. However, the repositories list is not in your home directory, so that part may be OK.
To do what you want, you can simply reinstall, and do one of two things.
Install normally, specifying the current root partition for the new root, and checking the "format" box; then specify the current
/home
partition for/home
, but do not check the "format" box. This will replace system-related files in your home directory, but not erase other files.Install normally, as above, but only specify the root partition for everything, leaving the home partition out of the equation completely. This will install a new home directory. You can then mount your existing home directory with the new
/home
as the mountpoint. This will hide the existing files, and if you have a problem, you can edit/etc/fstab
to disable the mount, or mount it in a different mountpoint.Once everything is working, you could either boot off a live CD to erase the newly installed but unused
/home
, or you could temporarily unmount it to delete the directory. Just don't delete it while it's mounted, because you will delete the mounted files, not the actual file that are hidden.EDIT:
My opinion is I'd advise fixing the problem without reinstalling, if possible. It's probably not difficult, and you'll learn along the way. It's comforting to be able to fix things rather than reinstalling, and with Linux, it's not that difficult (unlike windows).
You may need to make a couple of posts, one for each problem, with more specifics. For example, the repositories are simply a list in a file, and you can either edit the file, or use synaptic, and clicking the menu "Settings", "Repositories". It's often easy to find which one is the problem, and remove it. Then refresh, and see if it fixes the problem.
More of my opinion:
Because there is so much configuration in the home directory that is release specific, I quit creating a separate
/home
partition. What I have found to be more useful is to create a separate data partition, containing directories such as/Documents
,Music
,Videos
,Pictures
,Downloads
, and whatever else I want. Then, I simply create symbolic links for these directories, delete the folders in my home directory, and replace them with the symbolic links. If you use the same names, and don't log out first, they will even have the special icons for those directories, and will act just like the originals.The advantages of this method are that you don't end up with a lot of unneeded junk when you upgrade, you avoid problems with old configurations not getting replaced when you do, and if you use Windows, you can point the Windows equivalents to these same directories (assuming you use NTFS that Windows can read); also, if you ever try out other distros, you can quickly use your existing media files for easy evaluation.
If you are good at editing
/etc/fstab
, you could mount the directories instead of using links, but I find the links are easy to use, and have worked well over a long period of time.