Entra

View Full Version : problema reinstallare grub


kantele
22-10-2006, 14:59
su un pc con l'accoppiata ubuntu - windows, quest'ultimo è stato formattato ed ora ovviamente grub non funziona.
per reinstallare grub sto usando il cd di installazione di ubuntu 6.06, ma la procedura non mi va a buon fine.

premesso che il mio sistema è così suddiviso:
/dev/hda1 * 1 8404 67505098+ 7 HPFS/NTFS
/dev/hda2 8405 9733 10675192+ 5 Extended
/dev/hda3 9466 9733 2152710 b W95 FAT32
/dev/hda5 8405 9399 7992274+ 83 Linux
/dev/hda6 9400 9465 530113+ 82 Linux swap / Solaris

dopo aver montato la partizione di ubuntu (hda5) dandogli il comando "grub-install /dev/hda" ottengo sempre

root@ubuntu:/# /sbin/grub-install /dev/hda
Could not find device for /boot: Not found or not a block device.

ho provato anche entrare nel menu di grub, ma dandoli il comando "setup" ottengo

grub> root (hd0,5)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 15 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed

Error 12: Invalid device requested

grub>

dove sbaglio?? :mc:

Marco-S
22-10-2006, 23:18
Monta la /dev/hda5 dentro la /mnt

da /mnt lancia un bel chroot /mnt

poi vai dentro /boot/grub

e poi lancia grub-install /dev/hda

facci sapere

k_apo
23-10-2006, 08:59
mount /dev/hda5 /media/CARTELLACHEVUOI
grub-install --root-directory=/media/CARTELLACHEVUOI/boot /dev/hda

Prova cosi' a me andava, ciao.

P.S.
Non sono sicuro solo del boot/ fai delle prove
Ciao

kantele
23-10-2006, 17:09
per la procedura indicata da Marco-S, dopo aver montato il tutto sono entrato nella directory di grub (quella della mia partizione di ubuntu, vero?), ma lanciando il grub-install ottengo sempre questo:

root@ubuntu:/mnt/boot/grub# ls
default fat_stage1_5 menu.lst~ splash.xpm.gz xfs_stage1_5
device.map jfs_stage1_5 minix_stage1_5 stage1
e2fs_stage1_5 menu.lst reiserfs_stage1_5 stage2
root@ubuntu:/mnt/boot/grub# grub-install /dev/hda
Could not find device for /boot: Not found or not a block device.
root@ubuntu:/mnt/boot/grub#

per la procedura di k_apo (sempre avendo montato la hda5 nella directory /mnt):

root@ubuntu:/# grub-install --root-directory=/mnt/ /dev/hda
Probing devices to guess BIOS drives. This may take a long time.
/dev/hda: Not found or not a block device.

oppure:

root@ubuntu:~# grub-install --root-directory=/mnt/boot/ /dev/hda
Probing devices to guess BIOS drives. This may take a long time.
/dev/hda: Not found or not a block device.

Marco-S
25-10-2006, 01:18
per la procedura indicata da Marco-S, dopo aver montato il tutto sono entrato nella directory di grub (quella della mia partizione di ubuntu, vero?), ma lanciando il grub-install ottengo sempre questo:


L'ho fatto proprio il mese scorso ma m'è sfuggito qualcosa...

Allora, quando hai fatto chroot /mnt dai poi il comando su - (oppure usa sudo visto che è ubuntu) e poi rilancia il grub-install /dev/hda

p.s.: scusa per il post precedente, ho scritto /boot/grub; invece dovevo mettere /mnt/boot/grub. Hai fatto bene tu comunque. Prova e facci sapere ;)

k_apo
25-10-2006, 13:40
[..]per la procedura di k_apo (sempre avendo montato la hda5 nella directory /mnt):

root@ubuntu:/# grub-install --root-directory=/mnt/ /dev/hda
Probing devices to guess BIOS drives. This may take a long time.
/dev/hda: Not found or not a block device.

Allora prima cosa e' questa l'opzione giusta:
root@ubuntu:/# grub-install --root-directory=/media/CARTELLACHEVUOI /dev/hda
quindi senza il /boot.
Per quanto riguarda quell'errore, l'unica cosa che mi viene in mente e' che il sistema in live ha datto al tuo hard disk un device name diverso, prova a fare un cat /proc/partitions, dovrebbe darti tutte le partizioni con i device name, e controlla che sia giusto /dev/hda.
Ciao

kantele
25-10-2006, 17:21
il risultato di cat /proc/partitions è:

ubuntu@ubuntu:~$ cat /proc/partitions
major minor #blocks name

3 0 78184008 hda
3 1 67505098 hda1
3 2 1 hda2
3 3 2152710 hda3
3 5 7992274 hda5
3 6 530113 hda6
7 0 636972 loop0
253 0 67505098 dm-0
253 1 2152710 dm-1
253 2 7992274 dm-2
253 3 530113 dm-3

(quindi grub-install /dev/hda è giusto?)

@Marco-S: anche dando un bel su- il risultato è uguale:

root@ubuntu:/mnt/boot/grub# su -
root@ubuntu:~# grub-install /dev/hda
/dev/hda: Not found or not a block device. :muro: :help: