I've lost Ubuntu after formatting my c:

Status
Not open for further replies.

saqib_khan

I M A *STAR*
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

Wire muncher!
Too lazy to type the whole thing so "fudging" it from ubuntuforums.org :D

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

3. Type "grub" which makes a GRUB prompt appear.

4. Type "find /boot/grub/stage1". You'll get a response like "(hd0)" or in my case "(hd0,3)". Use whatever your computer spits out for the following lines.

5. Type "root (hd0,3)".

6. Type "setup (hd0,3)". This is key. Other instructions say to use "(hd0)", and that's fine if you want to write GRUB to the MBR. If you want to write it to your linux root partition, then you want the number after the comma, such as "(hd0,3)".

7. Type "quit".

8. Restart the system. Remove the bootable CD.

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.
 

Rahim

Married!
^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

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

Rahim

Married!
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.
 
OP
saqib_khan

saqib_khan

I M A *STAR*
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?
 

infra_red_dude

Wire muncher!
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?
There are no spaces after boot and grub. its: find<space>/boot/grub/stage1.

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

saqib_khan

I M A *STAR*
^^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.
 
OP
saqib_khan

saqib_khan

I M A *STAR*
^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.
 

QwertyManiac

Commander in Chief
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

Married!
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?
 
Last edited:
OP
saqib_khan

saqib_khan

I M A *STAR*
^^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

Married!
^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.
 
Status
Not open for further replies.
Top Bottom