# I've lost Ubuntu after formatting my c:



## saqib_khan (Nov 18, 2008)

Hi,

Earlier I had ubuntu 8.4 & xp sp2 installed with grub, all working properly.

Now, i formatted my c:. C: contained my xp. And now i have new xp.

But, now i m not getting the option to select between xp & ubuntu. What happened to my ubuntu? I think i need to reinstall grub but how?

Help me guys.


----------



## infra_red_dude (Nov 18, 2008)

Too lazy to type the whole thing so "fudging" it from ubuntuforums.org 



			
				pietro_spina from ubuntuforums.org said:
			
		

> 1. Boot from a Live CD, like Ubuntu Live CD or similar.
> 
> 2. Open a Terminal. Go SuperUser (that is, type "su"). Enter root passwords as necessary. (in kanotix you need to set the passwd for root yourself. Use:
> $ passwd root
> ...



Source: *ubuntuforums.org/showthread.php?t=42030

If the Step 3 doesn't work, then instead of typing "su" and then "grub" type "sudo grub". Then continue with Step 4.

Also if GRUB was your main boot loader then use (hd0) in Step 6, otherwise (hd0,x), where 'x' is your Linux Boot Partition (in case you are using some other boot loader, like Vista's Boot Loader for e.g.).

Hope this helps.


----------



## saqib_khan (Nov 18, 2008)

ok, will try & hope i doesn't do anything wrong. And thanx.


----------



## Rahim (Nov 18, 2008)

^Dont worry go ahead and restore GRUB to the MBR. Just note down the output of find /boot/grub/stage1 and remember GRUB counts the partitions from 0 and not 1  SO the 1st partition will be (hd0,0) and not (hd0,1).


----------



## chicha (Nov 18, 2008)

i have never tried this before but what happens if he installs XP again? will grub be there or windows MBR?


----------



## Rahim (Nov 18, 2008)

If you reinsatll XP again it will overwrite Grub and the mbr. So all it takes is just restore grub following the above steps. Its quite simple and easy. Grub is a very flexible and easy bootloader.


----------



## saqib_khan (Nov 18, 2008)

ok guys, here r the problems:
1)I booted from the ubuntu cd & opened a terminal, "su" command is not working. After entering su it asks for password, it's not accepting any password, what password shud i give him?
2)Then i tried entering "sudo grub", and voila it worked.
3)Now, i m at the grub prompt. But, when i type "find /boot /grub /stage1", it says "Error 15: File not found"
Am i entering the correct command??
find(space)/boot(space)/grub(space)/stage1 . Am i entering space at correct point. I think i m correct because it says:Error 15: file not found.

So, what shud i do?


----------



## NucleusKore (Nov 18, 2008)

Type *sudo su* instead of *su*

Then same as above


----------



## saqib_khan (Nov 18, 2008)

^^but what abt error15 : file not found??


----------



## infra_red_dude (Nov 18, 2008)

saqib_khan said:


> ok guys, here r the problems:
> 1)I booted from the ubuntu cd & opened a terminal, "su" command is not working. After entering su it asks for password, it's not accepting any password, what password shud i give him?
> 2)Then i tried entering "sudo grub", and voila it worked.
> 3)Now, i m at the grub prompt. But, when i type "find /boot /grub /stage1", it says "Error 15: File not found"
> ...


There are no spaces after boot and grub. its: find<space>/boot/grub/stage1.

I'm sorry if my first post caused the confusion.


----------



## saqib_khan (Nov 18, 2008)

^^thanx infra, i got it.

After typing this: find /boot/grub/stage1, i got output as (hd0,6)

Then i typed "root (hd0,6)"

Then, i typed "setup (hd0,6)"

Then what to do? After writing this something written came up, i thought i got my grub, but after restarting there's no grub.

So , make me understand ur point no 6, infra or anyone.


----------



## Dark Star (Nov 18, 2008)

^^Its setup (hd0) only


----------



## saqib_khan (Nov 19, 2008)

^Thanx darkstar, got my grub back.

And the problem solved.

I have another query for u all. How can i upgrade from 8.4 to 8.10 by cd?
I mean if i order a cd of ubuntu 8.10 then what to do to upgrade my 8.4 to 8.10?? I know i can update it with internet. But i don't want to waste my 600-700 mb in this task. 

Currently i m posting from mu ubuntu 8.4 only. And thank u all for ur kind help.


----------



## infra_red_dude (Nov 19, 2008)

^^^ You cannot upgrade from 8.04 to 8.10 through the LiveCD.


----------



## Dark Star (Nov 19, 2008)

Yeap ! Ubuntu didn't provide option to update your OS to newer version ! while non Ubuntu OS does !


----------



## saqib_khan (Nov 19, 2008)

Then if i wanted to install 8.10, then shud i install it over my current 8.4?Will it work?


----------



## QwertyManiac (Nov 19, 2008)

No, installing it would erase all older data. So 8.04 will be completely erased (applications, settings and all), even your /home directory if it resides on the same partition.


----------



## Rahim (Nov 19, 2008)

Just backup all your folder and files from your /home folder to a different partition and install 8.10 then, copy back all that folder and files including the hidden ones (folder with a dot ".", press Ctrl+H to show hidden folders and files). This will restore all your personal settings of your apps,themes,etc. You just have to install the required softwares from Synaptic and dont have to redo the settings.

EDIT: Isnt there an alternative-cd to upgrade Ubuntu as it used to be?


----------



## saqib_khan (Nov 19, 2008)

^^i've installed kde 4 on my ubuntu, will i get it back also, if i take a backup of my home folder??

I don't want to install it again from the net, as i have mb based a/c.


----------



## Rahim (Nov 19, 2008)

^If you have installed KDE4 through the net, then all the debs are downloaded and stored in /var/cache/apt/archives folder. Backup the contents of /var/cache/apt/archives folder. You need to open Nautilus with root priveleg ,press Alt=F2 and enter gksu nautilus if in GNOME or kdesu nautilus if in KDE. Give your password and then navigate to that folder and copy all the debs to another partition.
When reinstalling, just copy back these debs to the folder and install KDE 4 and it will check for the required debs files and install KDE 4 without you having to re-download all over again. All hail the mighty and clever apt 

I hope you understood me Saqib.
PS: Your /home folder contains only personal settings of different apps.


----------



## saqib_khan (Nov 19, 2008)

OK, will try when i get my 8.10 cd, thanx.


----------



## infra_red_dude (Nov 19, 2008)

And now when you install Ubuntu 8.10 again, make another partition for /home so that any future upgrades will only erase the OS and not your personal data.


----------



## saqib_khan (Nov 19, 2008)

ok


----------



## NucleusKore (Nov 20, 2008)

infra_red_dude said:


> And now when you install Ubuntu 8.10 again, make another partition for /home so that any future upgrades will only erase the OS and not your personal data.



Does the Ubuntu installer give the option of directly mounting the existing /home without formatting?


----------



## infra_red_dude (Nov 20, 2008)

^^^ Yes, it does during install.


----------



## NucleusKore (Nov 20, 2008)

Ok, is this option new in 8.10? Don't remember having it in 8.04


----------



## infra_red_dude (Nov 20, 2008)

No, you could do that in almost any Linux distro. You can just tag in any of the partitions as /home during install. You don't need to format it. Also if you create the same username in the new install the "old" /home/<username> automatically becomes your "new" home with all settings preserved


----------



## NucleusKore (Nov 20, 2008)

Ok I used to do that in SUSE, somehow never managed to get the option, in Ubuntu, of mounting *without* formatting at install. Will try sometime again.


----------

