# Make usb stick readable by Windows 10



## Alain De Vos (Aug 27, 2022)

How to make a USB stick under freebsd that is readable by Windows 10 , and is "most compatible".
- Do you make a partition table , 1) GPT or 2) MBR , or do you 3) write a raw filesystem without partition table
- Which filesystem should you use? FAT32 or FAT16 or FUSE-NTFS  or something else ?


----------



## zirias@ (Aug 27, 2022)

I don't know what Windows-10 would understand specifically – but in general just use a single partition on MBR with FAT32 fs inside, this will work virtually "everywhere".


----------



## Criosphinx (Aug 27, 2022)

exFAT is the system with more compatibility, it works on Windows since Vista I think, macOS, Android, etc. and doesn't have the limitations of FAT32


----------



## zirias@ (Aug 27, 2022)

Criosphinx said:


> exFAT is the system with more compatibility


Really? Older Windows versions need patches for it, it's not available on older MacOS and older Linux systems (and of course not on any other OS, including FreeBSD). Yes, there's a fuse-implementation, so on systems supporting fuse (which again includes FreeBSD), you _can_ use it, although with the typical drawbacks of fuse. I wouldn't call that "more compatibility".


----------



## 6502 (Aug 27, 2022)

The good news for exFAT is that it is not more "secret". Microsoft published its structure and it can be implemented without reverse engineering. exFAT is in fact FAT64. Older Windows support (see) only first partition of flash disk. Not sure for Windows 10 but guess there is no change. In my opinion, MBR is the better choice.


----------



## zirias@ (Aug 27, 2022)

6502 said:


> The good news for exFAT is that it is not more "secret".


Yes, but only recently (~3 years ago?). And I'm not aware of any PC operating systems besides Windows, Linux and MacOS that already provides "native" support...

So, it might be _technically_ a good choice, but I doubt the "more compatibility" statement, at least as of now. If you want the stick to "just work" in as many devices and with as many operating systems as possible, MBR+FAT32 (single partition!) is still the way to go. That is if the restrictions of FAT32 don't affect your usecase.


----------



## Alain De Vos (Aug 27, 2022)

.


----------



## kpedersen (Aug 27, 2022)

One thing I recommend is in fdisk, make sure the 1st entry is the one containing the Fat32 partition.

So from this random fdisk photo here, make sure the Fat32 partition is at the top. By default some tools generate a default with it at the bottom and I noticed that did happen to cause issues on Windows with some usb disks (driver related?). It simply couldn't find anything.


----------



## Alain De Vos (Aug 27, 2022)

6502 said:


> The good news for exFAT is that it is not more "secret". Microsoft published its structure and it can be implemented without reverse engineering. exFAT is in fact FAT64. Older Windows support (see) only first partition of flash disk. Not sure for Windows 10 but guess there is no change. In my opinion, MBR is the better choice.


How do you create an ex-fat partition under freebsd?
How do you format a partition to ex-fat under freebsd ?
How do you mount an ex-fat partition under freebsd ?


----------



## zirias@ (Aug 27, 2022)

Alain De Vos said:


> How do you create an ex-fat partition under freebsd?
> How do you format a partition to ex-fat under freebsd ?
> How do you mount an ex-fat partition under freebsd ?


sysutils/fusefs-exfat. But IMHO, only use it if you're running into troubles with FAT32 (which is supported natively on FreeBSD), like e.g. maximum file size.


----------



## Alain De Vos (Aug 27, 2022)

That's only for mounting , not for making a partition (gpart add -t ???), nor formatting, no ?

PS: For fat32 i think the commands are:

```
gpart create -s mbr da0
gpart add -t fat32 da0
newfs_msdos -F32 /dev/da0s1
```


----------



## zirias@ (Aug 27, 2022)

sysutils/exfat-utils and gpart(8) (yes, this manpage tells you for example that with MBR, the partition type for exFAT is the same as for NTFS).

Is there a specific reason why you think you need exFAT?


----------



## Alain De Vos (Aug 27, 2022)

With the commands i just mentioned above, my usb stick was not readable by the "local copy center using windows".
Altough it worked when i used linux/gparted for making partition table & fat32.

So if i'm correct i do :

```
gpart create -s mbr da0
gpart add -t ntfs da0
```
But then how do i format to exfat ?
Is it

```
mkntfs
```
with some parameters ?


----------



## zirias@ (Aug 27, 2022)

sysutils/exfat-utils includes an `mkexfatfs` tool and a corresponding manpage.

But, really, FAT32 *should* work everywhere. Are you sure you didn't run into a different problem (like e.g. unplugging the stick before properly unmounting it)?


----------



## freespirit8827 (Sep 11, 2022)

Jus like a pair of shoes wares out after  time, a  usb thumb drive will wareout faster if you constntly reformat it because the nand memory chips although they are more reliable then floppies are still going to ware-out eventually, so what I do to avoid this paradox is  try to keep four or five flash drives around as  storage has gotten progressively less expencive as matter of fact the last time that I check amazon you could litterally get a 1tb thumbdrive for just under $40 before tax and shipping.


----------



## SirDice (Sep 12, 2022)

Contrary to popular belief, a format doesn't actually write the whole drive. All it does is wipe the directory structure and the block allocation tables. It does NOT write to every sector/block of the drive.


----------



## smithi (Sep 23, 2022)

Alain De Vos said:


> That's only for mounting , not for making a partition (gpart add -t ???), nor formatting, no ?
> 
> PS: For fat32 i think the commands are:
> 
> ...





Alain De Vos said:


> With the commands i just mentioned above, my usb stick was not readable by the "local copy center using windows".
> Altough it worked when i used linux/gparted for making partition table & fat32.



There are two distinct varieties of FAT32, see gpart(8), namely fat32 (type 11) and fat32lba (type 12).

I ran into this recently with some new Lexar USB sticks, 4 of 32G (USB3) and 2 of 64G (USB2, my mistake).

The '32G' ones, like all my older sticks, are fat32lba - but the '64G' ones came as fat32 type 11 (as shown by gpart) and are not recognised by my Samsung J5, so I chose to let the phone reformat the still empty stick, which it did as fat32lba, afterwards working on either phone or laptop.

Also, 6 months ago I'd shrunk the win10pro NTFS partition on my refurbished T430s' SSD by 80GiB, then had windows create a 32GiB FAT32 partition for shared data, installing FreeBSD  in the remaining 48GiB slice 4.

The point being, windows 10 itself creates with 'fat32lba type 12' on an MBR scheme, so if you used gpart add '-t fat32lba' rather than '-t fat32', I expect your "local copy centre" should be happy.

There's no such distinction in the newfs_msdos command - on the surface anyway.

HTH, Ian


----------

