LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   error 22. help me (https://www.linuxquestions.org/questions/linux-newbie-8/error-22-help-me-684479/)

con2111 11-18-2008 11:26 PM

error 22. help me
 
Recently i decided to partition my hard drive to run vista and ubuntu on it. i ran great for like a day then, until i deleted a small(5gb) partition that didn't have anything in it. Once my computer rebooted i got something like this:
-------------
GRUB Loading stage1.5.

GRUB loading, please wait...
Error 22
-------------
What do i do to get it running like it did?

amphibioustoaster 11-19-2008 05:00 AM

I'm not at all familiar with Error 22, but it's possible that this small, empty partition may have been the Linux swap partition. Do you remember what its type was? Was it swapfs?

billymayday 11-19-2008 05:06 AM

http://www.linuxselfhelp.com/gnu/gru...r/grub_13.html

Looks like a pretty simple issue to sort. Assuming you have a live CD or some other way to boot, can you show us

The contents of /boot/grub/menu.lst

and the output of "fdisk -l"

I'll bet your partition numbers have changed and the menu.lst entry is now pointing to a nonexistent partition.

colucix 11-19-2008 05:07 AM

From the GRUB manual
Quote:

22 : No such partition
This error is returned if a partition is requested in the device part of a device- or full file name which isn't on the selected disk.
It looks like you've removed the wrong partition. Try to boot from a live CD, e.g. Knoppix, look for the menu.lst file of the linux installed on the hard drive, and see which is the root partition. Then compare the result with the output of
Code:

fdisk -l
Feel free to post the content of menu.lst and the output of fdisk here.

Edit: billymayday beat me, this time... :)

billymayday 11-19-2008 05:12 AM

Quote:

Originally Posted by colucix (Post 3347317)
Edit: billymayday beat me, this time... :)

Knowing my luck on getting beaten, I probably owe you a few!

con2111 11-19-2008 08:38 AM

okay I can boot ubuntu up with just the disc, but the problem is i am pretty much retarded when it comes to linux. Would reinstalling ubuntu to the same partition help or is just a grub problem?

amani 11-19-2008 08:56 AM

It is a simple grub configuration problem.

Simply take a look at the entry for booting Ubuntu

and edit (press e) it.

Change root= .. to root=(hd0,2)
(for example 3rd partition of 1st hard disk)

amani 11-19-2008 08:57 AM

If it takes you to a shell, then you may need to edit /etc/fstab or just press enter , ctrl d

con2111 11-19-2008 09:16 AM

I am sorry but i don't i think i understand exactly what to do. I boot up with the disc in. It shows:

Try Ubuntu without any change to your computer
Install Ubuntu
Check CD for defects
Test memory
Boot from first hard disk

Is this where I edit or do I load ubuntu and try to edit there?

billymayday 11-19-2008 05:53 PM

Select "Try Ubuntu without any change to your computer"

In "Applications->Accessories", select Terminal

Type "sudo fdisk -l" (that's a lower case "L") and post the results.

Now, I'm not sure where your boot partition is, and we may need to play around a bit to find it. look at the output ot the command above. Here's a snippet of what I get"
Code:

Disk /dev/sdb: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2d085d58

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1          12      96358+  83  Linux
/dev/sdb2              13      28707  230492587+  f  W95 Ext'd (LBA)
/dev/sdb3          28708      36483    62460720  83  Linux
/dev/sdb5              13        205    1550241  82  Linux swap / Solaris
/dev/sdb6            206        1225    8193118+  83  Linux
/dev/sdb7            1226        2245    8193118+  83  Linux
/dev/sdb8            2246        3265    8193118+  83  Linux
/dev/sdb9  *        3266        4285    8193118+  83  Linux
/dev/sdb10          4286        5305    8193118+  83  Linux
/dev/sdb11          5306        6325    8193118+  83  Linux
/dev/sdb12          6326        7345    8193118+  83  Linux
/dev/sdb13          7346        8875    12289693+  83  Linux
/dev/sdb14          8876        9895    8193118+  83  Linux

Now I know where my grub is set up, it's on /dev/sdb1. To find that, I could do:

Code:

ubuntu@ubuntu:~$ sudo mount /dev/sdb1 /mnt
ubuntu@ubuntu:~$ sudo ls /mnt/boot/grub
device.map    ffs_stage1_5        jfs_stage1_5        reiserfs_stage1_5  ufs2_stage1_5
e2fs_stage1_5  grub.conf        menu.lst        stage1                    vstafs_stage1_5
fat_stage1_5  iso9660_stage1_5  minix_stage1_5  stage2                    xfs_stage1_5

In which case, do
Code:

sudo cat /mnt/boot/grub/menu.lst
select the output, copy it and past it here with the output of fdisk above.

If the result of "sudo ls /mnt/boot/grub" had been file not found, I'd then have gone
Code:

ubuntu@ubuntu:~$ sudo umount /mnt
ubuntu@ubuntu:~$ sudo mount /dev/sdb3 /mnt
ubuntu@ubuntu:~$ sudo ls /mnt/boot/grub
ls: cannot access /mnt/boot/grub: No such file or directory

See what happens when it's the wrong partition?

Note that you would only bother with partitions that fdisk told you were linux partitions (so not /dev/sdb2 in my case, or sdb5).

See how you go on that. Keep working through any linux partitions you have - it's likely to be a low numbered one, and you probably don't have more than a couple anyway.

Note - sounds complicated - is actually easy. Don't worry.


All times are GMT -5. The time now is 07:47 PM.