"No operating system found" upon boot after partition resize

Using the GParted LiveCD, I did a series of copying, resizing, and pasting in a certain order to move things around, so I could get things into a logical order, unlike how I had the partitions set up before.

Right.

grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83
grub> setup --stage2=/boot/grub/stage2 (hd0) (hd0,0)
setup --stage2=/boot/grub/stage2 (hd0) (hd0,0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  17 sectors are embedded.
succeeded
 Running "install --force-lba --stage2=/boot/grub/stage2 /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.1st"... failed

Error 15: File not found

[Same result without --force-lba]
Rescue:~ # dd if=/dev/sda of=sdambr bs=512 count=1
1·0 records in
1·0 records out
512 bytes (512 B) copied, 3.5296e-05 s, 14.5 MB/s

Rescue:~ # xxd sdambr
0000000: 31c0 8ed0 bc00 7c8e c08e d8bf 1e06 be1e  1.....l.........
0000010: 7c50 57b9 e201 f3a4 b900 02f3 abcb 80fa  IPW.............
0000020: 8f7e 02b2 8052 52bb 9407 8daf 2a00 8a46  .~...RR.....*..F
0000030: 0466 8b7e 0866 033e b306 84c0 740b 807e  .f.~.f.>....t..~
0000040: 0080 7505 6689 3e84 0b83 c510 83c3 0980  ..u.f.>.........
0000050: fbb8 75da b8e1 00c1 e002 89c6 668b ac00  ..u.........f...
0000060: 0866 85ed 7519 b8c5 06be bb06 e8a5 0089  .f..u...........
0000070: c6e8 9a00 5a31 c0cd 13cd 18fb f4eb fc66  ....Z1.........f
0000080: 892e b306 beab 06b4 425a 52cd 13b8 d906  ........BZR.....
0000090: 72d7 a000 7c84 c074 03a1 fe7d 3d55 aab8  r...l..t...}=U..
00000a0: e906 75c5 6689 ee5a e955 7510 0001 0000  ..u.f..Z.Uu.....
00000b0: 7c00 0000 0000 0000 0000 0045 7272 6f72  l..........Error
00000c0: 2000 0d0a 004e 6f20 6163 7469 7665 2070   ....No active p
00000d0: 6172 7469 7469 6f6e 0044 6973 6b20 7265  artition.Disk re
00000e0: 6164 2065 7272 6f72 004e 6f20 6f70 6572  ad error.No oper
00000f0: 6174 696e 6720 7379 7374 656d 0049 6e76  ating system.Inv
0000100: 616c 6964 2043 4853 2072 6561 6400 e803  alid CHS read...
0000110: 00be c206 60ac b40e bb01 00cd 10ac 84c0  ....'...........
0000120: 75f4 61c3 0000 0000 0000 0000 0000 0000  u.a.............
0000130: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000140: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000150: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000160: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000170: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000190: 1c80 b600 0000 0000 0000 0000 0000 0000  ................
00001a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001b0: 0000 0000 0000 0000 6b10 0900 0000 0000  ........k.......
00001c0: 0100 83fe ffff 3f00 0000 145e 410d 00fe  ......?....^A...
00001d0: ffff 83fe ffff db75 a10d e614 0005 00fe  .......u........
00001e0: ffff 82fe ffff 535e 410d 8817 6000 0000  ......S^A...'...
00001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.

You left out something I asked for in post #20. So please do all of the following: Boot again into either Rescue System at the command line as root, or LiveCD from a terminal as root (which are you using, by the way?), and do:

mount -t ext3 /dev/sda1 /mnt
ls -l /mnt/etc/grub
cat /mnt/boot/grub/menu.lst
cat /mnt/grub/grub/device.map

Post back output of commands after mount.

You don’t have any boot code in the MBR. We are trying to determine why. There is another solution we have not tried yet, but first I want to see the above output.

I wasn’t emailed about posts 19 and 20, for some reason. Odd. Well, let’s try this out… I’m using the openSUSE DVD in Rescue mode, BTW.

Rescue:~ # mount -t ext3 /dev/sda1 /mnt
Rescue:~ # ls -l /mnt/etc/grub
ls: cannot access /mnt/etc/grub: No such file or directory

Since the directory isn’t found, no reason to go on to the next lines, eh?

Would you suggest I go ahead and reinstall openSUSE over sda1, or would you want to continue figuring this out? (I have my Eee, and can access my files via a Live disc.)

Rats! Very sorry :frowning: - but I made a typo mistake. That should have been:

