fdisk is the utility that can be used to create a correct setup on the flash disk.
It is run from the command line, by choosing options presented to the user.
After all changes have been recorded for the session, the user must choose to Write those changes to the drive for them to take effect. Should the user Quit before Writing the changes, then no changes are implemented.
Remember in this case it is the disk itself that is being worked on, and not a partition on that disk. So, it is the Structure of the disk, which allows partitions to be added and formatted that needs to be rectified.
I plugged in a USB flash drive into my PC, which takes the device node /dev/sdh, and its one partition is /dev/sdh1.
I will go through the commands in a Konsole and post them and the output below so you can see what you should expect, and the sequence you should adopt.
So here goes .....
1. Find out what device node the flash drive has
[user@Dell ~]$ fdisk -l
Disk /dev/sdf: 32 MB, 32112640 bytes
2 heads, 32 sectors/track, 980 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdf1 2 980 31328 4 FAT16 <32M
Disk /dev/sdh: 4116 MB, 4116709376 bytes
127 heads, 62 sectors/track, 1021 cylinders
Units = cylinders of 7874 * 512 = 4031488 bytes
Disk identifier: 0x0def5ab7
Device Boot Start End Blocks Id System
/dev/sdh1 * 1 1021 4019646 83 Linux
[user@Dell ~]$
I can see from the above that the flash stick is a 4GB drive and is located at /dev/sdh and has one partition on it.
Now I must work on the Drive and not the partition so here we go .....
[user@Dell ~]$ fdisk /dev/sdh
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help):
After the first command was entered I choose "m" to see the help menu. Next I will choose whichever option I wish -- in this case I want to creat a new Partition Table so choose "o" and get the following ....
Command (m for help): o
Building a new DOS disklabel with disk identifier 0x11c9a3a8.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help):
This is as far as I went.
In your case all is needed is to enter "w" to confirm the new Partition Table should be written to your disk. After that completes you Quit ("q"), extract the stick and after a little time, reinsert it, and then check it with the
fdisk -l
command again. It should now not show any errors in the partition table.
From there on you can use any partitioner you wish to create partitions on the drive.
Should you wish to do so, fdisk can be used to create the partitions also. Selecting "n" will help create a new partition if you wish to use fdisk for the job.
First things first ........ get the partition table corrected and then decide about the partitions themselves.
regards.