Grub rescue dopo l'avvio: come fare?

Problemi riscontrati durante l'installazione di Ubuntu, degli aggiornamenti e degli avanzamenti del sistema.
Scrivi risposta
IvanPsy
Prode Principiante
Messaggi: 51
Iscrizione: giovedì 5 aprile 2012, 8:27

Grub rescue dopo l'avvio: come fare?

Messaggio da IvanPsy »

Chiedo scusa: so che è già stato postato un problema simile, ma è stato contrassegnato come risolto, quindi mi permetto di proporre il mio problema in questo nuovo thread.
Ho provato con vari tutorial trovati sul Web, ma nessuna procedura è arrivata a compimento.

Spengo il PC, lo riaccendo, e mi compare initrans, poi il prompt grub rescue, dicendomi che

Codice: Seleziona tutto

error: attempt to read or write outside of the disk 'hd0'
Da Live USB si avvia, ma non riesco ad accedere all'HD: con un fdisk vedo che esiste la sda, ma se da file manager digito /dev/sda1 (la partizione che mi viene flaggata come Linux e come boot) non mi compare nulla.

Ho provato con Boot Repair, mi analizza l'HD ma non mi da l'opzione per ripararlo.
Qui che cosa mi ha trovato:
http://paste2.org/LY42zEZ0

Nessuna procedura che ho trovato sul Web, sia da terminale della Live che da grub rescue ha funzionato.
Solitamente mi da errore quando c'è da montare la partizione o fare qualche operazione simile.
Anche i tentativi di ripristinare il Grub non hanno funzionato: tutti mi hanno segnalato errore in un punto o nell'altro.

Come posso fare?

A me non interessa l'HD in sè: è ormai molto vecchi e comunque vogli cambiare PC.
A me interessa riuscire ad accedere ai file conservati nell'HD.
ivantu
Rampante Reduce
Rampante Reduce
Messaggi: 6658
Iscrizione: sabato 8 giugno 2013, 9:25
Desktop: Ubuntu Lubuntu Budgie
Distribuzione: 20.04 LTS; 22.04 LTS
Sesso: Maschile

Re: Grub rescue dopo l'avvio: come fare?

Messaggio da ivantu »

Se ti interessa recuperare i dati fai prima ad compreare un hdd esterno e con una versione live di ubuntu e un software tipo di Recovery 'TestDisk', copiarti tutto.

Il problema che visualizzo nel file c'è un errore di input/output, cosa che ti chiedo, dove hai installato il sistema? dev/sda1?
sembra che gli mancherebbe il flag di boot...
In Live, avvia il disco fisso, e posta qui il comando

Codice: Seleziona tutto

sudo fdisk -l

Codice: Seleziona tutto

sudo parted -l
e un'altra domanda, quando gli dai il comando di ripristino MBR, dove lo imposti? nel disco sda o sdb?
Buona giornata utenti del forum. :ciao: ivantu
IvanPsy
Prode Principiante
Messaggi: 51
Iscrizione: giovedì 5 aprile 2012, 8:27

Re: Grub rescue dopo l'avvio: come fare?

Messaggio da IvanPsy »

ivantu ti ringrazio per la risposta.

Ho provato TestDisk, ma non mi permette di accedere all-elenco dei file contenuti in questo HD> mi dice che non pu; farlo per via del filesystem.
Quindi adesso non so come fare almeno a recuperare i file, a meno che non esistano altri tool piu` potenti di TestDisk.

Eccoti i comandi che mi hai chiesto (tieni conto che adesso ho montato l`HD dentro il PC)...

sudo fdisk -l

Codice: Seleziona tutto

Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram1: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram2: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram3: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram4: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram5: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram6: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram7: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram8: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram9: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram10: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram11: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram12: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram13: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram14: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/loop0: 852.1 MiB, 893485056 bytes, 1745088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000ca81a

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048 968452095 968450048 461.8G 83 Linux
/dev/sda2       968454142 976771071   8316930     4G  5 Extended
/dev/sda5       968454144 976771071   8316928     4G 82 Linux swap / Solaris




Disk /dev/sdb: 3.8 GiB, 4051697664 bytes, 7913472 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7fd3dc57

Device     Boot Start     End Sectors  Size Id Type
/dev/sdb1  *       32 7913471 7913440  3.8G  c W95 FAT32 (LBA)


Disk /dev/zram0: 979.6 MiB, 1027190784 bytes, 250779 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram1: 979.6 MiB, 1027190784 bytes, 250779 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
sudo parted -l

