mbr überschreiben mit grub

Du kommst mit der Installation nicht voran oder willst noch was nachfragen? Schau auch in den "Tipps und Tricks"-Bereich.
Antworten
Benutzeravatar
Weissbrot
Beiträge: 193
Registriert: 02.07.2004 01:03:44

mbr überschreiben mit grub

Beitrag von Weissbrot » 07.12.2005 21:53:44

Hi,
hatte win98 und Debian auf der Platte, als bootloader Grub.
Habe win98 neuinstalliert (hda1).Grub ist ja dann leider überschrieben.
HAbe Knoppix gebootet und als root

Code: Alles auswählen

grub-install /dev/hda
dann sagt er

Code: Alles auswählen

dateisystem nur lesbar
ein

Code: Alles auswählen

mount -o rw /dev/hda
ergibt

Code: Alles auswählen

/dev/hda nicht in der fstab gefunden
wie krieg ich das denn geregelt?
If Bill Gates had a penny for every time Windows crashed… ..oh wait, he does. ...

Benutzeravatar
Zylinderkopfdichtung
Beiträge: 1
Registriert: 07.12.2005 20:48:23

Beitrag von Zylinderkopfdichtung » 08.12.2005 10:42:09

Ich empfehle dir für das booten den Gag Boot Manager. Sieht zwar hässlich aus, ist aber sehr komfortabel :)
http://gag.sourceforge.net/

Benutzeravatar
Weissbrot
Beiträge: 193
Registriert: 02.07.2004 01:03:44

Beitrag von Weissbrot » 08.12.2005 10:48:19

Habe das hier im Forum gefunden:
  • Ich mach das so,
    zuerst von Knoppix/Kanotix oder ähnliches booten.
    Dann als root:
    Code:

    mount /dev/hdaX /mnt/hdaX
    mount -o bind /dev/ /mnt/hdaX/dev
    mount -o bind /proc/ /mnt/hdaX/proc/
    chroot /mnt/hdaX /bin/bash
    grub-install /dev/hda


    /dev/hdaX ist deine Root-Partition von Debian.
Hat so leider nicht funktioniert, die Meldungen im terminalfenter weiss ich nicht mehr :cry:

Ps:Es muss ja auch nicht grub sein, lilo täte es auch, ich muss nur endlich an meinen Rechner.
If Bill Gates had a penny for every time Windows crashed… ..oh wait, he does. ...

Benutzeravatar
Weissbrot
Beiträge: 193
Registriert: 02.07.2004 01:03:44

Beitrag von Weissbrot » 08.12.2005 12:57:18

meine debian root-partition liegt auf hda8 also:

Code: Alles auswählen

mount /dev/hda8 /mnt/hda8
mount -o bind /dev/ /mnt/hda8/dev
mount -o bind /proc/ /mnt/hda8/proc/
chroot /mnt/hda8 /bin/bash
grub-install /dev/hda 
geht aber nicht...

windows liegt auf hda1

WAS IST HIER BITTE FALSCH??
If Bill Gates had a penny for every time Windows crashed… ..oh wait, he does. ...

darkday
Beiträge: 71
Registriert: 03.11.2005 14:58:03

Beitrag von darkday » 08.12.2005 13:39:39

hatte das Problem auch schonmal versuchs mal ohne chroot, direkt im knoppix, /dev/hdaX erst mal nicht mounten und dann:

grub-install --root-directory=/dev/hdaX /dev/hda

wenn das net geht, dann vll doch mal mounten.
So irgendwie hats dann bei mir funktioniert!

Benutzeravatar
Weissbrot
Beiträge: 193
Registriert: 02.07.2004 01:03:44

Beitrag von Weissbrot » 08.12.2005 13:56:37

steht hdax für hda8 (meine /) oder für hda1 (windows C )

Code: Alles auswählen

root@ttyp3[knoppix]# grub-install --root-directory=/dev/hda8 /dev/hda
mkdir: kann Verzeichnis ,,/dev/hda8/boot" nicht anlegen: Ist kein Verzeichnis
root@ttyp3[knoppix]#
If Bill Gates had a penny for every time Windows crashed… ..oh wait, he does. ...

BermudaHonk
Beiträge: 184
Registriert: 21.09.2005 10:43:37
Wohnort: Dresden

Beitrag von BermudaHonk » 08.12.2005 14:07:22

Hi,
es gibt bei mount die Option dev und nodev. Näheres dazu gibts in der Man-Page von mount. Es müsste dev mitgegeben werden, damit man von Knoppix aus in den MBR schreiben kann. Also die Partition von Hand mounten und dann mit Grub den MBR wiederherstellen.

Gruß BermudaHonk
The only Microsoft product ever to ship that doesn't suck will probably be a vacuum cleaner!

darkday
Beiträge: 71
Registriert: 03.11.2005 14:58:03

Beitrag von darkday » 08.12.2005 14:13:02

Weissbrot hat geschrieben:steht hdax für hda8 (meine /) oder für hda1 (windows C )
Fuer hda8 ! Die Partition auf der in /boot/grub dein grub liegt!

Benutzeravatar
Weissbrot
Beiträge: 193
Registriert: 02.07.2004 01:03:44

Beitrag von Weissbrot » 09.12.2005 12:01:15

