On 7/1/07, Matthew Szudzik <[EMAIL PROTECTED]> wrote:
I have a usb flash drive that I wish to reformat as an MS-DOS (FAT) file
system. How do I do that on OpenBSD?
I want the drive to be formatted in the same manner that a Windows machine
or Macintosh might format an MS-DOS file system. So clearly, I don't want
to use disklabel, since OpenBSD disklabels are only intended to be read by
OpenBSD. I know that fsck_msdos can repair MS-DOS file systems, but I
want to create an MS-DOS file system (or possibly overwrite an existing
MS-DOS file system), rather than repair one. What about fdisk? The
default MBR template for fdisk is again doing something very
OpenBSD-specific, but maybe I could use some other template instead?
For interactive MBR edits you can use "fdisk -e sd0"
You probably want to use "0C" for FAT32 with long file name support.
fdisk sd0
fdisk: sysctl(machdep.bios.diskinfo): Device not configured
Disk: sd0 geometry: 38154/64/32 [78140160 Sectors]
Offset: 0 Signature: 0xAA55
Starting Ending LBA Info:
#: id C H S - C H S [ start: size ]
------------------------------------------------------------------------
*0: 0C 0 1 32 - 38154 23 32 [ 63: 78140097 ] Win95 FAT32L
1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused
Then use "disklabel sd0" to check whether OpenBSD has automagically
created a virtual disklabel "i" .
Then use /dev/rsd0i as device name for the newfs.
=Adriaan=