Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed Ubuntu with WUBI in Windows 7 64bit, and I had installed Mandriva 2011 with a disk. I tried to learn Linux with Ubuntu and misused mke2fs; after I reboot my computer, Windows 7 and Ubuntu has crashed.

As I have Mandriva, I boot into Mandriva and found

# df -h

/dev/sda7 12G 9.8G 1.5G 88% /
/dev/sda2 15G 165M 14G 2% /media/logical
/dev/sda6 119G 88G 32G 74% /media/2C9E85319E84F51C
/dev/sda5 118G 59G 60G 50% /media/D25A6DDE5A6DBFB9
/dev/sda9 100G 188M 100G 1% /media/ae69134a-a65e-488f-ae7f-150d1b5e36a6
/dev/sda1 100M 122K 100M 1% /media/DELLUTILITY
/dev/sda3 98G 81G 17G 83% /media/OS


# fdisk /dev/sda
Command (m for help): p
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd24f801e

Device Boot Start End Blocks Id System
/dev/sda1 2048 206847 102400 6 FAT16
/dev/sda2 * 206848 30926847 15360000 7 HPFS/NTFS/exFAT
/dev/sda3 30926848 235726847 102400000 7 HPFS/NTFS/exFAT
/dev/sda4 235728864 976771071 370521104 f W95 Ext'd (LBA)
/dev/sda5 235728896 481488895 122880000 7 HPFS/NTFS/exFAT
/dev/sda6 727252992 976771071 124759040 7 HPFS/NTFS/exFAT
/dev/sda7 481500243 506674034 12586896 83 Linux
/dev/sda8 506674098 514851119 4088511 82 Linux swap / Solaris
/dev/sda9 514851183 727246484 106197651 83 Linux

Partition table entries are not in disk order

I think I may used the following command

mke2fs -j -L "logical"/dev/sda2

but I had forgotten what kind of partition it was before I transfered it into ext3. perhaps ntfs

Data was not lost, and I can view my files as I could in Windows. In Mandriva, there are following disks:

117.2 GB hard disk, files in it is the same as my Windows D:, and Ubuntu was installed in it; 119.0 GB hard disk is my G:, with my personal files in it; 12.0 GB is the same with Mandriva / (with means root), 101.3 GB hard disk with nothing but lost+found; DELLUTILITY should be Dell computer utilities pre-installed in my computer; logical is the disk which I had spoiled, I can view nothing but lost+found; and OS is the C: in my Windows.

After I boot, grub lets me choose Mandriva or Windows. I chose Windows and it tells me:

FILE system type unknown, partition type 0x7
Error 13: Invalid or unsupported executable format

I doubt something wrong with windows MBR or something

# cat /boot/grub/menu.lst
timeout 5
color black/cyan yellow/cyan
gfxmenu (hd0,6)/boot/gfxmenu
default 0

title linux
kernel (hd0,6)/boot/vmlinuz BOOT_IMAGE=linux root=UUID=199581b7-ac7e-4c5f-9888-24c4f213cad8 nokmsboot logo.nologo quiet resume=UUID=34c546e4-9c42-4526-aa64-bbdc0e9d64fd splash=silent vga=788
initrd (hd0,6)/boot/initrd.img

title linux-nonfb
kernel (hd0,6)/boot/vmlinuz BOOT_IMAGE=linux-nonfb root=UUID=199581b7-ac7e-4c5f-9888-24c4f213cad8 nokmsboot resume=UUID=34c546e4-9c42-4526-aa64-bbdc0e9d64fd
initrd (hd0,6)/boot/initrd.img

title failsafe
kernel (hd0,6)/boot/vmlinuz BOOT_IMAGE=failsafe root=UUID=199581b7-ac7e-4c5f-9888-24c4f213cad8 nokmsboot failsafe
initrd (hd0,6)/boot/initrd.img

title windows
root (hd0,1)
makeactive
chainloader +1

I can boot into Linux, but not Ubuntu, it boot into Mandriva. I don't have a boot disk.

Help me find a way to make it work again.

share|improve this question
    
Looks to me, from the partitioning numbers of Mandriva and the windows that doesn't work, that grub is installed rather than grub2, ie. root (hd0,1) refers to the second partition, /dev/sda2. –  John S Gruber Sep 8 '12 at 22:36
    
Did you get the grub/menu.lst file from the Windows OS partition, the Mandriva partition, or somewhere else? –  John S Gruber Sep 8 '12 at 22:44
    
It is from mandriva partition; I can not log into Windows. But when I choose to boot Windows when I start my computer, it shows the same as menu.lst, I tried to edit and tried to change root (hd0,1) into root (hd0,0),root (hd0,2),root (hd0,3)... but nothing works. Changing to root (hd0,3) gives prompt that Windows CD required –  surlogics Sep 9 '12 at 0:45
    
Since you could find your files I was hoping you really hadn't been using /dev/sda2. The trouble is that that is the partition that had been set as bootable in the partition table and that is where the Mandrive legacy grub had pointed, so I guess that is where your Windows system software,including your Windows bootloader, was installed. Someone else may have an idea for you, but you may eventually have to reinstall Windows. Once you do I don't know whether you have to reinstall Ubuntu with wubi or if it can be fixed to bring it up from wherever it may still be. I'm sorry. –  John S Gruber Sep 9 '12 at 3:19
    
My bootinfo are posted, see comments of your answer. And I wonder whether I could use a win7 disk and Bootrec.exe to avoid my windows from re-install. I really appreciate your kind help; your advice helped me a lot –  surlogics Sep 9 '12 at 10:32
show 1 more comment

1 Answer

What you want seems to be to boot not /dev/sda2, but /dev/sda5, but I'm a bit confused by your description about how you are set up to boot. If Ubuntu is only installed with wubi I don't understand how there could be a Ubuntu grub.

I think it is worth trying to boot /dev/sda5. Assuming you are actually running legacy grub code from somewhere:

Press shift if necessary to open the grub menu.

While you are there, double check that the options you are presented with match the menu.lst file you posted above.

Press "C" at the beginning of booting to enter a grub command.*

Enter:

 root (hd0,4)
 chainloader +1
 boot

And press control-x* to execute.

(*I have some doubt about the letters to press for grub as it's been some time since I used it rather than grub2, but the grub prompts should guide you, please correct me with a comment or edit this answer as appropriate).

If you are using grub2 it's more like:

Press "C" during at the beginning of booting to enter a grub command.

Enter:

 set root=(hd0,msdos5)
 chainloader +1
 boot

and press control-X

To provide more information about the location of your grub and its configuration files you can use the `bootinfoscript' from an Ubuntu live cd. For information on that software please see http://askubuntu.com/a/24487/63886

Once you have Ubuntu running you could run the bootinfoscript from there and that could guide you to how to straighten out your grub configuration permanently so you don't have to enter commands to boot.

share|improve this answer
    
I thought when I boot the grub version is 0.97, I did not meant to tag it as grub2,I wanted to tag it as grub; but I can not do it. I do not know much about grub. Thanks for your help and I will have a look at the address you provided, hoping to provide more info –  surlogics Sep 9 '12 at 0:55
    
Hi John, I have test it and is pasting you the results. Hope it will help paste.ubuntu.com/1193796 Thank you so much –  surlogics Sep 9 '12 at 1:08
    
I perhaps misunderstand grub, I meant that my sda2 might contained boot infomation but not sure what it contained exactly –  surlogics Sep 9 '12 at 1:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.