User Tools

Site Tools


cs:usb_stick_format

Format disk

Windows and MacOS are very fastidious about the kind of disks they can open and it is really annoying when you have to copy a file to a colleague and the system refuses to open the disk.

Matthew analyzed the situation. But in my experience, what he wrote does not work as-is.

Windows creates an extra partition Microsoft Reserved Partition (MSR), and it refuses to open few disks without it.

So a disk that can easily be open by Windows, MacOS, and Linux needs:

  • a GPT partition table
  • the first partition to be the MSR: size 16MB, type 0C01 (Microsoft reserved)
  • the second partition that contains the real data, it uses the other space and it has type 0700 (Microsoft basic data)
    • the first partition needs no formatting
    • the second partition has to be formatted with the exFAT filesystem (NTFS can be an alternative, but MacOS might not like it)

Before starting clear up the disk using wipefs. Then create the partition table with gdisk. To format use mkfs.exfat. Finally to be sure, clear up the MSR partition.

Example, let us prepare /dev/sdZ:

# wipefs -a /dev/sdZ[1-9]*
# wipefs -a /dev/sdZ
# gdisk /dev/sdZ
  . create a partition of size 16MB with code 0C01
  . create a partition with code 0700
  . write and quit
# wipefs --force -a /dev/sdZ1
# mkfs.exfat -n LABEL /dev/sdZ2
  OR
# mkfs.ntfs -QT -L LABEL /dev/sdZ2
cs/usb_stick_format.txt · Last modified: 2019/10/20 12:13 by paolo_bolzoni