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?

9
  • You tried to format the entire device. You need to first create a partition e.g. with fdisk or gparted and then format that partition.
    – Tesseract
    Commented Aug 16, 2017 at 22:09
  • Sorry, I should have mentioned that I created a partition after formatting. I did this the first time using Disks to create a "FAT" partition, and then with the gparted GUI to create a fat32 partition. I always get the same error. Edited the post to reflect that. Commented Aug 16, 2017 at 22:12
  • 1
    The fat32 partition you created should be /dev/sdc1. You only need -I to format a raw device but not for a partition.
    – Tesseract
    Commented Aug 16, 2017 at 22:23
  • So you're saying that the USB either needs to have no partition (i.e. be a raw drive) or, if it has a partition, run the mkfs.vfat command on /dev/sdc1, and without the -I switch? Commented Aug 16, 2017 at 22:29
  • 1
    Yes, but you could also use gparted to format the partition.
    – Tesseract
    Commented Aug 16, 2017 at 22:32

2 Answers 2

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!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .