Como posso formatar um cartão USB / SD que não posso formatar com o comando dd?

3

Eu tenho este cartão micro SD de 32GB que estava no meu telefone Android. Estava funcionando como um HD externo.

Agora quero formatar o cartão SD para usar com outro telefone, mas parece impossível formatá-lo.

Eu tentei formatar sem sucesso:

  • com o telefone antigo
  • com o novo telefone
  • com gparted
  • com discos
  • com o comando dd
  • excluindo itens manualmente com shift+delete
  • com o windows (porque ... quem sabe)

Nada disso funcionou. Eu ainda tenho todos os arquivos no SD.

Erros

Gparted:

Eu vejo um triângulo laranja com o ponto de exclamação:

Fat problem while decoding 2 0
Streamcache allocation problem:: 2
Fat problem while decoding 2 0
Streamcache allocation problem:: 2
Unable to read the contents of this file system!
Because of this some operations may be unavailable.
The cause might be a missing software package.
The following list of software packages is required for fat32 file system support:  dosfstools, mtools.

Eu tenho dosfstools e mtools instalados.

dd comando:

Usou os comandos

sudo dd if=/dev/zero of=/dev/sdb1 bs=512 count=16

e depois

sudo dd if=/dev/zero of=/dev/sdb1 bs=1M

o resultado foi um monte de erros semelhantes:

Jan 10 00:30:41 asus-ux305fa kernel: [34628.992321] sd 13:0:0:0: [sdb] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992331] sd 13:0:0:0: [sdb] Sense Key : Medium Error [current] 
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992337] sd 13:0:0:0: [sdb] Add. Sense: Peripheral device write fault
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992344] sd 13:0:0:0: [sdb] CDB: Write(10) 2a 00 00 01 05 28 00 00 f0 00
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992348] blk_update_request: I/O error, dev sdb, sector 66856
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992355] buffer_io_error: 230 callbacks suppressed
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992360] Buffer I/O error on dev sdb1, logical block 64808, lost async page write
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992368] Buffer I/O error on dev sdb1, logical block 64809, lost async page write
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992371] Buffer I/O error on dev sdb1, logical block 64810, lost async page write
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992394] Buffer I/O error on dev sdb1, logical block 64811, lost async page write
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992397] Buffer I/O error on dev sdb1, logical block 64812, lost async page write
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992401] Buffer I/O error on dev sdb1, logical block 64813, lost async page write
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992405] Buffer I/O error on dev sdb1, logical block 64814, lost async page write
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992408] Buffer I/O error on dev sdb1, logical block 64815, lost async page write
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992419] Buffer I/O error on dev sdb1, logical block 64816, lost async page write
Jan 10 00:30:41 asus-ux305fa kernel: [34628.992423] Buffer I/O error on dev sdb1, logical block 64817, lost async page write

com o último

