Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am have a fully updated Arch Linux system that was running fine. Last night I tried to setup autofs per instructions on the Arch wiki, but upon restart there was no boot menu and only a GRUB error message saying "Error 15".

(1) Using Ext2explore in Windows, I can see the following partition structure: partitions from Windows

(2) Using fdisk in an ArchLinux live cd, I can see this: partitions from Arch live cd

(3) I tried to do "fdisk /dev/sda/" then the commands x, f, w to correct error, but fdisk says my partitions' "ordering is correct already"

(4) Using the root and setup commands in the GRUB shell also ended in failure (it tells me it can't find GRUB files, /boot/grub/, etc. etc.). Specifically, I tried "root (hd0,1)", then "setup (hd0)", (also hd0,0, hd0,2, etc.), all failed.

Is there any hope of restoring my system? Thanks for your help.

P.S. here is my menu.lst, which can be seen in Ext2explore:

# Config file for GRUB - The GNU GRand Unified Bootloader
# /boot/grub/menu.lst

# DEVICE NAME CONVERSIONS 
#
#  Linux           Grub
# -------------------------
#  /dev/fd0        (fd0)
#  /dev/sda        (hd0)
#  /dev/sdb2       (hd1,1)
#  /dev/sda3       (hd0,2)
#

#  FRAMEBUFFER RESOLUTION SETTINGS
#     +-------------------------------------------------+
#          | 640x480    800x600    1024x768   1280x1024
#      ----+--------------------------------------------
#      256 | 0x301=769  0x303=771  0x305=773   0x307=775
#      32K | 0x310=784  0x313=787  0x316=790   0x319=793
#      64K | 0x311=785  0x314=788  0x317=791   0x31A=794
#      16M | 0x312=786  0x315=789  0x318=792   0x31B=795
#     +-------------------------------------------------+
#  for more details and different resolutions see
#  http://wiki.archlinux.org/index.php/GRUB#Framebuffer_Resolution 

# general configuration:
timeout   5
default   0
color green black

# boot sections follow
# each is implicitly numbered from 0 in the order of appearance below
#
# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
#
#-*

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/f4c13c68-54e4-4631-8a5a-d1649d5c3b02 ro vga=771
initrd /kernel26.img

# (1) Arch Linux
title  Arch Linux Fallback
root   (hd0,0)
kernel /vmlinuz26 root=/dev/disk/by-uuid/f4c13c68-54e4-4631-8a5a-d1649d5c3b02 ro
initrd /kernel26-fallback.img

# (2) Windows
#title Windows
#rootnoverify (hd0,0)
#makeactive
#chainloader +1

I tried the solution provided in the first answer, but failed with the following output: Can't install Grub after chroot Also notice that menu.lst is not there, even though it appeared when I examined the partition in Ext2explore.

Also, here are the contents of /etc/fstab: fstab

share|improve this question
1  
@penyuan: Can you give more details about your boot setup? You say the /boot directory and boot partition are empty. Were these distinct? Describe the layout. Are you also saying you think these files were deleted somehow? Presumably they were there before the autofs installation and reboot? The usual way of handling such issues is to chroot into the system with a live cd and do repairs as necessary, but you might want to try to figure out what happened first. –  Faheem Mitha Mar 13 '11 at 17:45
1  
Or alternatively, chroot into the system with another installation of the same OS on the same computer. –  Faheem Mitha Mar 13 '11 at 17:52
    
Just edited original question with detailed partition structure, hope that will be useful. Please help, thanks!! –  hpy Mar 14 '11 at 5:04
    
Do you have a USB drive plugged in? Did you change the boot order in BIOS? –  Mikel Mar 14 '11 at 9:55
1  
@penyuan: fyi, if you want someone to be notified of your comment stick a @username in front of your comment. –  Faheem Mitha Mar 14 '11 at 19:07

1 Answer 1

Boot from your ArchLinux live cd again and in a command prompt as root run the exact following.

mkdir /mnt/root
mount /dev/sda3 /mnt/root
mount /dev/sda1 /mnt/root/boot
cp -a /dev/sd* /mnt/root/dev/
chroot /mnt/root
mount /proc
cat /proc/mounts > /etc/mtab
grub-install --recheck --no-floppy /dev/sda
umount /proc
exit
umount /mnt/root/boot
umount /mnt/root
reboot

Depending on what you did trying to setup autofs, you might want to check that /etc/fstab or /boot/grub/menu.lst files are valid while you are chrooted in your system (after mount /proc above).

There is also one more (shorter) way this can be done. Not sure if it is possible with the archlinux live cd, but probably is.

mkdir /mnt/root
mount /dev/sda3 /mnt/root
mount /dev/sda1 /mnt/root/boot
grub-install --root-directory=/mnt/root --recheck --no-floppy /dev/sda
umount /mnt/root/boot
umount /mnt/root
reboot
share|improve this answer
1  
@forcefsck: Hang on. For /proc and /dev at least, you should be using mount --bind, not copying it. –  Faheem Mitha Mar 14 '11 at 15:57
    
You also want to bind mount /sys. –  Faheem Mitha Mar 14 '11 at 16:06
1  
@faheem, I know what the bind option does and how to use it. I've done this procedure a million times, I don't need to blindly follow a howto to install grub. Let @penyan follow my instructions without confusing him, and if he gets stack somewhere I'll guide him through. –  forcefsck Mar 14 '11 at 19:48
1  
@forcefsck: I don't want to get into an argument here, so I'll just say this. These instructions are not for you, they are for the poster, and they constitute generally recommended procedure. I don't think there is anything confusing about what I wrote. It is up to him what use he makes of it. That is all I have to say. –  Faheem Mitha Mar 14 '11 at 20:47
2  
@Faheem Mitha, instead of spamming with comments to my posted solution while giving different instructions than mine and confusing the OP (as it turned out), why don't you provide a complete solution of your own and let @penyuan choose which one actually helped him? –  forcefsck Mar 14 '11 at 22:49

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.