How to re-install Ubuntu keeping your data and settings
YannBuntu pointed me to this doc
It was a revelation.
Authored by YannBuntu it was great, and highly understandable for those who are quite conversant with Ubuntu fixing.
I've written this guide, with the more noobish in mind, particularly because the re-installation was so much easier than trying to fix my system (which we anyway failed to do).
- Bob_Briscoe has provided additional instructions, in the event your system fails to boot. Here!
- Any specific system issues preventing re-installation, should be addressed to the relevant forum.
You have a reason to re-install Ubuntu
It could be because it is clearly no longer working correctly, or you have noticed that it's performance has diminished.
The good news is that you can re-install ubuntu very easily without overwriting your data and settings.
So easily that in fact, it may be the first thing that you do, when trying to rectify any problem that you might have.
You will still need to re-install any downloaded apps, but this is very quick, and when you launch them, they are just as before. Eg. Google-chrome..... had to be re-installed, but on launch all my bookmarks were as before.
However, the main point is:
After around 4 days intensive effort to try to fix my broken ubuntu - I spent only 2hr re-installing it and some apps, and ubuntu was back in operation and running very fast again.
Ok... there was a little bit of prep, but that's a one off.
Once you're sorted for bakups (as you should be anyway) you can re-install whenever you wish.
Here is how you do it, first in brief, and then a fuller explanation:
- Create a list of your log in name, user name, and pcname (Password must be the same)
- Create a back up of 'home'
- Boot from install disk, choose 'something else, Dclick on your '/' partition, choose a file system, choose '/' as your mount (do not format)
- Enter your names and password (same as before), choose to update during install etc.
- Reboot, install updates, install any apps you regularly use that are missing, reboot.
1. Create a list of your 3 log in names - get these wrong and you lose your data.
Note: If you had originally let 'ubuntu install' do its own thing, you would have entered your first Name and Surname, and ubuntu would have auto filled user name, without a capital letter, and would have merged this with the name of your pc (pulled from the bios or wherever).
Take note of the 'name' above your password (log in screen) - you must enter exactly the same during ubuntu install, in the field asking for your name.
At desktop press ctrl+Alt+T and type
to launch file manager. You'll be asked for your ubuntu login password. type it (nothing displays) press enter.
In Nautilus, dclick on 'File System' on the left, and on the right look for 'home'.
Dclick on 'home' and you will see your username under the icon - Take note of that for use during install.
If you close Nautilus - in the terminal you'll see
anothername is the name of your pc.
This is the 3rd name required at install.
So for me, I took care to note all these names, yet on re-install, I entered my first and surname, and all the rest auto filled in correctly.
press ctrl+Alt+T and type
Type or copy and paste the 3 names
into the text editor, and save as 'ubuntu re-install info
' (add this guide and other resource links below, before printing
(By the way..... at re-install, you MUST use the same password that you normally use)
That's the first mission critical step done ie. you have taken note of your 3 login names.
2. Create a back up of the directory called 'home' (see 1. b) above)
Note: you can backup this directory how you want: cloud, different partition, external drive OR not at all if your data has no value to you. The backup is done in case something goes wrong, like a power cut etc.
Repeat 1. b) above and Rclick on 'home' and choose 'properties'.
Take note of how much disk space is being used.
Let's say it's 15Gb (cos you have loads of photos etc.)
You are gonna need a storage device with that much space available and more.
(I used the hard drive from my last laptop, slipped into a case with a usb cable - cost only 15€)
Repeat 1. b) above but now on the left look under the title 'Devices'.
For me I see 'System Reserved', Win7, Home_Data (where I keep my data), 16Gb Filesystem (old data I have kept)
RClick on the usb hard drive icon (the icon should show the usb cactus sign) and choose properties.
This will display the free space.
Delete all the un-needed programs & files, to create the space you need.
You could format the drive, using say 'gparted' or 'disk utility'
[use either disk utility to examine your pc hard drive so that you know where your ubuntu '/' partition is (you need to know this during install)]
Click top right corner of desktop and choose system settings, backup.
Configure it to back up to your usb drive (or wherever), and make the backup.
Backing up say 15Gb of data takes time, for me it was around 30min (I guess) but it looks after itself.
3. Install ubuntu from your install disk (or first download and burn a new disk)
Insert your disk and cancel any autoplay dialogue.
Re-start your pc, and enter your bios (for me I press F2 at start of boot).
Find the section that lists the boot order, check the top of the list is cd/dvd drive (or move it to the top), save & exit
The pc will then boot to 'try ubuntu' or 'install' - choose install, then choose 'do something else'.
(At this point you will need to know which is your ubuntu '/' partition - see the screen shot below - mine is 2nd from the right, the farthest right is the /swap partition.)
So you are now looking at a graphic of your hard disk partitions.
Dclick on the one holding your ubuntu data, and in the next box that appears, choose 'use as' 'ext4 journaling file system', mount point '/', ok.
You'll return to the graphic of your hard disk partitions, it will look something like the graphic below - BUT YOU DON'T TICK THE FORMAT BOX.
Hit Install now.
4. Follow the simple 'Install' steps:
Enter your names and password (same as before), choose to update during install etc.
(get on with another job, and in an hour it's done.)
5. Reboot - install updates - install additional apps - Reboot.
That's it done!!!!!!
https://help.ubuntu.com/community/Boot-Repair If you lose your boot this repair can be downloaded using your 'try ubuntu' cd.
https://help.ubuntu.com/community/DiskSpace Good info
https://help.ubuntu.com/community/UbuntuReinstallation Good info