Author Topic: install grub with plop  (Read 11793 times)

Dongalor

  • Newbie
  • *
  • Posts: 16
install grub with plop
« on: January 31, 2011, 13:08:50 PM »
Hi,

I'm trying to reinstall the grub. I'm trying to do the following :

Code: [Select]
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

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2450
  • a command shell is enough to do amazing things
Re: install grub with plop
« Reply #1 on: January 31, 2011, 13:27:12 PM »
hi,

you don't have to mount and chroot.  starting grub and using

Code: [Select]
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

Dongalor

  • Newbie
  • *
  • Posts: 16
Re: install grub with plop
« Reply #2 on: January 31, 2011, 17:53:37 PM »
Hi Elmar,

I thought to chroot into the partition because find comand fail.
Code: [Select]
grub> find /boot/grub/menu.lst
Error 15: File not found

whitout chroot, if I do:
Code: [Select]
grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0x83

And thats ok, but then
Code: [Select]
grub>  setup (hd0)
checking if "/boot/grub/stage1" exists.... no
checking if "grub/stage1" exists.... no
Error 2  Bad file or directory type






Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2450
  • a command shell is enough to do amazing things
Re: install grub with plop
« Reply #3 on: January 31, 2011, 18:04:28 PM »
post the output of "ls /mnt/system" when you mounted the device there

Dongalor

  • Newbie
  • *
  • Posts: 16
Re: install grub with plop
« Reply #4 on: January 31, 2011, 18:27:20 PM »
Code: [Select]
[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   

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2450
  • a command shell is enough to do amazing things
Re: install grub with plop
« Reply #5 on: January 31, 2011, 18:30:11 PM »
and "ls /mnt/system/boot"

Dongalor

  • Newbie
  • *
  • Posts: 16
Re: install grub with plop
« Reply #6 on: January 31, 2011, 18:36:59 PM »
Code: [Select]
[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


Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2450
  • a command shell is enough to do amazing things
Re: install grub with plop
« Reply #7 on: January 31, 2011, 18:37:47 PM »
and "ls /mnt/system/boot/grub"

Dongalor

  • Newbie
  • *
  • Posts: 16
Re: install grub with plop
« Reply #8 on: January 31, 2011, 18:44:08 PM »
Code: [Select]
[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

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2450
  • a command shell is enough to do amazing things
Re: install grub with plop
« Reply #9 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)

Dongalor

  • Newbie
  • *
  • Posts: 16
Re: install grub with plop
« Reply #10 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

Code: [Select]
root (hd0)
Filesystem type unknown, using whole disk
setup (hd0)
Error 17: cannot mount selected partition

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2450
  • a command shell is enough to do amazing things
Re: install grub with plop
« Reply #11 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?

Dongalor

  • Newbie
  • *
  • Posts: 16
Re: install grub with plop
« Reply #12 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

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2450
  • a command shell is enough to do amazing things
Re: install grub with plop
« Reply #13 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"

Dongalor

  • Newbie
  • *
  • Posts: 16
Re: install grub with plop
« Reply #14 on: February 01, 2011, 10:44:30 AM »
same result

File not found

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2450
  • a command shell is enough to do amazing things
Re: install grub with plop
« Reply #15 on: February 01, 2011, 10:49:24 AM »
"find /ploplinux/ploplinux"

Dongalor

  • Newbie
  • *
  • Posts: 16
Re: install grub with plop
« Reply #16 on: February 01, 2011, 11:30:47 AM »
(hd1,0)

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2450
  • a command shell is enough to do amazing things
Re: install grub with plop
« Reply #17 on: February 01, 2011, 11:36:32 AM »
please post the file device.map from the grub directory

Dongalor

  • Newbie
  • *
  • Posts: 16
Re: install grub with plop
« Reply #18 on: February 01, 2011, 11:38:12 AM »
(hd0)   /dev/sda
(hd1)   /dev/sdb

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2450
  • a command shell is enough to do amazing things
Re: install grub with plop
« Reply #19 on: February 01, 2011, 11:49:29 AM »
hmm, try a fsck /dev/sda1

Dongalor

  • Newbie
  • *
  • Posts: 16
Re: install grub with plop
« Reply #20 on: February 01, 2011, 12:48:58 PM »
fsck result clean.

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2450
  • a command shell is enough to do amazing things
Re: install grub with plop
« Reply #21 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

Dongalor

  • Newbie
  • *
  • Posts: 16
Re: install grub with plop
« Reply #22 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