Attribute "partition" not found - error when formatting USB flash drive

22,936

/dev/sdc is the disk itself, whereas /dev/sdc0, /dev/sdc1 etc. are the partitions.

You have written the file system to the raw disk, rather than a partition on the disk. Linux is happy to read file systems on raw disks, but you may run into problems with other operating systems or embedded devices (e.g. TV, game console etc.)

I am guessing the message relates to FAT32 on raw disks being non-standard. I would guess Linux lets you do it, but doesn't recommend it. Admittedly, the message could be a bit more helpful.

If you really want the disk to work on as many operating systems and devices as possible, you will want to write a 'msdos' partition table; otherwise, if you are using the disk only on modern operating systems (Linux, Windows 10 etc.), a 'gpt' partition table is a good choice. Once you have created the partition table and the single partition, you can then do:

sudo mkfs.vfat /dev/sdc0

However, you will want to double check that sdc still refers to the same disk first!

Share:
22,936

Related videos on Youtube

Hashim Aziz
Author by

Hashim Aziz

Updated on September 18, 2022

Comments

  • Hashim Aziz
    Hashim Aziz over 1 year

    I have a USB flash drive that's become unrecognisable in Windows 7, as detailed in my question on SuperUser here. I was advised to use Ubuntu, and was able to see the flash drive using it, although using Disks to zero-wipe, format it and create a new partition still didn't make it visible in Windows 7.

    I decided to try use the command line. After using dd to zero-write the drive, I started following this answer here, and did the command:

    sudo mkfs.vfat -I /dev/sdc 
    

    I got the error:

    Attribute "partition" not found

    ...and the command stopped running.

    After doing some more digging into the mkfs.vfat command, I then ran a modified version of the command:

    sudo mkfs.vfat -F 32 -c -v -I
    

    I got the same error as above, except this time the command continued searching for bad blocks, and then terminated.

    I'm guessing the error has something to do with the -I switch, but I'd rather not omit it because I feel like it may be a necessary step on the way to getting the USB successfully recognised again. I've checked in Disks, and it does report the drive as having a (single, FAT) partition.

    What exactly does the Attribute "partition" not found error mean, and how can I solve it?

    • muru
      muru over 6 years
      Probably you need to create a partition table on it, then a partition and then format the partition, instead of formatting the disk directly?
    • Hashim Aziz
      Hashim Aziz over 6 years
      @muru, how would I create a partition table? I was under the impression the Ubuntu GUI took care of all when you created a partition in Disks.
    • Hashim Aziz
      Hashim Aziz over 6 years
      Okay, I managed to do all that in gparted, although I can't help but feel that it was redundant because many steps are already implied in previous steps. Regardless, I used gparted to format the entire disk clean, create a msdos/FAT32 partition table on it, then formatted the partition again to FAT32. I then ran the command again and got the same error.