[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Lungo] tabella delle partizioni distrutta, un aiuto?



Ciao a tutti.
Ieri sera, dopo una lunga giornata, ho messo in pratica il detto che
errare è umano, ma che per fare veramente casino ci vuole la password
di ROOT!.

Senza riflettere più di tanto ho copia-incollato col mouse questo
comando:

pv < /dev/zero > /dev/sda

con l'intenzione di modificarlo sulla linea di comando di un terminale
dov'ero "root". Ovviamente nel copiare non ho pensato a un eventuale
carattere di "ENTER" alla fine della riga, che c'era: infatti in poco
tempo ho sovrascritto circa 1,6 GiB del disco del portatile con gli
zeri...., CTRL-C ha fermato il tutto, ma ormai il danno è fatto.

Il sistema è rimasto in piedi perché la prima partizione è di swap e la
seconda è /  .

Ora la macchina è ancora accesa (è un portatile), ci sta girando gpart
per vedere se riesce a capirci qualcosa, ma mi chiedo, le informazioni
di /proc/partitions /proc/devices /etc/fstab e/o altri file, possono
aiutarmi a ricostruire la tavole delle partizioni?

Il sistema è Stretch aggiornato ieri sera (verso le 21:30) prima della
stupidaggine....

Ecco il contenuto dei file che potrebbero servire, se qualcuno ha idee:

a514: ~# cat /etc/debian_version 
9.2
a514: ~# 


a514: ~# cat /proc/devices 
Character devices:
  1 mem
  4 /dev/vc/0
  4 tty
  4 ttyS
  5 /dev/tty
  5 /dev/console
  5 /dev/ptmx
  6 lp
  7 vcs
 10 misc
 13 input
 21 sg
 29 fb
 99 ppdev
108 ppp
116 alsa
128 ptm
136 pts
180 usb
188 ttyUSB
189 usb_device
216 rfcomm
226 drm
248 hidraw
249 mei
250 bsg
251 watchdog
252 rtc
253 tpm
254 gpiochip

Block devices:
259 blkext
  7 loop
  8 sd
 11 sr
 65 sd
 66 sd
 67 sd
 68 sd
 69 sd
 70 sd
 71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd


a514: ~# cat /proc/partitions 
major minor  #blocks  name

   8        0  488386584 sda
   8        1   20971520 sda1
   8        2  467414040 sda2
  11        0    1048575 sr0
a514: ~# 


a514: ~# lsscsi -dv
[0:0:0:0]    disk    ATA      TOSHIBA MQ01ABF0 1K    /dev/sda [8:0]
  dir: /sys/bus/scsi/devices/0:0:0:0  [/sys/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0]
[1:0:0:0]    cd/dvd  TSSTcorp CDDVDW SU-208FB  FU01  /dev/sr0 [11:0]
  dir: /sys/bus/scsi/devices/1:0:0:0  [/sys/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0]
a514: ~# 


a514: ~# fdisk -l /dev/sda
Disk /dev/sda: 465,8 GiB, 500107862016 bytes, 976773168 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
a514: ~# 


a514: ~# cat /etc/fstab 
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=62345bc2-c95d-4c3b-9e11-e98f1049a40c /               ext4    noatime,nodiratime,errors=remount-ro 0       1
# swap was on /dev/sda1 during installation
UUID=6754655f-762e-4e59-a8e6-3f8ade61e433 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
a514: ~# 


a514: ~# cat /etc/apt/sources.list
### File di configurazione di apt.
##  Versione del 2017-10-29-10.51, sostituzione di http con https dopo aver
##  installato apt-transport-https. Non funziona per virualbox.org.
##  Letto su https://lists.debian.org/debian-italian/2017/10/msg00154.html

## Stretch
deb https://deb.debian.org/debian-security stretch/updates main contrib non-free
deb https://deb.debian.org/debian/ stretch main contrib non-free
deb https://deb.debian.org/debian/ stretch-updates main contrib non-free
deb https://deb.debian.org/debian/ stretch-proposed-updates main contrib non-free
## deb https://deb.debian.org/debian/ stretch-backports main contrib non-free
a514: ~# 


