Plop Forum

General Category => Plop Linux => Topic started by: Dongalor on January 31, 2011, 13:08:50 PM

Title: install grub with plop
Post by: Dongalor on January 31, 2011, 13:08:50 PM
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
Title: Re: install grub with plop
Post by: Elmar on January 31, 2011, 13:27:12 PM
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
Title: Re: install grub with plop
Post by: Dongalor on January 31, 2011, 17:53:37 PM
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






Title: Re: install grub with plop
Post by: Elmar on January 31, 2011, 18:04:28 PM
post the output of "ls /mnt/system" when you mounted the device there
Title: Re: install grub with plop
Post by: Dongalor on January 31, 2011, 18:27:20 PM

[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   
Title: Re: install grub with plop
Post by: Elmar on January 31, 2011, 18:30:11 PM
and "ls /mnt/system/boot"
Title: Re: install grub with plop
Post by: Dongalor on January 31, 2011, 18:36:59 PM

[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

Title: Re: install grub with plop
Post by: Elmar on January 31, 2011, 18:37:47 PM
and "ls /mnt/system/boot/grub"
Title: Re: install grub with plop
Post by: Dongalor on January 31, 2011, 18:44:08 PM

[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
Title: Re: install grub with plop
Post by: Elmar on January 31, 2011, 18:52:28 PM
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)
Title: Re: install grub with plop
Post by: Dongalor on January 31, 2011, 19:00:15 PM
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
Title: Re: install grub with plop
Post by: Elmar on January 31, 2011, 19:42:16 PM
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?
Title: Re: install grub with plop
Post by: Dongalor on February 01, 2011, 10:00:16 AM
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
Title: Re: install grub with plop
Post by: Elmar on February 01, 2011, 10:11:58 AM
mount again sda1 to /mnt/system and do a "touch /mnt/system/x"
umount sda1 and then in grub do a "find /x"
Title: Re: install grub with plop
Post by: Dongalor on February 01, 2011, 10:44:30 AM
same result

File not found
Title: Re: install grub with plop
Post by: Elmar on February 01, 2011, 10:49:24 AM
"find /ploplinux/ploplinux"
Title: Re: install grub with plop
Post by: Dongalor on February 01, 2011, 11:30:47 AM
(hd1,0)
Title: Re: install grub with plop
Post by: Elmar on February 01, 2011, 11:36:32 AM
please post the file device.map from the grub directory
Title: Re: install grub with plop
Post by: Dongalor on February 01, 2011, 11:38:12 AM
(hd0)   /dev/sda
(hd1)   /dev/sdb
Title: Re: install grub with plop
Post by: Elmar on February 01, 2011, 11:49:29 AM
hmm, try a fsck /dev/sda1
Title: Re: install grub with plop
Post by: Dongalor on February 01, 2011, 12:48:58 PM
fsck result clean.
Title: Re: install grub with plop
Post by: Elmar on February 01, 2011, 13:18:19 PM
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
Title: Re: install grub with plop
Post by: Dongalor on February 01, 2011, 13:46:13 PM
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