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

first Previous Page 3 of 4 last Next
  • by Leonardo Lazo,

    Leonardo Lazo Leonardo Lazo Feb 20, 2016 7:34 AM in response to Loner T
    Level 1 (5 points)
    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

  • by Loner T,

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

    I picked disk0 as an example. You need to use the /dev/diskN where N points to your 1TB disk.

  • by Leonardo Lazo,

    Leonardo Lazo Leonardo Lazo Feb 20, 2016 7:47 AM in response to Loner T
    Level 1 (5 points)
    Feb 20, 2016 7:47 AM in response to Loner T

    I got this after trying to run this:

    Command (? for help): sudo gdisk /dev/disk2

    You may need to edit /etc/fstab and/or your boot loader configuration!

  • by Loner T,

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

    You cannot type Gdisk commands inside Gdisk commands. Press q and go back to Terminal command. Once at the Terminal prompt, run diskutil list and find out which disk is your 1TB disk. Once you know, run

     

    sudo gdisk /dev/diskN (where N is pointing to the 1TB disk).

  • by Leonardo Lazo,

    Leonardo Lazo Leonardo Lazo Feb 20, 2016 8:24 AM in response to Loner T
    Level 1 (5 points)
    Feb 20, 2016 8:24 AM in response to Loner T

    Did it and here is what I get:

    GPT fdisk (gdisk) version 1.0.1

     

    Problem opening /dev/disk2 for reading! Error is 16.

  • by Loner T,

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

    1. Does diskutil list show the disk in the output?

    2. Can you mount the disk and test?

  • by Leonardo Lazo,

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

    I unmounted the disk and mounted it again then I ran:

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

    Password:

    GPT fdisk (gdisk) version 1.0.1

     

    Caution: invalid main GPT header, but valid backup; regenerating main header

    from backup!

     

    Caution! After loading partitions, the CRC doesn't check out!

    Warning! Main partition table CRC mismatch! Loaded backup partition table

    instead of main partition table!

     

    Warning! One or more CRCs don't match. You should repair the disk!

     

    Partition table scan:

      MBR: not present

      BSD: not present

      APM: not present

      GPT: damaged

     

    Found invalid MBR and corrupt GPT. What do you want to do? (Using the

    GPT MAY permit recovery of GPT data.)

    1 - Use current GPT

    2 - Create blank GPT

     

    Your answer:

    So which one do I use?

  • by Loner T,

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

    Use option 2 - Create a Blank GPT. Once Gdisk creates a new GPT, use 'p'(rint),  'w'(rite), 'y(es - to confirm the write). Please post screen the output after you execute the commands.

     

    We are going to erase the disk.

  • by Leonardo Lazo,

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

    Command (? for help): p

    Disk /dev/disk2: 1953525168 sectors, 931.5 GiB

    Logical sector size: 512 bytes

    Disk identifier (GUID): FD5B4614-D6C5-4634-AE82-6BB7B59B95D1

    Partition table holds up to 128 entries

    First usable sector is 34, last usable sector is 1953525134

    Partitions will be aligned on 2048-sector boundaries

    Total free space is 1953525101 sectors (931.5 GiB)

     

    Number  Start (sector)    End (sector)  Size       Code  Name

     

    Command (? for help): w

     

    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING

    PARTITIONS!!

     

    Do you want to proceed? (Y/N): Y

    OK; writing new GUID partition table (GPT) to /dev/disk2.

    Warning: The kernel may continue to use old or deleted partitions.

    You should reboot or remove the drive.

    The operation has completed successfully.

    MacBook-Pro-4:~ Leo_Lazo$

  • by Leonardo Lazo,

    Leonardo Lazo Leonardo Lazo Feb 20, 2016 5:49 PM in response to Leonardo Lazo
    Level 1 (5 points)
    Feb 20, 2016 5:49 PM in response to Leonardo Lazo

    Hi Loner,

    After the commands, I did not see the disk mounted. I use the command to mount disk and it said successful but still didn't see. I then rebooted the MacBook Pro and still no disk. So I used Disk Utilities to erase disk again and not all is good.

    Thanks so much for all your help. I do have one more question, which is what got me in the first place. Is there a way to actually install Bootcamp & any windows from an external drive and then run windows externally. I do not have a need to use Windows all the time. Honestly only for a few games I like to play every once in a while. That is why I don't want to repartition my internal HD for this.

    Thanks again for your help.

  • by Loner T,

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

    You said 'not all good', but I presume you meant 'now all good'.

     

    My recommendation is to create a minimal (40-60GB) Windows installation on the internal disk, and use an external disk as D: (or X: - take your pick) and install all your applications on the external disk. You do not run into licensing issues with Windows being on an external disk. D: could be a 1TB NTFS drive. As long as the external disk is connected with a USB3/TB/FW800 connection, it should perform reasonably well.

  • by Leonardo Lazo,

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

    Thanks for your advice AND for your walkthrough in reformatting my drive. If you're ever on this neck of the woods (Shanghai, China) dinner is on me!

  • by Loner T,

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

    Thanks for your kind offer. . If you run into any other/further issues, please post back. The community will do their utmost to assist.

  • by daniel.velasquez,

    daniel.velasquez daniel.velasquez Feb 29, 2016 7:46 PM in response to gcarey3
    Level 1 (0 points)
    Feb 29, 2016 7:46 PM in response to gcarey3

    Hey gcarey3 thank you very much, that single line solve my problem, my USB is now alive You rock! Cheers.

  • by rahadiancs,

    rahadiancs rahadiancs Mar 29, 2016 2:08 PM in response to gcarey3
    Level 1 (4 points)
    Mar 29, 2016 2:08 PM in response to gcarey3

    I registered just to say thank you.

     

    You're a lifesafer.

first Previous Page 3 of 4 last Next