gabriel3374

Q: Cannot erase USB flash drive, "name invalid"

Now, I'll just give the short version of how my problem occurred, continued with a detailed "backstory".

 

  • Tried creating bootable USB flash drive with Windows 7.iso on it (kinda worked)
  • Boot Camp requires flash drive to be formatted "as single FAT partition"
  • Disk Utility -> Erase -> Error: "Invalid name. Operation failed..."
  • Terminal -> diskutil reformat /dev/disk2 -> Same Error

 

Hardware details

- MacBook Pro Mid 2010 with OS X El Capitan

- 32GB SanDisk 3.0 USB flash drive. I had previously installed Linux Mint on it, which worked perfectly.

 

What I've done to the USB flash drive

For university we could download different versions of Windows for free. So now with a .iso file in my downloads folder I tried creating a bootable USB flash drive using the instructions provided by Ubuntu, because for some reason I found nothing helpful for Windows and figured the commands in terminal wouldn't be much different.

 

  1. Convert .iso to .img: hdiutil convert -format UDRW -o /Users/me/Downloads/Windows_7.img /Users/me/Downloads/Windows\ 7\ Professional\ N\ with\ Service\ Pack\ 1\ \(x64\)\ -\ DVD\ \(German\)/windows_7.iso
  2. Unmount my disk: diskutil unmountDisk /dev/disk2
  3. Initialise (?) disk: sudo dd if=/Users/me/Downloads/Windows_7.img of=/dev/rdisk2 bs=1m
  4. Eject: diskutil eject /dev/disk2

 

I remember when doing this for Ubuntu, starting up the computer while holding the option key would already give me the option to boot from that flash drive. Sadly didn't work here (only showed my Macintosh as the only option on startup), so I tried using Boot Camp.

 

What Boot Camp told me

I start Boot Camp, skip "Introduction", on page two I select both the options "Download the latest Windows support software from Apple" and "Install Windows 7 or later version". On another tutorial website I looked up, it showed an extra option to "Create a Windows 7 or later install disk", an option I didn't have.

 

Note, if I do not select the "Download Windows support software" checkbox, I can't continue because the "Installer Disk cannot be found".

 

With both checkboxes checked, Continue, it says "Save Windows Support Software" and wants me to select a destination disk. I select my USB flash drive and Boot Camp tells me to reformat my USB flash drive.

Screen Shot 2015-11-14 at 00.27.22.png

What Disk Utility told me

Basic procedure, I thought. Open up Disk Utility -> Select my Flash drive -> "Erase" -> New name, format, "Erase" -> Operation failed.

Screen Shot 2015-11-14 at 00.28.44.png

Screen Shot 2015-11-14 at 00.28.53.png

Screen Shot 2015-11-14 at 00.29.05.png

Come to think of it, "GSP1RMCNPRXFRER_DE_DVD" is quiet a strange name, but that shouldn't be the reason not to reformat it, right? Giving it another name also wouldn't work. I can't rename the device itself on my desktop either. Using another format like "ExFAT" won't work, too. Using the command diskutil reformat /dev/disk2 in terminal gives me a "Name invalid" error, too.

 

If it's in anyway helpful, that's what the inside of my allegedly bootable flash drive looks like.

Screen Shot 2015-11-14 at 01.27.18.png

Posted on Nov 13, 2015 4:32 PM

Close

Q: Cannot erase USB flash drive, "name invalid"

  • All replies
  • Helpful answers