mount -t ext3 /dev/sda1 /mnt
ls -l /mnt/boot/grub
cat /mnt/boot/grub/menu.lst
cat /mnt/boot/grub/device.map
Rescue:~ # mount -t ext3 /dev/sda1 /mnt
Rescue:~ # ls -l /mnt/boot/grub
total 228
-rw------- 1 root root     10 Dec 20 03:50 default
-rw------- 1 root root     47 Dec 20 03:50 device.map
-rw-r--r-- 1 root root     46 Dec 20 03:45 device.map.old
-rw-r--r-- 1 root root   8660 Dec  3 05:10 e2fs_stage1_5
-rw-r--r-- 1 root root   7844 Dec  3 05:10 fat_stage1_5
-rw-r--r-- 1 root root   7120 Dec  3 05:10 ffs_stage1_5
-rw-r--r-- 1 root root   7116 Dec  3 05:10 iso9660_stage1_5
-rw-r--r-- 1 root root   8700 Dec  3 05:10 jfs_stage1_5
-rw------- 1 root root   1505 Dec 20 04:41 menu.1st
-rw------- 1 root root   1133 Dec 20 03:50 menu.1st.old
-rw-r--r-- 1 root root   7348 Dec  3 05:10 minix_stage1_5
-rw-r--r-- 1 root root   9744 Dec  3 05:10 reiserfs_stage1_5
-rw-r--r-- 1 root root    512 Dec  3 05:10 stage1
-rw-r--r-- 1 root root 103734 Dec 20 03:50 stage2
-rw-r--r-- 1 root root   7380 Dec  3 05:10 ufs2_stage1_5
-rw-r--r-- 1 root root   6720 Dec  3 05:10 vstafs_stage1_5
-rw-r--r-- 1 root root   9544 Dec  3 05:10 xfs_stage1_5
Rescue:~ # cat /mnt/boot/grub/menu.1s
cat: /mnt/boot/grub/menu.1st: No such file or directory
Rescue:~ # cat /mnt/boot/grub/device.map
(hd0)   /dev/disk/by-id/ata-ST3160815AS_5RA0FRKY

Odd that though menu.1st is obviously there in /grub/, cat can’t find it or something? And device.map is found… Or so it seems to me.

That is not “1st” as in first but “lst” as in list.

facepalms Duhr. Sorry about that.

Rescue:~ # cat /mnt/boot/grub/menu.lst
# Modified by YaST2. Last modification on Fri Dec 19 23:41:28 EST 2008
default 1
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,5)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: xen###
title Xen -- openSUSE 11.1 - 2.6.27.7-9
    root (hd0,5)
	kernel /boot/xen.gz
	module /boot/vmlinux-2.6.27.7-9-xen root=/dev/disk/by-id/ata-ST3160815AS_5RA0FRKY-part6 resume=/dev/disk/by-id/ata-ata-ST3160815AS_5RA0FRKY-part5 splash=silent showopts vga=0x31a
	module /boot/initrd-2.6.27.7-9-xen

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.1
	root(hd0,5)
	kernel /boot/vmlinux-2.6.27.7-9-default root=/dev/disk/by-id/ata-ST3160815AS_5RA0FRKY-part6 resume=/dev/disk/by-id/ata-ata-ST3160815AS_5RA0FRKY-part5 splash=silent showopts vga=031a
	initrd /boot/initrd-2.6.27.7-9-default

###Don't change this comment - YaST2 identifier: Original name: Ubuntu 8.04.1, kernel 2.6.24-22-generic (/dev/sda1)###
title Ubuntu 8.04.1, kernel 2.6.24-22-generic (/dev/sda1)
    root (hd0,0)
    configfile /boot/grub/menu.lst

###Don't change this comment - YaST2 identifer: Original name: failsafe###
title Failsafe -- openSUSE 11.1
    root (hd0,5)
    kernel /boot/vmlinux-2.6.27.7-9-default root=/dev/disk/by-id/ata-ST3160815AS_5RA0FRKY-part6 showopts ide=nodma apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x31a
    initrd /boot/initrd-2.6.27.7-9-default

So what’s with Kubuntu and sda1? Is that just leftover from when it was actually there, or…?

Re Kubuntu: You posted that initially it is on sda1. The menu.lst you just posted was generated in your openSUSE install, when you put it on sda6. So the Kubuntu stanza is pointing to where Kubuntu was when this file was created. The openSUSE Boot Loader installation will search the disk for other linux installs, and add a stanza for such when found. That is why the stanza is there - and wrong, if Kubuntu is actually now on sda2.

And the openSUSE boot stanzas in the file are all wrong, too. Because they point to openSUSE being on sda6, whereas you moved it to sda2.

Looking back more closely at the MBR, there is actually boot code there - “generic” code; the question is whether it is executable. Please do this: Boot the DVD into Rescue System, login as root. Now do:


sfdisk -A1 /dev/sda

grub
root (hd0,0)
setup (hd0,0) (hd0,0)
quit

shutdown -r now

The machine reboots. Do you get the openSUSE grub menu? Note that you will see a quick error for failing to get the graphical screen and if you attempt to boot if will fail - all that will be easily fixed. For now, we just want to see if grub gets this far.

By the way, you do have only one disk on this machine, a Seagate, correct?

sfdisk -Al /dev/sda

What option did you intend to put there? I assume -Al is a typo.

sfdisk: l: no such partition

