FOLLOW ME Twitter Facebook Вконтакте LinkedIn RSS Feed

How to restore unreadable USB flash drive under Mac OS X

Category: Tips and Tricks
Sep 1, 2013
Konstantin Bulenkov

USB Flash Drive recovery Today I found that I can’t access to my 8Gb USB flash drive. I can find it in Finder, but the System gets stuck while accessing to it. What to do? If you want to recover data from a USB flash it’s better to stop reading this post now and continue googling “USB flash data recovery” or something. Here’s a step-by-step instruction how to make your USB flash drive work again under Mac OS X.

1. Open Terminal and go to /dev

$ cd /dev

2. Now it’s time to find your flash drive in /dev. Typically it’s /dev/diskN where N could be 0, 1, 2, 3, etc

$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            120.5 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk3
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *8.1 GB     disk3
   1:                        EFI                         209.7 MB   disk3s1
   2:       Microsoft Basic Data KB                      7.9 GB     disk3s2

OK! It’s disk number 3, i.e. /dev/disk3 Remember the name of partition (it’s KB in my case). Your flash drive is mounted as /Volumes/NAME

3. Let’s erase and reformat the disk. In 90% you will get a message that the system can’t unmount your drive.

$ diskutil eraseDisk MS-DOS KB /dev/disk3
Started erase on disk3
Unmounting disk
Error: -69888: Couldn't unmount disk

Use the partition name from step 2.

$ diskutil unmountDisk force /Volumes/KB
Forced unmount of all volumes on disk3 was successful
$ diskutil eraseDisk MS-DOS KB /dev/disk3
Started erase on disk3
Unmounting disk
Creating the partition map
Waiting for the disks to reappear
Formatting disk3s2 as MS-DOS (FAT) with name KB
512 bytes per physical sector
/dev/rdisk3s2: 15377032 sectors in 1922129 FAT32 clusters (4096 bytes/cluster)
bps=512 spc=8 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=411648 drv=0x80 bsec=15407104 bspf=15017 rdcl=2 infs=1 bkbs=6
Mounting disk
Finished erase on disk3

That’s all. Now you have a USB flash drive again.

13 Comments

  • is there a tip for if your partition name has a space in the name? It seems to cause me problems….

    • Griff, quote it like this “name with space”

  • Something similar has happened to a Kingston DataTraveler 120, 4GB disk here. But what about the data?
    I use diskutil mountDisk command, and terminal says “volumes mounted successfully”, but I can’t browse or find it anywhere.
    Any idea?

  • I tried this however I am getting the following.

    $ diskutil eraseDisk MS-DOS KB /dev/disk4
    Started erase on disk4
    Unmounting disk
    Error: -69877: Couldn’t open device

    and then

    Unmount failed for /Volumes/KB

  • /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *250.1 GB disk0
    1: EFI EFI 209.7 MB disk0s1
    2: Apple_HFS Untitled 249.2 GB disk0s2
    3: Apple_Boot Recovery HD 650.0 MB disk0s3
    /dev/disk3
    #: TYPE NAME SIZE IDENTIFIER
    0: *0 B disk3

    the drive doesn’t have any name, how do you go about this

  • To follow these instructions to revive a dead USB thumb drive you must have
    a Masters Degree in MacGeek Studies.

    worthless for 99.9% of people.

    • Absolutely agree with you Phil. For 99.9% of people I’d recommend to buy a new flash drive

      • Failing USB thumb drives are a function of Cheap Chinese Crap where quality control of what they make
        is as unknown as representative government…..cars made in the US….or eating with forks and knives. The real problem is that you lose your data forever.

        • I agree. But this post is not about how to restore your data, but how to make the flash-drive work again. Data restoring is a much more complicated process.

  • Nothing shows up on the list for me except dev/disk 0, which is my GUID partition scheme. I have the unusable USB plugged in.
    Just no recognition what so ever even after looking for it in dev/disk2,3,4 etc.. I know thumb drives are cheap and replaceable, but I really want to dig deep, learn from my mistake, and confirm any bit of hope might be left to restore it before I go off and spend money on something that could be going towards something else. It’s a new USB, so nothing is on it. Was trying to find a way to make it respond to burn a Linux iso image. I failed, and took my usb with me. lol

    I’ll keep looking around for answers, but thanks for posting this article. I will keep tabs on this site incase you respond back, OP.

  • Thank you!! I was thinking throw away my usb, but finally I found a post that helped me to revive my flash drive, I really appreciate it!

  • Doesn’t work in this case. Get the following from terminal any ideas?:

    Last login: Thu Oct 2 12:52:24 on console
    ImageMac150:~ nedo$ cd /dev
    ImageMac150:dev nedo$ diskutil list
    /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *1.0 TB disk0
    1: EFI 209.7 MB disk0s1
    2: Apple_HFS Drive 2 999.9 GB disk0s2
    /dev/disk1
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *1.0 TB disk1
    1: EFI 209.7 MB disk1s1
    2: Apple_HFS Macintosh HD 999.9 GB disk1s2
    /dev/disk4
    #: TYPE NAME SIZE IDENTIFIER
    0: FDisk_partition_scheme *125.8 GB disk4
    1: DOS_FAT_32 BACKUP 125.8 GB disk4s1

    ImageMac150:dev nedo$ diskutil eraseDisk MS-DOS KB /dev/disk4
    Started erase on disk4
    Unmounting disk
    Error: 12: POSIX reports: Cannot allocate memory

    ImageMac150:dev nedo$ diskutil unmountDisk force /dev/disk4
    Forced unmount of all volumes on disk4 was successful

    ImageMac150:dev nedo$ diskutil eraseDisk MS-DOS KB /dev/disk4
    Started erase on disk4
    Unmounting disk
    Error: 12: POSIX reports: Cannot allocate memory

    ImageMac150:dev nedo$

Leave a comment