PDA

View Full Version : [ubuntu] 8.04 Installation without overwriting home folder?



Redenbacher
April 24th, 2008, 08:23 PM
I downloaded and burned the image of 8.04 on to a CD as soon as it was available this morning, and installed it instantly, pain free. Just one question:

I wanted to do a clean install around my current home folder, as the road map said could be done.

When I went through the options, there was nothing to opt for this, and after installing, I had given 8.04 it's own partition somehow. It did let me import information from my 7.10 installation, however.

How do you go about installing fresh and keeping the contents of your home folder, without creating a new partition?

eyelessfade
April 24th, 2008, 08:27 PM
Just don't set home partition when installing. and edit /etc/fstab after

Redenbacher
April 24th, 2008, 08:36 PM
Edit after the installation? Wouldn't that wipe the hard drive clean for a fresh install?

sandman_1993
April 24th, 2008, 08:40 PM
No, if you know what to do. I edit fstab to automaticaly mount my ntfs partitions.

oddworld
April 24th, 2008, 08:45 PM
Worked pretty well for me, thanks

jocko
April 24th, 2008, 08:50 PM
The simplest way would be to make a new partition, copy your current /home directory (including all hidden files) to it, and then install.
During the installation you just make sure to set the new partition to mount in /home and don't format it.

Redenbacher
April 24th, 2008, 10:38 PM
Can I create the /home partition and copy files to it within the installation procedure, or do I have to boot, create the partition, boot and log in, copy files, and then boot to install?

jocko
April 24th, 2008, 10:44 PM
Can I create the /home partition and copy files to it within the installation procedure, or do I have to boot, create the partition, boot and log in, copy files, and then boot to install?
If you boot a live cd, you can use gparted (System --> Administration --> Partition Editor) to make the new partition and format it.
Then you can mount it, copy the files, unmount it and start the installer.
There should be no need for any reboot.

ssam
April 24th, 2008, 10:55 PM
tell it to install onto an existing install. make sure the format this partition is not ticked.

you should get a message along the lines of

"this partition already has ubuntu installed on it. i will delete all the system folders, but leave your home folder alone"

no need for seperate partitions.

still, please do a back up first.

Redenbacher
April 24th, 2008, 11:01 PM
Oh of course I want to back up, which I think may end up being on to my buddy's iPod... Anyway, I recall only 3 options on the partitioner menu

Allocating size for a new partition
Using the whole drive
Manual

Which would allow me to:

1) Delete the accidental partition made for 8.04
2) Format the accidental partition so that it can be used as before the accident
3) Install over the existing installation as I should have in the first place.

This is getting complicated, and it might be in my best interest to just copy my files to something external and redo everything. All the same, I thank you all for your help

ssam
April 24th, 2008, 11:18 PM
Oh of course I want to back up, which I think may end up being on to my buddy's iPod... Anyway, I recall only 3 options on the partitioner menu

Allocating size for a new partition
Using the whole drive
Manual

Which would allow me to:

1) Delete the accidental partition made for 8.04
2) Format the accidental partition so that it can be used as before the accident
3) Install over the existing installation as I should have in the first place.

This is getting complicated, and it might be in my best interest to just copy my files to something external and redo everything. All the same, I thank you all for your help

Manual

colawrence
April 24th, 2008, 11:59 PM
I do this all the time. If you have your /home dir mounted on its own partition, it will be best and easiest to do. If not, you must copy it to a new partition before proceeding. I recommend that you do it something like this. Use gparted (or something similar) to create a new partition on some drive. Exit gparted and mount the new partition to some temp mount point then copy your /home dir to this new temp dir. Remember where you made the partition in gparted, because you will need it later when configuring your partitions for the new install. You have just made a second copy of /home in its own partition, so the original /home under / (root) can be formatted away during the install.

Choose to manually (last radio button) partition your drives during the install, it will scan your existing drives and report back any pre-existing partitions. You must know ahead of time where your pre-existing /home partition is. Just select the partition where you know your /home is and then click on the edit button. Choose the /home mount point from the drop down list and be CERTAIN that the format box is NOT checked. Carefully configure any other partitions to be either created or reused as you desire and continue with the install. The new system will automatically mount your /home partition. No need to fuss with fstab.

Hope this helps. I am recalling this from memory, so I may have left out some detail, but I know it works. I have done it many times with no problems, but I do have my /home on its own partition. If you don't then you must create a partition and copy your /home to it before proceeding.

Good luck.

Redenbacher
April 25th, 2008, 12:37 AM
I think that is the best way to do it as well, colawrence, at this point. Can I increase the size of that temp partition without wiping it?

joshsackett
April 25th, 2008, 02:18 AM
I tried following your instructions from above but I get the error message "No root file system is defined."

Here is what my screen looks like:

/dev/sda
-/dev/sda1 FAT16 31MB
-/dev/sda2 NTFS 10000MB
-/dev/sda3 ext3 8000MB
-/dev/sda4 swap 400MB


