Format a USB flash drive using gpart

Polytropon freebsd at
Sun Jul 8 09:45:10 UTC 2012

On Sat, 07 Jul 2012 17:45:17 -0400, Thomas Mueller wrote:
> Does a USB flash drive also work as a giant floppy, no partitions? 
> Can you make a flash drive bootable when nonpartitioned and
> formatted that way?

Yes, that's exactly what my advice was aiming to, but let's
try to keep the terminology clean: You cannot do without
partitions. A partition carries a file system.

You _can_ do without slices. A slice holds one or more partitions.
A slice is a "DOS primary partition". Omitting it is called
"dedicated mode". There may be some circumstances where a
dedicated disk doesn't boot. Personally I haven't met one,
but it's still possible due to BIOSes expecting MS-DOS-alike

For the file system side, it's just a matter of having
created one partition covering the whole disk, newfs and
tunefs it, and install the boot code. Wojciech Puchar did
already explain how this works and which tools are involved.

However, there _is_ a way to make a "giant floppy without a
file system" (as you said without partitions, and I'll take
that literally): You can use tar, "the universal file system
that isn't a file system" to write data to the USB stick.

Writing stuff:

	# tar cf /dev/da0 /my/files

Reading stuff:

	# tar xf /dev/da0

This works, but it may appear that no other system can read it.
If you consider using it for FreeBSD only, no problem. The big
advantage: You don't need to mount and umount the stick.

I'm assume _that_ construct cannot be booted.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list