DIGIT-ARC read-only archive · snapshot: July 23, 2026

I've lost Ubuntu after formatting my c:

28 posts · originally from https://geek.digit.in/community/threads/ive-lost-ubuntu-after-formatting-my-c.102347/

saqib_khan
saqib_khan Original post #1
Nov 18, 2008 at 12:31 AM
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 at 12:45 AM
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.
saqib_khan
Nov 18, 2008 at 3:45 PM
ok, will try & hope i doesn't do anything wrong. And thanx.
Rahim
Rahim #4
Nov 18, 2008 at 4:23 PM
^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
chicha #5
Nov 18, 2008 at 7:19 PM
i have never tried this before but what happens if he installs XP again? will grub be there or windows MBR?
Rahim
Rahim #6
Nov 18, 2008 at 7:42 PM
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 at 10:05 PM
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 at 10:44 PM
Type sudo su instead of su

Then same as above
saqib_khan
Nov 18, 2008 at 11:00 PM
^^but what abt error15 : file not found??
infra_red_dude
Nov 18, 2008 at 11:15 PM
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.
saqib_khan
Nov 18, 2008 at 11:42 PM
^^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
Dark Star #12
Nov 18, 2008 at 11:50 PM
^^Its setup (hd0) only :)
saqib_khan
Nov 19, 2008 at 12:16 AM
^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 at 2:34 AM
^^^ You cannot upgrade from 8.04 to 8.10 through the LiveCD.
Dark Star
Dark Star #15
Nov 19, 2008 at 7:48 AM
Yeap ! Ubuntu didn't provide option to update your OS to newer version ! while non Ubuntu OS does !
saqib_khan
Nov 19, 2008 at 11:21 AM
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 at 1:09 PM
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
Rahim #18
Nov 19, 2008 at 2:06 PM
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 at 3:38 PM
^^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
Rahim #20
Nov 19, 2008 at 6:22 PM
^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 at 6:59 PM
OK, will try when i get my 8.10 cd, thanx.
infra_red_dude
Nov 19, 2008 at 11:28 PM
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.
NucleusKore
Nov 20, 2008 at 8:25 AM
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 at 9:13 AM
^^^ Yes, it does during install.
NucleusKore
Nov 20, 2008 at 1:46 PM
Ok, is this option new in 8.10? Don't remember having it in 8.04
infra_red_dude
Nov 20, 2008 at 8:22 PM
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 at 9:07 PM
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.