Hi,
I'm trying to figure out the best way to format a USB stick as FAT32.
This is what I've tried:
$ time doas newfs_msdos /dev/rsd1c
/dev/rsd1c: 60007944 sectors in 7500993 FAT32 clusters (4096
bytes/cluster)
bps=512 spc=8 res=32 nft=2 mid=0xf0 spt=63 hds=255 hid=0 bsec=60125184
bspf=58602 rdcl=2 infs=1 bkbs=2
20m08.34s real 0m00.35s user 0m12.81s system
As you can see, it takes many minutes, and the elapsed time is much
larger than the CPU time. Looking at top while the command runs shows
that newfs_msdos has PRI -5, its CPU usage fluctuates around 0.5%,
STATE is mostly "sleep" with WAIT being "physio".
The same happens if I call newfs_ext2fs -I.
For comparison, `newfs /dev/rsd1c` is almost instantaneous: 0m00.88s
real 0m00.06s user 0m00.16s system. It doesn't work if the disk is
already formatted as FAT32, though: I have to call `fdisk -e sd1`, and
reinit, otherwise I get a "can't rewrite disk label" error; I'm not
sure why newfs cares and newfs_msdos doesn't, maybe I'm doing it wrong
somehow.
How can I speed the creation of a FAT32 or Ext2 file system up?
Best regards
Stanislav Syekirin