Spero che possiate aiutarmi, altrimenti devo reinstallare, ma per
fortuna i dati sono riuscito a copiarli.

Allego anche il file testo con la scansione di gpart, l'ho scorso, vedo
due possibili partizioni (swap e / ), ma come uso i dati?
Anime molto pie che mi possono aiutare?

Grazie in anticipo

Giuliano

--
« I don't know what's the matter with people: they don't learn by
understanding; they learn by some other way — by rote or something.
Their knowledge is so fragile »

Richard Phillips Feynman, 
Surely You're Joking, Mr. Feynman!: Adventures of a Curious Character.

a514: ~# gpart -vv /dev/sda

dev(/dev/sda) mss(512) chs(60801/255/63)(LBA) #s(976773168) size(476940mb)

* Warning: strange partition table magic 0x0000.
Primary partition(1)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
   hex:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Primary partition(2)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
   hex:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Primary partition(3)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
   hex:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Primary partition(4)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
   hex:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


Begin scan...
Possible partition(Windows NT/W2K FS), size(0mb), offset(5432mb)
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(11126533-11126533)
   chs:  (692/151/41)-(692/151/41)d (692/151/41)-(692/151/41)r
   hex:  00 97 A9 B4 07 97 A9 B4 05 C7 A9 00 01 00 00 00

Possible partition(Windows NT/W2K FS), size(0mb), offset(6660mb)
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(13641301-13641301)
   chs:  (849/33/38)-(849/33/38)d (849/33/38)-(849/33/38)r
   hex:  00 21 E6 51 07 21 E6 51 55 26 D0 00 01 00 00 00

Possible partition(Windows NT/W2K FS), size(0mb), offset(6660mb)
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(13641312-13641312)
   chs:  (849/33/49)-(849/33/49)d (849/33/49)-(849/33/49)r
   hex:  00 21 F1 51 07 21 F1 51 60 26 D0 00 01 00 00 00

Possible partition(Windows NT/W2K FS), size(0mb), offset(6660mb)
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(13641325-13641325)
   chs:  (849/33/62)-(849/33/62)d (849/33/62)-(849/33/62)r
   hex:  00 21 FE 51 07 21 FE 51 6D 26 D0 00 01 00 00 00

Possible partition(Windows NT/W2K FS), size(0mb), offset(6660mb)
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(13641336-13641336)
   chs:  (849/34/10)-(849/34/10)d (849/34/10)-(849/34/10)r
   hex:  00 22 CA 51 07 22 CA 51 78 26 D0 00 01 00 00 00

Possible partition(Linux swap), size(8006mb), offset(9538mb)
   type: 130(0x82)(Linux swap or Solaris/x86)
   size: 8006mb #s(16396288) s(19533824-35930111)
   chs:  (1023/254/63)-(1023/254/63)d (1215/235/45)-(2236/139/15)r
   hex:  00 FE FF FF 82 FE FF FF 00 10 2A 01 00 30 FA 00

Possible partition(Linux ext2), size(459392mb), offset(17545mb)
   type: 131(0x83)(Linux ext2 filesystem)
   size: 459392mb #s(940834816) s(35932160-976766975)
   chs:  (1023/254/63)-(1023/254/63)d (2236/171/48)-(60800/237/45)r
   hex:  00 FE FF FF 83 FE FF FF 00 48 24 02 00 00 14 38

End scan.

Checking partitions...

* Partition invalid(too many primary partitions):
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(13641336-13641336)
   chs:  (849/34/10)-(849/34/10)d (849/34/10)-(849/34/10)r
   hex:  00 22 CA 51 07 22 CA 51 78 26 D0 00 01 00 00 00


* Partition invalid(too many primary partitions):
   type: 130(0x82)(Linux swap or Solaris/x86)
   size: 8006mb #s(16396288) s(19533824-35930111)
   chs:  (1023/254/63)-(1023/254/63)d (1215/235/45)-(2236/139/15)r
   hex:  00 FE FF FF 82 FE FF FF 00 10 2A 01 00 30 FA 00