Oh, and yes, just one drive. I’m pretty sure it’s a Seagate.

That is “A” as in “Alpha” and the numeral 1 (one). It tells sfdisk to set the boot flag (in Windows, make “active”) for the first partition and turn off any others. It looks like your MBR has “generic” boot code in it; if so, it’s looking for the active partition in the table to chain to. If there is no partition marked active, the code will fail with the error message IIRC you received previously.

The second set of grub commands puts grub’s stage1 in the first partition boot sector. Previously, grub choked when embedding the stage2 pointer into a stage1 going into the MBR. So we try putting stage1 in the PBR instead. Per the above, if the code in the MBR is good and sda1 is marked boot, the MBR code will call the PBR jump instruction and execute the stage1 there.

As a side note: Earlier you were moving around contents of partitions. When doing so, always remember that the file system inode table (or the MFT in Windows) is built according to the size of the partition on which it was formatted, and that PBR’s contain data blocks which tell the OS where to find some things - this varies by file system and OS. In other words, data in the file system is portable but not necessarily the sectors which control what the partition is being used for. That’s why moving partitions is usually done via store/restore and the PBR re-created.

Between you using a “1” instead of an “l” in menu.lst and me using an “l” instead of a “1” in -A1, we’re not going to get very far, are we? rotfl!

I’ll be more careful next time. :embarrassed:

(The letter l comes first, the numeral 1 comes second, and then they alternate.)

1l1l1l1l1l1l1l1l1l1l1l1l1l1l1l1l1l1

Huh, I can’t really tell them apart… That’s a problem.

grub> root (hd0,0)
root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0,0) (hd0,0)
setup (hd0,0) (hd0,0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0,0)"... failed (this is not fatal)
 Running "embed /boot/grub/e2fs_stage1_5 (hd0,0)"... failed (this is not fatal)
 Running "install /boot/grub/stage1 (hd0,0) /boot/grub/stage2 p /boot/grub/menu.lst "... succeeded
Done.
----------
(restart and removal of DVD here)
----------
GRUB Loading stage2...
(hd0,5)/boot/message: file not found
----------
 GNU GRUB   version 0.97   (693K lower / 2087552K upper memory)

Xen -- openSUSE 11.1 - 2.6.27.7-9
openSUSE 11.1
Ubuntu 8.04.1, kernel 2.6.24-22-generic (/dev/sda1)
Failsafe -- openSUSE 11.1
----------
   Booting 'Ubuntu 8.04.1, kernel 2.6.24-22-generic (/dev/sda1)'

root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
configfile /boot/grub/menu.lst
(hd0,5)/boot/message: file not found
----------
    Booting 'openSUSE 11.1'

root (hd0,5)

Error 22: No such partition

Press any key to continue...
----------
(Xen and Failsafe had the same result as above, with only the name changing.)

Haha, man I really screwed things up! rotfl!

No! You are probably very close!

In my post where I gave you these instructions (before our “l” and “1” mistakes), I wrote:

The machine reboots. Do you get the openSUSE grub menu? Note that you will see a quick error for failing to get the graphical screen and if you attempt to boot if will fail - all that will be easily fixed. For now, we just want to see if grub gets this far.

Grub installed stage1 in the sda1 boot sector! At reboot the bios executed the MBR code! That code found the active partition! The boot sector jump instruction found grub stage2! It only then failed because menu.lst has not been changed to accommodate your moving the partitions around, that’s all.

Here is all you have left to do: I don’t know exactly what tools you have (LiveCD?), but you need to open /boot/grub/menu.lst as root in a text editor. Then find all the occurrences of (hd0,5) and change those to (hd0,0) - don’t forget the boot message line near the top. That Ubuntu stanza, change its (hd0,0) to (hd0,1). Save the file and reboot.

Heh, what I meant was that I really screwed things up when I did all the partition editing. It’s cool though, I was just making fun. Of myself.

Well, it seems there’s only one thing left to do now. Notice the 'part5’s and 'part6’s in the root= parts? I should change those, right? 'Cause that causes a problem with openSUSE starting up, and not Kubuntu (as its stanza doesn’t use that).

Please note what I wrote in my previous post:

Here is all you have left to do: I don’t know exactly what tools you have (LiveCD?), but you need to open /boot/grub/menu.lst as root in a text editor. Then find all the occurrences of (hd0,5) and change those to (hd0,0) - don’t forget the boot message line near the top. That Ubuntu stanza, change its (hd0,0) to (hd0,1). Save the file and reboot.

So, yes, changing those incorrect partition numbers is exactly what I suggested. It appears you have the grub code set up now as needed, it’s only menu.lst that needs to be fixed.

So I would change 5 and 6 to 0, or… 1?

That did it! (Ignore my previous message, part1 worked)

Thanks a lot for your help! It is very appreciated. Couldn’t have done it without you!

You’re quite welcome. Glad to have been of some help! :slight_smile:

Have you noticed the rep button… after such magnificent help :wink: