Pegasi Wiki

This wiki acts as a memo for our own work so why not share them? Feel free to browse and use out notes and leave a note while at it.

Format a USB stick in Linux to be Windows compatible

This time I am writing this down. There are lots of resources in internet about this but most of them are not working for me so here is something that I use to make my USB stick work with Windows - again as simple and straight as possible.

Steps to do

Example of device /dev/sdg. You can look the device up from realtime log “journalctl -f” and inserting the USB drive.

  • insert USB into Linux PC
  • dd if=dev/zero of=/dev/sdg bs=1024k count=10
  • fdisk /dev/sdg
    • n for new partition
    • 2 x <enter> for default sizes
    • t for type which needs to be “c”
    • a for active / bootable flag
    • w for write and quit
  • mkfs -t vfat /dev/sdg1 - if cannot see /dev/sdg1 then replug the USB stick
  • sync
  • remove and add to Windows PC

Alternative method

Slightly out of topic but to get the job done here is the alternative method you can do in Windows. So if it's still not working plug your USB to Windows, open cmd as admininstrator, start Diskpart and give following commands.

  • List Disk, identify the disk number that is your USB
  • Select Disk <number>
  • Clean
  • Create Partition Primary
  • Active
  • Format fs=Fat32 Quick
  • Exit

That should cover it. No more lottery about making a Win compatible USB :)

 stars  from 0 votes

Leave a comment

Enter your comment:

  //check if we are running within the DokuWiki environment if (!defined("DOKU_INC")){ die(); } //place the needed HTML source codes BELOW this line