@ZYlinderkopfdichtung
Willkommen im Forum. GAG vielleicht später mal, danke.
@all
kann mir jemand eas zu den Fehlermeldungen weiter unten sagen? Hier weitere Fehlversuche:
@darkday

Code: Alles auswählen

root@ttyp3[knoppix]# grub-install --root-directory=/dev/hda8 /dev/hda
mkdir: kann Verzeichnis ,,/dev/hda8/boot" nicht anlegen: Ist kein Verzeichnis
root@ttyp3[knoppix]# mount -o rw /dev/hda8
root@ttyp3[knoppix]# grub-install --root-directory=/dev/hda8 /dev/hda
mkdir: kann Verzeichnis ,,/dev/hda8/boot" nicht anlegen: Ist kein Verzeichnis
dann weiter mit

Code: Alles auswählen

root@ttyp3[knoppix]# cd /mnt/hda8/
root@ttyp3[hda8]# grub-install --root-directory=/dev/hda8 /dev/hda
mkdir: kann Verzeichnis ,,/dev/hda8/boot" nicht anlegen: Ist kein Verzeichnis
root@ttyp3[hda8]# grub-install /dev/hda
mkdir: kann Verzeichnis ,,/boot/grub" nicht anlegen: Das Dateisystem ist nur lesbar
root@ttyp3[hda8]# chroot /mnt/hda8 /bin/bash
Knoppix:/# grub-install /dev/hda
/sbin/grub-install: line 1: sort: command not found
/sbin/grub-install: line 1: uniq: command not found
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 477: /dev/null: Permission denied
/sbin/grub-install: line 479: /dev/null: Permission denied
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 477: /dev/null: Permission denied
/sbin/grub-install: line 479: /dev/null: Permission denied
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 477: /dev/null: Permission denied
/sbin/grub-install: line 479: /dev/null: Permission denied
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 477: /dev/null: Permission denied
/sbin/grub-install: line 479: /dev/null: Permission denied
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 477: /dev/null: Permission denied
/sbin/grub-install: line 479: /dev/null: Permission denied
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 477: /dev/null: Permission denied
/sbin/grub-install: line 479: /dev/null: Permission denied
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 477: /dev/null: Permission denied
/sbin/grub-install: line 479: /dev/null: Permission denied
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 477: /dev/null: Permission denied
/sbin/grub-install: line 479: /dev/null: Permission denied
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 502: /dev/null: Permission denied
/sbin/grub-install: line 522: /dev/null: Permission denied
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0)   /dev/hda
@BermudaHonk

Code: Alles auswählen

Knoppix:/# mount -o remount,rw,dev /dev/hda8
Knoppix:/# grub-install /dev/hda
/sbin/grub-install: line 1: sort: command not found
/sbin/grub-install: line 1: uniq: command not found
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 1: expr: command not found
/sbin/grub-install: line 472: test: -gt: unary operator expected
/sbin/grub-install: line 485: test: -eq: unary operator expected
/sbin/grub-install: line 502: which: command not found


    GNU GRUB  version 0.95  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]
grub> root (hd0,)

Error 12: Invalid device requested
grub> setup  --stage2=/boot/grub/stage2 --prefix=/boot/grub (hd0)

Error 12: Invalid device requested
grub> quit
Knoppix:/#
If Bill Gates had a penny for every time Windows crashed… ..oh wait, he does. ...

Benutzeravatar
Weissbrot
Beiträge: 193
Registriert: 02.07.2004 01:03:44

Beitrag von Weissbrot » 09.12.2005 13:43:24

So, Problem behoben.
Habe auf Anraten eines Freundes mal eine SUSE-Installations-CD reingeschoben. Da gibt's nach dem Hardware-check die Option "Installiertes System starten", dann wurde mein Debian hochgefahren. Anschliessend als root

Code: Alles auswählen

grub-install /dev/hda
und fertig.
Feine Sache das. :)
If Bill Gates had a penny for every time Windows crashed… ..oh wait, he does. ...

BermudaHonk
Beiträge: 184
Registriert: 21.09.2005 10:43:37
Wohnort: Dresden

Beitrag von BermudaHonk » 09.12.2005 13:44:09

Hi
Du kannst mit

Code: Alles auswählen

--root-directory=/dev/hda8
nicht arbeiten, der GRUB kann doch nicht auf ein "blockorientiertes Gerät" eine Datei erzeugen. Du musst hier schon sowas die /mnt/hda8 angeben.

Des weiteren:
Dein Dateisystem besteht (so wie ich deine Fehlerausgaben deute) aus mehreren Partitionen, das Programm sort befindet sich aber unter /usr/bin, und da Du vermutlich nur die "root-Partition" mountest wird GRUB mit chroot ausgeführt nicht klappen!
Du musst hier in die gemountete "root-Partition" das entsprechende "/usr" einbinden.

Gruß BermudaHonk
The only Microsoft product ever to ship that doesn't suck will probably be a vacuum cleaner!

Benutzeravatar
Weissbrot
Beiträge: 193
Registriert: 02.07.2004 01:03:44

Beitrag von Weissbrot » 10.12.2005 17:44:32

@BermudaHonk
Trotzdem: Danke! :wink:
If Bill Gates had a penny for every time Windows crashed… ..oh wait, he does. ...

Antworten