/dev/sda3 is where I have an installation of 7.10 that I wish to completely overwrite (as opposed to upgrade.) I select that line, click EDIT and follow your instructions from above (except I select the "ext3" file system, which you didn't say explicitly, but I guess I am supposed to do.)

Any help? Thanks.

colawrence
April 25th, 2008, 03:47 PM
I think that is the best way to do it as well, colawrence, at this point. Can I increase the size of that temp partition without wiping it?
I can only talk about gparted, but I think qtparted is also very similar. As long as there is any room left on the drive, you can resize and/or move about any partition. You may have to make some room by shrinking a larger partition some. You may have to reposition the partitions to get contiguous space. Gparted is quite flexible and has a nice graphic interface . Just select a partition and the buttons become active, or select and right click for a context menu.

Redenbacher
April 25th, 2008, 04:05 PM
I tried following your instructions from above but I get the error message "No root file system is defined."

Here is what my screen looks like:

/dev/sda
-/dev/sda1 FAT16 31MB
-/dev/sda2 NTFS 10000MB
-/dev/sda3 ext3 8000MB
-/dev/sda4 swap 400MB


/dev/sda3 is where I have an installation of 7.10 that I wish to completely overwrite (as opposed to upgrade.) I select that line, click EDIT and follow your instructions from above (except I select the "ext3" file system, which you didn't say explicitly, but I guess I am supposed to do.)

Any help? Thanks.

The reason it is saying no root filesystem defined is because you have to make sure one partition is mounted as "/"

You will keep the ext3 filesystem, just make sure to mount as /. I think that is all. Make sure to back anything up in there just in case so that you can bring it back later if something goes awry. I actually ended up sticking my entire home folder on a friends external HD and copied it all back over. But that was only because my partitions were all messed up.

I didn't use gparted, I used the ubuntu livecd utility, and my layout is now as follows:

/dev/sda1 / ext3 15.0 GB
/dev/sda2 /home ext3 ~69 GB
/dev/sda3 swap ext3 1.5GB

/ is the root file system where Ubuntu will be installed
/home is my /home folder
swap ...Not really sure what swap does but everyone has one so I figured I should keep it around!

Either way everything is working smoothly and I must say that Hardy is a very worthwhile upgrade.

colawrence
April 25th, 2008, 04:31 PM
I tried following your instructions from above but I get the error message "No root file system is defined."

Here is what my screen looks like:

/dev/sda
-/dev/sda1 FAT16 31MB
-/dev/sda2 NTFS 10000MB
-/dev/sda3 ext3 8000MB
-/dev/sda4 swap 400MB


/dev/sda3 is where I have an installation of 7.10 that I wish to completely overwrite (as opposed to upgrade.) I select that line, click EDIT and follow your instructions from above (except I select the "ext3" file system, which you didn't say explicitly, but I guess I am supposed to do.)

Any help? Thanks.
I'm not sure if I understand what you are trying to do. It looks like you have only one drive /dev/sda with 4 partitions. You say /dev/sda3 is the partition you want to install 8.04 into. Are you wanting to preserve the /home dir that is in that partition or just wipe that partition clean with the new install? It looks to me that your 7.10 install only has the / (root) partition defined (in addition to a swap partition) and everything else is "under" it so to speak. You must have a root partition defined, that is why you got the error. It is best to have it formatted ext3. If it is OK to wipe the existing /home dir, then just define the /dev/sda3 with a / mount point and format ext3, and /dev/sda4 as a swap partition. The other partitons do not appear to be native Linux, so leave them alone and proceed with the install. If you want to preserve the /home dir from the 7.10 install, then you must create a partition for it somewhere on your drive. You could free some space for it by shrinking the /dev/sda2 partition down from 10GB size and using that freed up space for your /home partition. Gparted is great for doing these kind of things. After creating the partition, you must boot into 7.10, mount the new partition to some temp location, then copy the /home to the temp location. You could use these commands:
sudo mkdir /temp
sudo mount /dev/sda5 /temp (assuming your new partition is /dev/sda5)
sudo cp -a /home/ /temp/ (the -a preserves all file attributes)
Now you have a second copy of 7.10 /home dir out on your drive in the /dev/sda5 partition. Next, go to the install of 8.04 and manually define your /dev/sda5 partition to mount at /home with NO format, and define your existing /dev/sda3 to mount as / with format to ext3, and define /dev/sda4 as a swap partition, and you should be ready to proceed with the install. All partitions will mount automatically in new install.

Hope this helps.

colawrence
April 25th, 2008, 04:54 PM
If what ssam says in his previous post is true, then that will be the way to go. No need for separate partition, no copying of files needed. Just tell the installer to install to an existing previous install partition with NO format, and it is smart enough to recognize the fact that a previous install exists and it will erase everything EXCEPT your /home dir and install around it. That's a great tip to know. I still want to have the /home dir in its own partition though.

UPDATE:

I confirmed what ssam said to be true. The message you get is a long one and I only paraphrase it here, but it says that the partition you chose is not marked for formatting, and that the install will erase all "system" folders and leave others alone. The /home is not a "system" dir, so it is indeed felt intact. I'm not sure what other "non-system" folders are there. Matbe someone can follow up with an answer. So thanks to ssam for this great tip. I did not know it worked that way. I had never tried to install into a / (root) partition that I did not mark for formatting. I still like the idea of a separate partition for /home dir, preferably on a different drive.

shyangz
December 15th, 2008, 08:48 AM
Thanks to this thread, I successfully installed 8.04.. had exactly the same problems as Joshsackett, and also wanted to clean install 8.04 over the existing 7.10. the bonus was after everything was set up i found my previous 7.10 files in the 8.04 as well! :P