Codice: Seleziona tutto

Model: ATA SAMSUNG HM500JI (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size    Type      File system     Flags
 1      1049kB  496GB  496GB   primary                   boot
 2      496GB   500GB  4258MB  extended
 5      496GB   500GB  4258MB  logical   linux-swap(v1)


Model: USB Flash DISK (scsi)
Disk /dev/sdb: 4052MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      16.4kB  4052MB  4052MB  primary  fat32        boot, lba


Model: Unknown (unknown)
Disk /dev/zram1: 1027MB
Sector size (logical/physical): 4096B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system     Flags
 1      0.00B  1027MB  1027MB  linux-swap(v1)


Model: Unknown (unknown)
Disk /dev/zram0: 1027MB
Sector size (logical/physical): 4096B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system     Flags
 1      0.00B  1027MB  1027MB  linux-swap(v1)
ivantu
Rampante Reduce
Rampante Reduce
Messaggi: 6658
Iscrizione: sabato 8 giugno 2013, 9:25
Desktop: Ubuntu Lubuntu Budgie
Distribuzione: 20.04 LTS; 22.04 LTS
Sesso: Maschile

Re: Grub rescue dopo l'avvio: come fare?

Messaggio da ivantu »

il flag boot mi sembra ok.

ora da Live, proviamo a controllare lo stato del disco. Con la rete internet connessa, installa questo pacchetto

Codice: Seleziona tutto

sudo apt install smartmontools
e poi copia l'output al comando

Codice: Seleziona tutto

sudo smartctl -a /dev/sd*
sostituisci /dev/sd* l'asterisco con a o b, ti dico perchè succede che avvolte in live potrebbero invertirsi, avendo collegato anche un altro secondo disco.

Poi riporta qui l'output di questo comando

Codice: Seleziona tutto

sudo fsck /dev/sda1
per poter riparare il filesystem. Assicurati di non aver il disco in uso, quindi dallo da Live.
Buona giornata utenti del forum. :ciao: ivantu
IvanPsy
Prode Principiante
Messaggi: 51
Iscrizione: giovedì 5 aprile 2012, 8:27

Re: Grub rescue dopo l'avvio: come fare?

Messaggio da IvanPsy »

Eccomi! Ti chiedo scusa, ma spesso sono fuori per lavoro e non tutte le sere riesco a mettere mano al PC.

Ecco quello che mi hai chiesto...

sudo smartctl -a /dev/sda

Codice: Seleziona tutto

smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.8.0-22-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     SAMSUNG SpinPoint M7
Device Model:     SAMSUNG HM500JI
Serial Number:    S208JD0SA27665
LU WWN Device Id: 5 0024e9 0024d31ca
Firmware Version: 2AC101C4
User Capacity:    500,107,862,016 bytes [500 GB]
Sector Size:      512 bytes logical/physical
Form Factor:      2.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS T13/1699-D revision 6
SATA Version is:  SATA 2.6, 1.5 Gb/s
Local Time is:    Wed Feb 22 18:01:07 2017 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00)	Offline data collection activity
					was never started.
					Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever 
					been run.
Total time to complete Offline 
data collection: 		( 8160) seconds.
Offline data collection
capabilities: 			 (0x5b) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					command.
					Offline surface scan supported.
					Self-test supported.
					No Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine 
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 ( 136) minutes.
SCT capabilities: 	       (0x003f)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   100   100   051    Pre-fail  Always       -       1237
  2 Throughput_Performance  0x0026   252   252   000    Old_age   Always       -       0
  3 Spin_Up_Time            0x0023   090   045   025    Pre-fail  Always       -       3060
  4 Start_Stop_Count        0x0032   096   096   000    Old_age   Always       -       4577
  5 Reallocated_Sector_Ct   0x0033   252   252   010    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   252   252   051    Old_age   Always       -       0
  8 Seek_Time_Performance   0x0024   252   252   015    Old_age   Offline      -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       12778
 10 Spin_Retry_Count        0x0032   252   252   051    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       210
 12 Power_Cycle_Count       0x0032   096   096   000    Old_age   Always       -       4434
