Restoring hard drive back to original as-CD-installed condition?

Asked by george_rutkay

Clearly the installation I currently run (no other operating systems BTW) of Uuntu 7.10 is buggered......and I think maybe buggered beyond help because nobody has been able to figure out what's gone wrong with it.

So my question: is there any way to just boot from the CD and reinstall a clean virgin system without reformatting or wiping out all of the files in each user account?

(PS: I don't believe the hard drive is faulty.)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
george_rutkay
Solved:
Last query:
Last reply:
Revision history for this message
Juan C. Villa (juanqui) said :
#1

My suggestion is that you boot from the Ubuntu Gutsy (7.10) disc. During the installation process it will ask you if you want to migrate documents (At least that's what I remember). Can you confirm if this is correct? If it is then you should have no problem reinstalling your machine and keeping all your home folder files. Let me know if that works for you.

Revision history for this message
george_rutkay (yaktur) said :
#2

I have a computer here which I've already set up 7.10 on. I booted from the CD (I have one here) and this is the result when I try to reinstall over a pre-existing 7.10 installation.

Installer asks for:
1) Language
2) Location/Time zone
3) Keyboard layout
4) Set up partitioner (I choose manual mode)
5) Installer wants to prepare partitions (I do not choose format because I wish to preserve all of the documents)
6) Partitioner complains "No root system defined, must set up root system"
7) I define the previous partition as Root system
8) Partitioner complains that the the Root system MUST be formatted, installation cannot continue unless formatting is done.

This sucks.

Revision history for this message
Juan C. Villa (juanqui) said :
#3

You can backup your home directory by using a DVD Writer, or you can install GParted, resize your current partition, make a new partition, copy all your home directory data to it. And install ubuntu again on the resized partition. When all that is done, copy your dad over. This is kinda crazy, but I dont know what else would work. Sorry

Revision history for this message
george_rutkay (yaktur) said :
#4

Don't have a DVD writer (can't afford one), have GPArted. Might have to go that route.

Why did the creators of Ubuntu set this up so it forces reformatting on the user? It's like completely gutting and burning out the interior of your car and rebuilding it just because the ashtray is full.

Revision history for this message
Juan C. Villa (juanqui) said :
#5

I agree with your opinion. There is one thing you should note though. By default, when you install Ubuntu from scratch, it will create two partitions:
--> a swap space partition
--> a root partition (Mount point: /)

Don't worry if you don't understand the whole mount point thing. I will explain:

On some linux distributions, the default partition layout is the following:
--> A swap space partition
--> a root partition (mount point: /)
--> a home directory partition (mount point: /home)

The only difference between the first and the second is that the home directory will be in a different partition. This allows you to do things like: encrypting your home directory, moving your home folder to another drive, etc...

This approach would also seem very helpful in your case because you could resize your hard drive, make a new partition, and set the mount point in that partition to "/home". You can then copy all the content of your home directory to that folder. Once you have done that, re-installation of your machine is much easier (You could even install other distributions). There are always some quirks you might have to deal with, such as user creation when you re-install Ubuntu, but it wont be too much trouble.

Revision history for this message
george_rutkay (yaktur) said :
#6

I admit it looks a bit like Greek to me.....

I first started on computers using DOS, then migrated over to Macintosh (System 6).

And even up to Macintosh System 9.22 (the last pre-OS X Linux based Macintosh system) the user could reinstall the operating system (write-over or "clean install") without touching any of the user's documents.

Guess my mind is still formatted like that!

I'll see if I can impliment the solution you suggested over the weekend.

Revision history for this message
george_rutkay (yaktur) said :
#7

Question? : Upon creating a new partition for the purpose of backing up user accounts, which format is appropriate for this?

I would want to maintain user permissions throughout the backup and restore process.

Should I use VFAT? EXT3? Which is the preferred format?

Revision history for this message
Juan C. Villa (juanqui) said :
#8

EXT3 is the preferred format across all linux distributions. You can never go wrong with it :P

Revision history for this message
george_rutkay (yaktur) said :
#9

Alright, thanks! I'll let you know (by answering this thread next week) whether I was successful or not.

Revision history for this message
Juan C. Villa (juanqui) said :
#10

No problem. I'll keep an eye out for a message next week

Revision history for this message
Juan C. Villa (juanqui) said :
#11

No problem. I'll keep an eye out for a message next week

Revision history for this message
george_rutkay (yaktur) said :
#12

Ok, I've tried this now.

I have this Linux Rescue CD so I booted from it and used GParted to partition my drive with the data on it.

I managed to limp my old system long enough to back things from each user account onto the second partition.

Around 1 am I got 7.10 reinstalled and around 10 am I got all of the updates installed and data restored.

Then I needed to reclaim the space.

So I booted back to the Linux Rescue CD and ran GParted again, I deleted the backup partition and expanded the working partition to swallow up the empty space so the kids don't run out of drive space for their songs and pictures and junk.

Now when I try to boot, the process stops for this reason:
----------------
Log of fsck -C -R -A -a
Sat Apr 12 17:12:12 2008

fsck 1.40.2 (12-Jul-2007)
fsck.ext3: Unable to resolve 'UUID=8e2e3f22-8b39-44a8-aebf-5820ce3eff18'

fsck died with exit status 8

Sat Apr 12 17:12:12 2008
----------------

The system asks me to either hit Ctrl-D to continue booting or type the password to enter a troubleshooting mode where I can run FSCK manually.

I've tried this - to run FSCK manually - and it claims there is nothing wrong with the drive, everything is clean.
Then I tried to run e2fsck -f. Still the same result, it reports the drive is clean.

When I boot normally I get this error.

What has gone wrong? Can I repair this? Or must I wipe everything out again?

I am running 7.10 successfully now, there appear to be no ill effects due to this damage but I know this is not normal behaviour. Please advise?

Revision history for this message
Juan C. Villa (juanqui) said :
#13

Can you post the contents of "/etc/fstab" ? I believe the problem is in there

Revision history for this message
george_rutkay (yaktur) said :
#14

I was unable to wait....too much to do this week to afford to leave the computer in such a state for the rest of the week....

I backed everything up to another smaller hard drive, reformatted the whole drive, reinstalled everything and restored the user files.

There should be an easier way.

If the computer acts up over the next little while, I'll suspect the hard drive of dying by degrees but so far the evidence is against the hard drive failing.