Jan 10 00:31:36 asus-ux305fa kernel: [34683.849080] usb-storage 1-1:1.0: USB Mass Storage device detected
Jan 10 00:31:36 asus-ux305fa kernel: [34683.849160] scsi host14: usb-storage 1-1:1.0
Jan 10 00:31:37 asus-ux305fa kernel: [34684.847904] scsi 14:0:0:0: Direct-Access     Mass     Storage Device   1.00 PQ: 0 ANSI: 0 CCS
Jan 10 00:31:37 asus-ux305fa kernel: [34684.848611] sd 14:0:0:0: Attached scsi generic sg1 type 0
Jan 10 00:31:37 asus-ux305fa kernel: [34684.961392] sd 14:0:0:0: [sdb] 61405184 512-byte logical blocks: (31.4 GB/29.2 GiB)
Jan 10 00:31:37 asus-ux305fa kernel: [34684.961692] sd 14:0:0:0: [sdb] Write Protect is off
Jan 10 00:31:37 asus-ux305fa kernel: [34684.961698] sd 14:0:0:0: [sdb] Mode Sense: 03 00 00 00
Jan 10 00:31:37 asus-ux305fa kernel: [34684.961971] sd 14:0:0:0: [sdb] No Caching mode page found
Jan 10 00:31:37 asus-ux305fa kernel: [34684.961978] sd 14:0:0:0: [sdb] Assuming drive cache: write through
Jan 10 00:31:37 asus-ux305fa kernel: [34684.964368]  sdb: sdb1
Jan 10 00:31:37 asus-ux305fa kernel: [34684.965321] sd 14:0:0:0: [sdb] Attached SCSI removable disk
Jan 10 00:31:37 asus-ux305fa kernel: [34685.137339] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
Jan 10 00:32:33 asus-ux305fa kernel: [34740.853595] sd 14:0:0:0: [sdb] FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Jan 10 00:32:33 asus-ux305fa kernel: [34740.853606] sd 14:0:0:0: [sdb] Sense Key : Medium Error [current] 
Jan 10 00:32:33 asus-ux305fa kernel: [34740.853611] sd 14:0:0:0: [sdb] Add. Sense: Peripheral device write fault
Jan 10 00:32:33 asus-ux305fa kernel: [34740.853617] sd 14:0:0:0: [sdb] CDB: Write(10) 2a 00 00 00 08 01 00 00 01 00
Jan 10 00:32:33 asus-ux305fa kernel: [34740.853622] blk_update_request: I/O error, dev sdb, sector 2049
Jan 10 00:32:33 asus-ux305fa kernel: [34740.853628] buffer_io_error: 470 callbacks suppressed
Jan 10 00:32:33 asus-ux305fa kernel: [34740.853633] Buffer I/O error on dev sdb1, logical block 1, lost async page write

Por que não posso formatar este cartão SD?

edit: erro de digitação correto no primeiro comando

@roboboykm:

É um micro SD sem bloqueio. Seguindo as instruções em seu comentário aqui os resultados:

fdisk /dev/sdb

Command (m for help): p

Disk /dev/sdb: 31.4 GB, 31439454208 bytes
256 heads, 63 sectors/track, 3807 cylinders, total 61405184 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: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048    61405183    30701568    c  W95 FAT32 (LBA)

Command (m for help): d
Selected partition 1

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

Eu já experimentei o partprobe, mas também não está funcionando. A reinicialização do sistema também não ajuda.

    
por Alessio 10.01.2017 / 09:58

2 respostas

1

Você usou:

sudo dd if=/dev/zero of=//dev/sdb1 bs=512 count=16

Mas você deveria ter usado:

sudo dd if=/dev/zero of=/dev/sdb bs=512 count=16

Usar sdb1 na primeira instância processa a primeira partição.

Usar sdb na segunda instância processa o primeiro setor contendo MBR e a tabela de partições. Depois que a tabela de partições é zerada, então gparted pode ser usado para criar novas partições.

Em uma nota lateral, se você estiver interessado em um script de wrapper que garanta que você nunca execute o dd em seu sda acidentalmente veja isto ( Impede que o script 'dd' destrua SSD ou HDD ) que escrevi na semana passada.

    
por WinEunuuchs2Unix 10.01.2017 / 12:52
0

Supondo que o comutador do cartão SD esteja na posição destravada

você pode usar o comando fdisk

 sudo fdisk /dev/sdx

   Type the following parameters (each followed by <ENTER>):

   **p**  [lists the current partitions]

   **d**  [to delete existing partitions. Repeat this until no unnecessary    partitions are reported by the 'p' command to start fresh.]

   **p** [to check if any partition left]

   **n**   [create a new partition]

   **p**   [create a primary partition - use for both partitions][create a primary partition - use for both partitions]

   **1**   [the first partition]

   **20480**  [starting at offset sector]

    <Press Enter key > [using the default value will create a partition that extends to the last sector of the media]

 **p** to check the partition

   **w**   [write]


 sudo mkfs.vfat /dev/sdx1

Onde x pode ser substituído pelo dispositivo que você obtém como sdc ou sdb

    
por roboboykm 10.01.2017 / 12:15