Previous Page 2 of 4 last Next
  • by Loner T,

    Loner T Loner T Feb 19, 2016 5:30 AM in response to Leonardo Lazo
    Level 7 (23,898 points)
    Safari
    Feb 19, 2016 5:30 AM in response to Leonardo Lazo

    Was a CD/DVD burnt to the 1TB disk? The name shown is the name of a Windows Installer DVD. Please run the following command and ensure that disk2 points to your 1TB disk, otherwise it can cause data loss.

     

    diskutil eraseDisk jhfs+ My1TBDisk disk2

  • by Leonardo Lazo,

    Leonardo Lazo Leonardo Lazo Feb 19, 2016 5:55 PM in response to Loner T
    Level 1 (5 points)
    Feb 19, 2016 5:55 PM in response to Loner T

    It was an iso image that was burned to the disk. Here is what happened after I ran your last command:

    MacBook-Pro-4:~ Leo_Lazo$ diskutil eraseDisk jhfs+ My1TBDisk disk2

     

    Unable to begin erase operation: The target disk is too small for this operation (-69771)

    MacBook-Pro-4:~ Leo_Lazo$

    A PC won't even recognize the disk.

    Thanks

  • by Loner T,

    Loner T Loner T Feb 19, 2016 6:14 PM in response to Leonardo Lazo
    Level 7 (23,898 points)
    Safari
    Feb 19, 2016 6:14 PM in response to Leonardo Lazo

    Is disk2 still the 1TB disk? Can you post the output of

     

    sudo gpt -vv -r show /dev/disk2

     

    diskutil info disk2

  • by Leonardo Lazo,

    Leonardo Lazo Leonardo Lazo Feb 19, 2016 6:36 PM in response to Loner T
    Level 1 (5 points)
    Feb 19, 2016 6:36 PM in response to Loner T

    It is the 1TB disk:

    MacBook-Pro-4:~ Leo_Lazo$ sudo gpt -vv -r show /dev/disk2

    Password:

    gpt show: unable to open device '/dev/disk2': Resource busy

    MacBook-Pro-4:~ Leo_Lazo$

  • by Loner T,

    Loner T Loner T Feb 19, 2016 7:02 PM in response to Leonardo Lazo
    Level 7 (23,898 points)
    Safari
    Feb 19, 2016 7:02 PM in response to Leonardo Lazo

    Can you check if disk2 is still the the 1TB disk? Can you post the output the second command?

  • by Leonardo Lazo,

    Leonardo Lazo Leonardo Lazo Feb 19, 2016 7:24 PM in response to Loner T
    Level 1 (5 points)
    Feb 19, 2016 7:24 PM in response to Loner T

    Hi Loner,

    my previous post has the output.

    MacBook-Pro-4:~ Leo_Lazo$ sudo gpt -vv -r show /dev/disk2

    Password:

    gpt show: unable to open device '/dev/disk2': Resource busy

    MacBook-Pro-4:~ Leo_Lazo$

  • by Loner T,

    Loner T Loner T Feb 19, 2016 8:27 PM in response to Leonardo Lazo
    Level 7 (23,898 points)
    Safari
    Feb 19, 2016 8:27 PM in response to Leonardo Lazo

    Can you unmount the disk, but do not eject it?

  • by Leonardo Lazo,

    Leonardo Lazo Leonardo Lazo Feb 19, 2016 9:00 PM in response to Loner T
    Level 1 (5 points)
    Feb 19, 2016 9:00 PM in response to Loner T

    I unmounted the disk. Which command should I run?

  • by Loner T,

    Loner T Loner T Feb 19, 2016 9:27 PM in response to Leonardo Lazo
    Level 7 (23,898 points)
    Safari
    Feb 19, 2016 9:27 PM in response to Leonardo Lazo

    Run both commands, the GPT and the Diskutil.

  • by Leonardo Lazo,

    Leonardo Lazo Leonardo Lazo Feb 19, 2016 9:31 PM in response to Loner T
    Level 1 (5 points)
    Feb 19, 2016 9:31 PM in response to Loner T

    Here it is:

    gpt show: /dev/disk2: mediasize=1000204886016; sectorsize=512; blocks=1953525168

    gpt show: /dev/disk2: MBR not found at sector 0

    gpt show: /dev/disk2: Sec GPT at sector 1953525167

           start        size  index  contents

               0  1953525135        

      1953525135          32         Sec GPT table

      1953525167           1         Sec GPT header

    MacBook-Pro-4:~ Leo_Lazo$ diskutil info disk2

       Device Identifier:        disk2

       Device Node:              /dev/disk2

       Whole:                    Yes

       Part of Whole:            disk2

       Device / Media Name:      External USB HDD

     

       Volume Name:              GRMCPRXVOL_EN_DVD

     

       Mounted:                  No

     

       File System Personality:  UDF

       Type (Bundle):            udf

       Name (User Visible):      Universal Disk Format (UDF)

     

       Content (IOContent):      None

       OS Can Be Installed:      No

       Media Type:               Generic

       Protocol:                 USB

       SMART Status:             Not Supported

     

       Total Size:               1.0 TB (1000204886016 Bytes) (exactly 1953525168 512-Byte-Units)

       Volume Free Space:        0 B (0 Bytes) (exactly 0 512-Byte-Units)

       Device Block Size:        512 Bytes

     

       Read-Only Media:          No

       Read-Only Volume:         Not applicable (not mounted)

     

       Device Location:          External

       Removable Media:          No

     

       Virtual:                  No

       OS 9 Drivers:             No

       Low Level Format:         Not supported

     

    MacBook-Pro-4:~ Leo_Lazo$

  • by Loner T,

    Loner T Loner T Feb 19, 2016 9:46 PM in response to Leonardo Lazo
    Level 7 (23,898 points)
    Safari
    Feb 19, 2016 9:46 PM in response to Leonardo Lazo

    Please download GPT Fdisk from http://sourceforge.net/projects/gptfdisk/files/gptfdisk/ and install it. Are you on El Capitan?

  • by Leonardo Lazo,

    Leonardo Lazo Leonardo Lazo Feb 19, 2016 9:53 PM in response to Loner T
    Level 1 (5 points)
    Feb 19, 2016 9:53 PM in response to Loner T

    I am on El Capitan 10.11.3. Downloaded the file but the name is "gdisk-1.0.1.pkg" Is this the one? I've installed it.

  • by Loner T,

    Loner T Loner T Feb 19, 2016 9:57 PM in response to Leonardo Lazo
    Level 7 (23,898 points)
    Safari
    Feb 19, 2016 9:57 PM in response to Leonardo Lazo

    Yes, please double-click on the PKG file and install it. If you get an error, check your security settings.

  • by Leonardo Lazo,

    Leonardo Lazo Leonardo Lazo Feb 19, 2016 9:59 PM in response to Loner T
    Level 1 (5 points)
    Feb 19, 2016 9:59 PM in response to Loner T

    It installed without a problem. What should I do next?

    Again, thanks so much for taking the time to run through it for me. Very much appreciated.

  • by Loner T,

    Loner T Loner T Feb 20, 2016 6:33 AM in response to Leonardo Lazo
    Level 7 (23,898 points)
    Safari
    Feb 20, 2016 6:33 AM in response to Leonardo Lazo

    Mount the disk. We need to rebuild the GPT Primary entries/Table using GPT Fdisk. One a typical GPT disk, the entries are

     

    sudo gpt -vv -r show /dev/disk0

    Password:

    gpt show: /dev/disk0: mediasize=256060514304; sectorsize=512; blocks=500118192

    gpt show: /dev/disk0: Suspicious MBR at sector 0

    gpt show: /dev/disk0: Pri GPT at sector 1

    gpt show: /dev/disk0: Sec GPT at sector 500118191

          start       size  index  contents

              0          1         MBR

              1          1         Pri GPT header

              2         32         Pri GPT table

             34          6        

             40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B

         409640  250392096      2  GPT part - 53746F72-6167-11AA-AA11-00306543ECAC

      250801736    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC

      252071272        664        

      252071936  248045568      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

      500117504        655        

    500118159         32         Sec GPT table

      500118191          1         Sec GPT header

     

    On your specific disk, the Pri(mary) entries were overwritten when a UDF was burnt on the disk. Most utilities are failing because they do not see the Pri(mary) entries. GPT Fdisk has the following functions.

     

    sudo gdisk /dev/disk0

    GPT fdisk (gdisk) version 1.0.0

     

    Warning: Devices opened with shared lock will not have their

    partition table automatically reloaded!

    NOTE: Write test failed with error number 1. It will be impossible to save

    changes to this disk's partition table!

     

    Partition table scan:

      MBR: hybrid

      BSD: not present

      APM: not present

      GPT: present

     

    Found valid GPT with hybrid MBR; using GPT.

     

    Command (? for help): ?

    b back up GPT data to a file

    c change a partition's name

    d delete a partition

    i show detailed information on a partition

    l list known partition types

    n add a new partition

    o create a new empty GUID partition table (GPT)

    p print the partition table

    q quit without saving changes

    r recovery and transformation options (experts only)

    s sort partitions

    t change a partition's type code

    v verify disk

    w write table to disk and exit

    x extra functionality (experts only)

    ? print this menu

     

    Command (? for help): v

     

    No problems found. 1325 free sectors (662.5 KiB) available in 3

    segments, the largest of which is 664 (332.0 KiB) in size.

     

    Command (? for help): r

     

    Recovery/transformation command (? for help): ?

    b use backup GPT header (rebuilding main)

    c load backup partition table from disk (rebuilding main)

    d use main GPT header (rebuilding backup)

    e load main partition table from disk (rebuilding backup)

    f load MBR and build fresh GPT from it

    g convert GPT into MBR and exit

    h make hybrid MBR

    i show detailed information on a partition

    l load partition data from a backup file

    m return to main menu

    o print protective MBR data

    p print the partition table

    q quit without saving changes

    t transform BSD disklabel partition

    v verify disk

    w write table to disk and exit

    x extra functionality (experts only)

    ? print this menu

     

    See the highlighted options.

Previous Page 2 of 4 last Next