3

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 try using 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.

After using dd to zero-write the drive, and then using Disks to create a "FAT" partition, 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.

I tried again, this time formatting the drive in Disks and then using Gparted to create a "fat32" partition table, followed by a partition that I formatted as fat32, but still got the same error.

It seems to me that 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 to getting my 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 get rid of it?

Hashim Aziz
  • 13,835

2 Answers2

0

I know this question is old, but I had the same problem and couldn't find an answer, so I had to figure out how to solve it on my own.

Apparently, the issue is that there is no partition within the disk. So, I first partitioned the disk using the following command:

sudo fdisk /dev/sdc

Press 'n' to create a new partition. You will be asked for the partition number, the first sector, and the last sector. Press 'Enter' to maintain the default values.

After creating the new partition, you need to write these configurations to the disk. Just type 'w', and the configuration will be written to the disk, exiting fdisk.

Now, you have one partition inside your disk, and you should address this partition in your command line: sdc -> sdc1. Then, execute the following command:

sudo mkfs.vfat -F32 /dev/sdc1

Now, your Linux or Windows system will recognize the partition.

0

/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!

Hashim Aziz
  • 13,835