dd diminuiu o tamanho do ssd

2

Meu SDd de 32 GB foi particionado com 8 GB e 29 GB. Eu usei o dd para escrever o ubuntu iso no meu pendrive, mas acidentalmente o escrevi na minha partição de 8 gb do meu ssd. Agora, o partpart gparted mostra essa partição de 8 Gb. Como faço para recuperar isso? o comando foi dd if=path_to_iso of=/dev/sdb onde sdb é o ssd A saída de sudo fdisk -l é:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 500.1 GB, 500107862016 bytes  
255 heads, 63 sectors/track, 60801 cylinders, total 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  
Disk identifier: 0xb367fbf3  

  ' Device Boot      Start         End      Blocks   Id  System  
/dev/sda1               1   976773167   488386583+  ee  GPT  
Partition 1 does not start on physical sector boundary.  '

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 32.0 GB, 32017047552 bytes  
255 heads, 63 sectors/track, 3892 cylinders, total 62533296 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 identifier: 0x01a1f343  

  ' Device Boot      Start         End      Blocks   Id  System  '

e saída de df -h é:

Filesystem      Size  Used Avail Use% Mounted on  
/dev/sda7       303G  8.3G  280G   3% /  
none            4.0K     0  4.0K   0% /sys/fs/cgroup  
udev            2.9G  4.0K  2.9G   1% /dev  
tmpfs           594M  1.2M  593M   1% /run  
none            5.0M     0  5.0M   0% /run/lock  
none            2.9G  288K  2.9G   1% /run/shm  
none            100M   44K  100M   1% /run/user  

saída de sudo parted -l é:

Model: ATA ST500LT012-9WS14 (scsi)  
Disk /dev/sda: 500GB  
Sector size (logical/physical): 512B/4096B  
Partition Table: gpt  

Number  Start   End     Size    File system     Name                          Flags  
 1      1049kB  525MB   524MB   fat32           EFI system partition          boot  
 2      525MB   567MB   41.9MB  fat32           Basic data partition          hidden  
 3      567MB   701MB   134MB                   Microsoft reserved partition  msftres  
 4      701MB   1215MB  514MB   ntfs            Basic data partition          hidden, diag  
 5      1215MB  153GB   152GB   ntfs            Basic data partition          msftdata  
 7      153GB   484GB   331GB   ext4  
 8      484GB   489GB   5243MB  linux-swap(v1)  
 6      489GB   500GB   11.0GB  ntfs            Microsoft recovery partition  hidden, diag  


Model: ATA LITEONIT LMS-32L (scsi)  
Disk /dev/sdb: 32.0GB  
Sector size (logical/physical): 512B/512B  
Partition Table: msdos  

Number  Start  End  Size  Type  File system  Flags  

foi por engano que eu esqueci de colocar sdb1

sudo parted /dev/sdb print free dá:

Model: ATA LITEONIT LMS-32L (scsi)  
Disk /dev/sdb: 32.0GB  
Sector size (logical/physical): 512B/512B  
Partition Table: msdos  

Number  Start   End     Size    Type  File system  Flags  
        32.3kB  32.0GB  32.0GB        Free Space  

gparted mostra 29 gb como não alocado

    
por Harish krupo 05.01.2014 / 06:40

1 resposta

1

OK, seu comando dd substituiu sua tabela de partições. QUANDO você especificar um nome de desenvolvedor sem número (por exemplo, /dev/sdb ) que se refere ao disco inteiro , não a uma partição específica. Então, quando você executou dd if=path_to_iso of=/dev/sdb , copiou a imagem diretamente para o disco e destruiu seus arquivos de cabeçalho da GPT.

O que você queria para executar era:

dd if=path_to_iso of=/dev/sdb2

Você pode se recuperar disso, mas não há garantias. Se tiver sorte, você terá uma tabela GPT de backup armazenada. Se assim for, gdisk poderá salvar você. Experimente

 gdisk /dev/sdb 

Você deve ver linhas como

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: damaged
****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************

Os detalhes serão diferentes, mas algum tipo de mensagem semelhante deve estar lá. Se você tiver sorte, gdisk consertará automaticamente tudo. Caso contrário, consulte aqui para obter mais informações.

    
por terdon 05.01.2014 / 13:45