Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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.

User uploaded file

What Disk Utility told me

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

User uploaded file

User uploaded file

User uploaded file

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.

User uploaded file

Posted on Nov 13, 2015 4:32 PM

Reply
49 replies

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$

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.

Feb 20, 2016 7:34 AM in response to Loner T

Lorne, here is what I get:

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

Password:

gpt show: /dev/disk0: mediasize=500277790720; sectorsize=512; blocks=977105060

gpt show: /dev/disk0: PMBR at sector 0

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

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

start size index contents

0 1 PMBR

1 1 Pri GPT header

2 32 Pri GPT table

34 6

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

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

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

977105024 3

977105027 32 Sec GPT table

977105059 1 Sec GPT header


Then

MacBook-Pro-4:~ Leo_Lazo$ sudo gdisk /dev/disk0

Password:

GPT fdisk (gdisk) version 1.0.1


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!

You may need to deactivate System Integrity Protection to use this program. See

https://www.quora.com/How-do-I-turn-off-the-rootless-in-OS-X-El-Capitan-10-11

for more information.


Partition table scan:

MBR: protective

BSD: not present

APM: not present

GPT: present


Found valid GPT with protective MBR; using GPT.


Command (? for help)

Not sure what to do next. Thanks for your help

Cannot erase USB flash drive, "name invalid"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.