* Partition invalid(too many primary partitions):
   type: 131(0x83)(Linux ext2 filesystem)
   size: 459392mb #s(940834816) s(35932160-976766975)
   chs:  (1023/254/63)-(1023/254/63)d (2236/171/48)-(60800/237/45)r
   hex:  00 FE FF FF 83 FE FF FF 00 48 24 02 00 00 14 38


* Warning: more than 4 primary partitions: 7.
Partition(OS/2 HPFS, NTFS, QNX or Advanced UNIX): primary 
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(11126533-11126533)
   chs:  (692/151/41)-(692/151/41)d (692/151/41)-(692/151/41)r
   hex:  00 97 A9 B4 07 97 A9 B4 05 C7 A9 00 01 00 00 00

Partition(OS/2 HPFS, NTFS, QNX or Advanced UNIX): primary 
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(13641301-13641301)
   chs:  (849/33/38)-(849/33/38)d (849/33/38)-(849/33/38)r
   hex:  00 21 E6 51 07 21 E6 51 55 26 D0 00 01 00 00 00

Partition(OS/2 HPFS, NTFS, QNX or Advanced UNIX): primary 
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(13641312-13641312)
   chs:  (849/33/49)-(849/33/49)d (849/33/49)-(849/33/49)r
   hex:  00 21 F1 51 07 21 F1 51 60 26 D0 00 01 00 00 00

Partition(OS/2 HPFS, NTFS, QNX or Advanced UNIX): primary 
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(13641325-13641325)
   chs:  (849/33/62)-(849/33/62)d (849/33/62)-(849/33/62)r
   hex:  00 21 FE 51 07 21 FE 51 6D 26 D0 00 01 00 00 00

Partition(OS/2 HPFS, NTFS, QNX or Advanced UNIX): invalid primary 
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(13641336-13641336)
   chs:  (849/34/10)-(849/34/10)d (849/34/10)-(849/34/10)r
   hex:  00 22 CA 51 07 22 CA 51 78 26 D0 00 01 00 00 00

Partition(Linux swap or Solaris/x86): invalid primary 
   type: 130(0x82)(Linux swap or Solaris/x86)
   size: 8006mb #s(16396288) s(19533824-35930111)
   chs:  (1023/254/63)-(1023/254/63)d (1215/235/45)-(2236/139/15)r
   hex:  00 FE FF FF 82 FE FF FF 00 10 2A 01 00 30 FA 00

Partition(Linux ext2 filesystem): invalid primary 
   type: 131(0x83)(Linux ext2 filesystem)
   size: 459392mb #s(940834816) s(35932160-976766975)
   chs:  (1023/254/63)-(1023/254/63)d (2236/171/48)-(60800/237/45)r
   hex:  00 FE FF FF 83 FE FF FF 00 48 24 02 00 00 14 38

Ok.

Guessed primary partition table:
Primary partition(1)
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(11126533-11126533)
   chs:  (692/151/41)-(692/151/41)d (692/151/41)-(692/151/41)r
   hex:  00 97 A9 B4 07 97 A9 B4 05 C7 A9 00 01 00 00 00

Primary partition(2)
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(13641301-13641301)
   chs:  (849/33/38)-(849/33/38)d (849/33/38)-(849/33/38)r
   hex:  00 21 E6 51 07 21 E6 51 55 26 D0 00 01 00 00 00

Primary partition(3)
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(13641312-13641312)
   chs:  (849/33/49)-(849/33/49)d (849/33/49)-(849/33/49)r
   hex:  00 21 F1 51 07 21 F1 51 60 26 D0 00 01 00 00 00

Primary partition(4)
   type: 007(0x07)(OS/2 HPFS, NTFS, QNX or Advanced UNIX)
   size: 0mb #s(1) s(13641325-13641325)
   chs:  (849/33/62)-(849/33/62)d (849/33/62)-(849/33/62)r
   hex:  00 21 FE 51 07 21 FE 51 6D 26 D0 00 01 00 00 00

a514: ~# 


Reply to: