Hi,
I'm trying to reinstall the grub. I'm trying to do the following :
mkdir /mnt/system
mount /dev/sda /mnt/system
mount --bind /dev /system/dev
chroot /mnt/system /bin/bash
grub
root (hd0,0)
setup(hd0)
"mount --bind /dev /mnt/system/dev", fails wiht:
"wrong fs type, bad option, bad superblock on /dev/, miising codepage or other error"
There is a proper way to reinstall grub using plop?
Thanks in advance
hi,
you don't have to mount and chroot. starting grub and using
root (hd0,0)
setup(hd0)
is enough.
hint: when you don't know the device number, then you can use "find" to get the correct device number. when your menu.lst is on a partition in /boot/grub/menu.lst then use "find /boot/grub/menu.lst"
when your /boot is an own partition then use "find /grub/menu.lst"
regards
elmar
Hi Elmar,
I thought to chroot into the partition because find comand fail.
grub> find /boot/grub/menu.lst
Error 15: File not found
whitout chroot, if I do:
grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
And thats ok, but then
grub> setup (hd0)
checking if "/boot/grub/stage1" exists.... no
checking if "grub/stage1" exists.... no
Error 2 Bad file or directory type
post the output of "ls /mnt/system" when you mounted the device there
[root@rescue system] ls
bin dev initrd.img media proc selinux tmp vmlinuz
boot etc lib mnt root srv usr
cdrom home lost+found opt sbin sys var
and "ls /mnt/system/boot"
[root@rescue boot] ls
config-2.6.26-2-686 grub initrd.img-2.6.26-2-686.bak config-2.6.26-2-686 initrd.img-2.6.26-2-686.bak vmlinuz-2.6.26-2-686
and "ls /mnt/system/boot/grub"
[root@rescue grub]
default fat_stage1_5 menu.lst~ stage1
device.map jfs_stage1_5 minix_stage1_5 stage2
e2fs_stage1_5 menu.lst reiserfs_stage1_5 xfs_stage1_5
ok, there is no menu.lst, so you have to use "find /boot/grub/stage1"
searching for stage1 is better than menu.lst because stage1 is an initial part of grub.
i think you will get (hd0) for root and not (hd0,0) because in your first post you said mount /dev/sda and not sda1
root (hd0)
setup (hd0)
ups, my fault about sda1, but menu.lst exist.
I tried to find stage1 and 2 before and also find fails...
the
root (hd0)
setup(hdo)
without chroot
root (hd0)
Filesystem type unknown, using whole disk
setup (hd0)
Error 17: cannot mount selected partition
hmm, i have no idea why the does not work.
(with sda1 its hd0,0)
there is only the one sata hard disk in the pc?
Hi Elmar,
I'm using a 4GB Compact Flash as a hd, and a 4GB USB pendrive to run plop.
edit: I'm using version 4.0.5
mount again sda1 to /mnt/system and do a "touch /mnt/system/x"
umount sda1 and then in grub do a "find /x"
same result
File not found
"find /ploplinux/ploplinux"
(hd1,0)
please post the file device.map from the grub directory
(hd0) /dev/sda
(hd1) /dev/sdb
hmm, try a fsck /dev/sda1
fsck result clean.
its difficult to find the problem when i am not in front of the machine. i don't know how you copied the linux to the hd. for a test, i would copy the linux files away, format the partition and create again the "x" file and try to find it with grub
I know it's difficult for you, I really appreciate your help.
I've formated the partition with "mkfs.ext3 /dev/sda1" and created the "x" file with touch.
Same results with find in grub.
I copied the linux files aprox. the same way.
-mkfs.ext3 /dev/sda1
- mount partition
- untar a tar.gz