Unable to format usb thumb drive (sysresccd utils.)

Discussion in 'PC Hardware' started by Capum130, Feb 3, 2016.

  1. Capum130

    Capum130 MDL Member

    Jan 25, 2011
    228
    4
    10
    #1 Capum130, Feb 3, 2016
    Last edited: Feb 5, 2016
  2. Cruze

    Cruze MDL Novice

    Apr 12, 2015
    8
    0
    0
    I find Gpart best to format my usb thumb drive,s .
     
  3. John Sutherland

    John Sutherland MDL Addicted

    Oct 15, 2014
    867
    1,388
    30
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Capum130

    Capum130 MDL Member

    Jan 25, 2011
    228
    4
    10
    #4 Capum130, Feb 4, 2016
    Last edited: Feb 4, 2016
    (OP)
    Great answer John Sutherland!
    Intro: I really thought of post in time order of actions but somehow I got to organize by topics with the code box.
    All were done with System Rescue CD.
    pastebin.com/axZvHV08 this paste is more likely the right order I did things. Sort of Analyze box and some of dd commands where first, then the rest of dd commands, third was testdisk commands.

    1.) the first fdisk wasn't successfull to me because of Input/output error. Next, gdisk seemed right, so I try dd right after it. The first of three dd commands had Input/output error. All these time, couldn't make readable a 'unallocated' space, always checking with gparted after each action. The next 2 dd commands were good but couldn't make it readable on gparted as I said.
    To be frank I didn't fully understand, until your answer, how to correct use bs and count switch. I just follow through the source threads commands to, I thought, be the way to format/repair this defective usb drive.

    2.) is quite answered by now, isn't it?

    I even thought maybe it is sth wrong with the physical contacts of the usb drive male connector or with PCB.
    The owner said he tried to format it. Maybe it was MBR, and he formated to GPT, that's when it got faulty.

    What I should do now, since this usb is actually in GPT, is to directly
    dd if=/dev/zero of=/dev/sdc bs=512 count=32
    any else?

    Great time!
     
  5. John Sutherland

    John Sutherland MDL Addicted

    Oct 15, 2014
    867
    1,388
    30
    #5 John Sutherland, Feb 4, 2016
    Last edited: Feb 4, 2016
    Hello Capum130 - Just so we're on the same page here: You're only trying to make the USB flash drive usable again, correct? You're not attempting to recover any partitions or any data from it, correct? I only ask because you mentioned using Testdisk previously. Follow these instructions only if you're trying to reformat it and make it usable.

    It's been a while since I've used fdisk, so I had to brush up on a couple of the command options first. I'm going to use an unformatted 16GB USB flash drive and run through the process for you.

    1.) Start by using " sudo fdisk -l " to verify that /dev/sdc is the indeed the device you intend to reformat. You don't want to reformat a system hard drive by mistake.

    2.) Next enter " sudo dd if=/dev/zero of=/dev/sdc bs=512 count=32 " in order to wipe any existing partition table on the device, either MBR or GPT.

    3.) Now I'll cut and paste from the command terminal:

    4.) mint@mint ~ $ sudo dd if=/dev/zero of=/dev/sdc bs=512 count=32 < Use dd command to wipe existing partition table
    32+0 records in
    32+0 records out
    16384 bytes (16 kB) copied, 0.00760398 s, 2.2 MB/s

    mint@mint ~ $ sudo fdisk -l /dev/sdc
    Disk /dev/sdc: 16.0 GB, 16008609792 bytes
    64 heads, 32 sectors/track, 15267 cylinders, total 31266816 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

    Disk /dev/sdc doesn't contain a valid partition table < Verified: No partition table exists

    5.) mint@mint ~ $ sudo fdisk /dev/sdc < Enter fdisk command and select /dev/sdc
    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
    Building a new DOS disklabel with disk identifier 0x512af741.
    Changes will remain in memory only, until you decide to write them.
    After that, of course, the previous content won't be recoverable.

    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

    6.) Command (m for help): o < Create new ms-dos partition table using "o" option
    Building a new DOS disklabel with disk identifier 0xdf600048.
    Changes will remain in memory only, until you decide to write them.
    After that, of course, the previous content won't be recoverable.

    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

    7.) Command (m for help): n < Create new partition using "n" option
    Partition type:
    p primary (0 primary, 0 extended, 4 free)
    e extended
    Select (default p): p
    Partition number (1-4, default 1): 1
    First sector (2048-31266815, default 2048): 2048
    Last sector, +sectors or +size{K,M,G} (2048-31266815, default 31266815): 31266815

    8.) Command (m for help): a < Set partition as "active" using "a" option
    Partition number (1-4): 1

    9.) Command (m for help): t < Change partition type using "t" option
    Selected partition 1
    Hex code (type L to list codes): b < Set partition type as "W95 FAT32" using "b" hex code
    Changed system type of partition 1 to b (W95 FAT32)

    10.) Command (m for help): w < Write all changes to disk using "w" option and automatically exit fdisk command
    The partition table has been altered!

    Calling ioctl() to re-read partition table.

    WARNING: If you have created or modified any DOS 6.x
    partitions, please see the fdisk manual page for additional
    information.
    Syncing disks.

    11.) mint@mint ~ $ sudo mkfs -t vfat /dev/sdc1 < Format partition /dev/sdc1 as vfat (fat32)
    mkfs.fat 3.0.26 (2014-03-07)

    12.) mint@mint ~ $ sudo fdisk -l /dev/sdc < Verify your work

    Disk /dev/sdc: 16.0 GB, 16008609792 bytes
    64 heads, 32 sectors/track, 15267 cylinders, total 31266816 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: 0xdf600048

    Device Boot Start End Blocks Id System
    /dev/sdc1 * 2048 31266815 15632384 b W95 FAT32

    EDIT: Just shut down Linux Mint and rebooted into Windows. My USB flash drive is recognized as "Healthy, Active" with a single FAT32 partition. :spoton:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Capum130

    Capum130 MDL Member

    Jan 25, 2011
    228
    4
    10
    sth is wrong. it continues to return Input/output error.

    root@sysresccd /root % fdisk -l
    Disk /dev/sdb: 14.5 GiB, 15512174592 bytes, 30297216 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: 0x00000000

    Device Boot Start End Sectors Size Id Type
    /dev/sdb1 * 2048 30296063 30294016 14.5G c W95 FAT32 (LBA)

    - - - - - - - - - - - - - - - -

    root@sysresccd /root % dd if=/dev/zero of=/dev/sdb bs=512 count=32
    32+0 records in
    32+0 records out
    16384 bytes (16 kB) copied, 39.566 s, 0.4 kB/s

    - - - - - - - - - - - - - - - -

    root@sysresccd /root % fdisk -l /dev/sdb
    Disk /dev/sdb: 14.5 GiB, 15512174592 bytes, 30297216 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: 0x00000000

    Device Boot Start End Sectors Size Id Type
    /dev/sdb1 * 2048 30296063 30294016 14.5G c W95 FAT32 (LBA)

    - - - - - - - - - - - - - - - -

    root@sysresccd /root % fdisk /dev/sdb

    Welcome to fdisk (util-linux 2.26.2).
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.

    Command (m for help): m

    Help:

    DOS (MBR)
    a toggle a bootable flag
    b edit nested BSD disklabel
    c toggle the dos compatibility flag

    Generic
    d delete a partition
    l list known partition types
    n add a new partition
    p print the partition table
    t change a partition type
    v verify the partition table

    Misc
    m print this menu
    u change display/entry units
    x extra functionality (experts only)

    Script
    I load disk layout from sfdisk script file
    O dump disk layout to sfdisk script file

    Save & Exit
    w write table to disk and exit
    q quit without saving changes

    Create a new label
    g create a new empty GPT partition table
    G create a new empty SGI (IRIX) partition table
    o create a new empty DOS partition table
    s create a new empty Sun partition table

    Command (m for help): o
    Created a new DOS disklabel with disk identifier 0x51fb12d5.

    Command (m for help): n
    Partition type
    p primary (0 primary, 0 extended, 4 free)
    e extended (container for logical partitions)
    Select (default p): p
    Partition number (1-4, default 1): 1
    First sector (2048-30297215, default 2048): 2048
    Last sector, +sectors or +size{K,M,G,T,P} (2048-30297215, default 30297215): 302 <-end here, rest of numbers went new line and were 'unbackspaceable'. click enter and delete partition to start again as below:

    Created a new partition 1 of type 'Linux' and of size 14.5 GiB.

    Command (m for help): n
    To create more partitions, first replace a primary with an extended partition.

    Command (m for help): d
    Selected partition 1
    Partition 1 has been deleted.

    Command (m for help): n
    Partition type
    p primary (0 primary, 0 extended, 4 free)
    e extended (container for logical partitions)
    Select (default p): p
    Partition number (1-4, default 1): 1
    First sector (2048-30297215, default 2048): 2048
    Last sector, +sectors or +size{K,M,G,T,P} (2048-30297215, default 30297215): 30297215

    Created a new partition 1 of type 'Linux' and of size 14.5 GiB.

    Command (m for help): a
    Selected partition 1
    The bootable flag on partition 1 is enabled now.

    Command (m for help): t
    Selected partition 1
    Partition type (type L to list all types): b
    Changed type of partition 'Linux' to 'W95 FAT32'.

    Command (m for help): w
    The partition table has been altered.
    Calling ioctl() to re-read partition table.
    /dev/sdb: close device failed: Input/output error

    root@sysresccd /root % mkfs -t vfat /dev/sdb1
    mkfs.fat 3.0.28 (2015-05-16)

    root@sysresccd /root % fdisk -l /dev/sdb
    Disk /dev/sdb: 14.5 GiB, 15512174592 bytes, 30297216 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: 0x00000000

    Device Boot Start End Sectors Size Id Type
    /dev/sdb1 * 2048 30296063 30294016 14.5G c W95 FAT32 (LBA)
     
  7. John Sutherland

    John Sutherland MDL Addicted

    Oct 15, 2014
    867
    1,388
    30
    #7 John Sutherland, Feb 5, 2016
    Last edited: Feb 5, 2016
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,589
    340
  9. Capum130

    Capum130 MDL Member

    Jan 25, 2011
    228
    4
    10
    #9 Capum130, Feb 6, 2016
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Read test complete 100%.
    The bottom bar was one square red (fatal read error) at the begining and all the other square were green (good).
    Code:
    ++++++++++++ Start of logging 6-Feb-16 at 09:13:11 ++++++++++++
     6-Feb-16  09:13:11 i 00:03:29.60 - -------------------------------- New test process started --------------------------------
     6-Feb-16  09:13:11 i 00:03:29.66 - Started "Reading test data" for drive E: 14793MB, "Kingston, DT 100 G2, 1.00, 6SDSK", 512b
     6-Feb-16  09:13:20 i 00:03:39.09 - ! Read recoverable (1/3) error at LBN = 50432 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:13:30 i 00:03:49.01 - ! Read fatal (3/3) error at LBN = 51072 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:13:39 i 00:03:58.09 - ! Read fatal (3/3) error at LBN = 51712 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:13:49 i 00:04:08.01 - ! Read fatal (3/3) error at LBN = 52992 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:13:58 i 00:04:17.01 - ! Read fatal (3/3) error at LBN = 53632 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:14:08 i 00:04:27.01 - ! Read fatal (3/3) error at LBN = 55168 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:14:10 i 00:04:28.73 - ! Read fatal (3/3) error at LBN = 55296 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:14:20 i 00:04:39.01 - ! Read fatal (3/3) error at LBN = 57088 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:14:29 i 00:04:48.01 - ! Read fatal (3/3) error at LBN = 57856 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:14:39 i 00:04:58.01 - ! Read fatal (3/3) error at LBN = 59008 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:14:48 i 00:05:06.98 - ! Read fatal (3/3) error at LBN = 59136 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:14:57 i 00:05:16.01 - ! Read fatal (3/3) error at LBN = 59776 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:15:06 i 00:05:25.01 - ! Read fatal (3/3) error at LBN = 59904 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:15:16 i 00:05:35.01 - ! Read fatal (3/3) error at LBN = 61312 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:15:26 i 00:05:45.01 - ! Read fatal (3/3) error at LBN = 62848 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:15:35 i 00:05:54.01 - ! Read fatal (3/3) error at LBN = 63360 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:15:37 i 00:05:56.06 - ! Read fatal (3/3) error at LBN = 64000 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:15:46 i 00:06:05.03 - ! Read fatal (3/3) error at LBN = 64256 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:15:56 i 00:06:15.01 - ! Read fatal (3/3) error at LBN = 65280 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:15:58 i 00:06:16.85 - ! Read fatal (3/3) error at LBN = 65664 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:24:30 i 00:14:49.17 - Completed "Reading test data" for drive E: 14793MB, "Kingston, DT 100 G2, 1.00, 6SDSK", 512b
     6-Feb-16  09:24:30 i 00:14:49.17 - Tested total 14793.575MB in 0:11:19 with 21.790MB/s
     6-Feb-16  09:24:30 i 00:14:49.19 - Total read errors: Fatal=19, Recoverable=1
    ------------  Stop of logging 6-Feb-16 at 09:24:30 ------------
    Write test complete 60%. Happened a physical contact with the thumb drive, it stopped testing.
    all the squares were red (fatal write error).
    Code:
    ++++++++++++ Start of logging 6-Feb-16 at 09:36:02 ++++++++++++
     6-Feb-16  09:36:02 i 00:00:21.05 - -------------------------------- New test process started --------------------------------
     6-Feb-16  09:36:02 i 00:00:21.18 - Started "Writing test data" for drive E: 14793MB, "Kingston, DT 100 G2, 1.00, 6SDSK", 512b
     6-Feb-16  09:36:11 i 00:00:30.18 - ! Write fatal (3/3) error at LBN = 0 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  09:36:20 i 00:00:39.18 - ! Write fatal (3/3) error at LBN = 128 -- O tempo limite do semáforo expirou. (121.)
    .121 all the way
     6-Feb-16  10:34:04 i 00:58:23.18 - ! Write fatal (3/3) error at LBN = 49408 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  10:34:07 i 00:58:26.19 - ! Write recoverable (1/3) error at LBN = 49664 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  10:34:30 i 00:58:49.14 - ! Write fatal (3/3) error at LBN = 98304 -- O tempo limite do semáforo expirou. (121.)
     6-Feb-16  10:34:30 i 00:58:49.22 - ! Write fatal (3/3) error at LBN = 98432 -- Could not DevIoCtl::GetCapacity-10 (BufSz/sizeof(Spt) = 3/44) drive "E:" -- O dispositivo não está pronto. (21.)
    .21 until:
    (1x) 6-Feb-16  10:38:52 i 01:03:10.99 - ! Write fatal (3/3) error at LBN = 396288 -- Acesso negado. (5.)
     6-Feb-16  10:38:52 i 01:03:11.10 - ! Write fatal (3/3) error at LBN = 396416 -- Could not DevIoCtl::GetCapacity-10 (BufSz/sizeof(Spt) = 3/44) drive "E:" -- O dispositivo não está pronto. (21.)
    .21 back again, until:
     6-Feb-16  15:19:19 i 05:43:38.33 - ! Write fatal (3/3) error at LBN = 22020992 -- Could not DevIoCtl::GetCapacity-10 (BufSz/sizeof(Spt) = 3/44) drive "E:" -- O dispositivo não está pronto. (21.)
    
    Tito your file prompts for password.

    appreciate your help
     
  10. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,589
    340
  11. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,589
    340
  12. Capum130

    Capum130 MDL Member

    Jan 25, 2011
    228
    4
    10
    #13 Capum130, Feb 9, 2016
    Last edited: Feb 9, 2016
    (OP)
    sss

    Tito! great help. Going to test with
    3S USB Mass Production Utility ver 2.182; 3s_usb_mp_utility_ver2182.rar ; size: 518558 bytes.
    and maybe should I run this
    3S USB OnCardSorting v5.024 [2009.10.06] (SSS) {SSS6690}; 3s_usb_oncardsorting_v5_024_2009_10_06_sss.rar ; size: 309347 bytes ?
    does Note # 3 of usbdev apply to this usb?

    Does upan chinese site has the same sss tools ?

    I used ChipEasy again and got new output? (other values are equal)
    Max power : not support

    Partition type : Device active :
    Aligned state : Misaligned

    Controller : SSS
    Controller model: TC58NC6688GIF/SSS6691