191 G-Sense_Error_Rate      0x0022   099   099   000    Old_age   Always       -       13879
192 Power-Off_Retract_Count 0x0022   252   252   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0002   064   053   000    Old_age   Always       -       22 (Min/Max 5/47)
195 Hardware_ECC_Recovered  0x003a   100   100   000    Old_age   Always       -       0
196 Reallocated_Event_Count 0x0032   252   252   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       13
198 Offline_Uncorrectable   0x0030   252   252   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0036   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x002a   100   100   000    Old_age   Always       -       59
223 Load_Retry_Count        0x0032   100   100   000    Old_age   Always       -       210
225 Load_Cycle_Count        0x0032   001   001   000    Old_age   Always       -       9743016

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 0
Note: revision number not 1 implies that no selective self-test has ever been run
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Completed [00% left] (0-65535)
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
sudo fsck /dev/sda1

Codice: Seleziona tutto

fsck from util-linux 2.28.2
e2fsck 1.43.3 (04-Sep-2016)
fsck.ext2: Attempt to read block from filesystem resulted in short read while trying to open /dev/sda1
Could this be a zero-length partition?
Prossimo step?

Grazie!
ivantu
Rampante Reduce
Rampante Reduce
Messaggi: 6658
Iscrizione: sabato 8 giugno 2013, 9:25
Desktop: Ubuntu Lubuntu Budgie
Distribuzione: 20.04 LTS; 22.04 LTS
Sesso: Maschile

Re: Grub rescue dopo l'avvio: come fare?

Messaggio da ivantu »

Disco è ok.
Filesystem della partizione /dev/sda1 è in sola lettura...

Riesci ad accedere (mount) alla partizione con il problema dalla Live? e ridai l'ultimo comando
Buona giornata utenti del forum. :ciao: ivantu
IvanPsy
Prode Principiante
Messaggi: 51
Iscrizione: giovedì 5 aprile 2012, 8:27

Re: Grub rescue dopo l'avvio: come fare?

Messaggio da IvanPsy »

ivantu [url=http://forum.ubuntu-it.org/viewtopic.php?p=4961132#p4961132][img]http://forum.ubuntu-it.org/images/icons/icona-cita.gif[/img][/url] ha scritto:Disco è ok.
Filesystem della partizione /dev/sda1 è in sola lettura...

Riesci ad accedere (mount) alla partizione con il problema dalla Live? e ridai l'ultimo comando
Scusa l'ignoranza, ma come utilizzo il comando "mount", in questo caso?

Grazie!
ivantu
Rampante Reduce
Rampante Reduce
Messaggi: 6658
Iscrizione: sabato 8 giugno 2013, 9:25
Desktop: Ubuntu Lubuntu Budgie
Distribuzione: 20.04 LTS; 22.04 LTS
Sesso: Maschile

Re: Grub rescue dopo l'avvio: come fare?

Messaggio da ivantu »

per fare il mount, in Live.
Se utilizzi ubuntu, apri il gestore directory Nautilus, nella scheda... a sinistra in Devices, già dovresti vedere con le "etichette" delle partizioni nel disco fisso se sono attive.
Buona giornata utenti del forum. :ciao: ivantu
IvanPsy
Prode Principiante
Messaggi: 51
Iscrizione: giovedì 5 aprile 2012, 8:27

Re: Grub rescue dopo l'avvio: come fare?

Messaggio da IvanPsy »

ivantu [url=http://forum.ubuntu-it.org/viewtopic.php?p=4961368#p4961368][img]http://forum.ubuntu-it.org/images/icons/icona-cita.gif[/img][/url] ha scritto:per fare il mount, in Live.
Se utilizzi ubuntu, apri il gestore directory Nautilus, nella scheda... a sinistra in Devices, già dovresti vedere con le "etichette" delle partizioni nel disco fisso se sono attive.
Su Nautilus non vedo l`HD, e neanche l`etichetta Devices (tieni conto che sto usando Lubuntu, ed ho anche installato il Nautilus per sicurezza).
Su Disks lo vedo, ma mi da partition type e contents unknown.
Con Gparted inizia a cercare i dispositivi, ma dopo un po` mi da un errore in scrittura\lettura per il sda, ossia il dispositivo incriminato.
ivantu
Rampante Reduce
Rampante Reduce
Messaggi: 6658
Iscrizione: sabato 8 giugno 2013, 9:25
Desktop: Ubuntu Lubuntu Budgie
Distribuzione: 20.04 LTS; 22.04 LTS
Sesso: Maschile

Re: Grub rescue dopo l'avvio: come fare?

Messaggio da ivantu »

guarda questa discussione trovata in rete recupero dati su disco unknown
Buona giornata utenti del forum. :ciao: ivantu
Scrivi risposta

Ritorna a “Installazione e aggiornamento del sistema operativo”

Chi c’è in linea

Visualizzano questa sezione: 0 utenti iscritti e 18 ospiti