0

I'm using terminal on a mac. I tried to create a FAT32 disk with 'newfs_msdos', but I got the following error and cannot create it. I was able to create a FAT32 disk by running the command 'diskutil erasevolume FAT32' and powershell command 'new-partition -mbrtype fat32 '.

How can I create a FAT32 disk with 'newfs_msdos'? I would also like to know the reason for such a difference and the effect of the difference.

~ % diskutil erasedisk FAT32 MYF MBRformat /dev/disk2
Started erase on disk2
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk2s1 as MS-DOS (FAT32) with name MYF
512 bytes per physical sector
/dev/rdisk2s1: 60589120 sectors in 1893410 FAT32 clusters (16384 bytes/cluster)
bps=512 spc=32 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=2048 drv=0x80 bsec=60618752 bspf=14793 rdcl=2 infs=1 bkbs=6
Mounting disk
Finished erase on disk2

~ % diskutil list disk2                                
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *31.0 GB    disk2
   1:                 DOS_FAT_32 MYF                     31.0 GB    disk2s1

~ % sudo fdisk /dev/disk2                              
Disk: /dev/disk2    geometry: 3773/255/63 [60620800 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: 0B 1023 254  63 - 1023 254  63 [      2048 -   60618752] Win95 FAT-32
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      

~ % sudo gpt -vvv show /dev/disk2                      
gpt show: /dev/disk2: mediasize=31037849600; sectorsize=512; blocks=60620800
gpt show: /dev/disk2: MBR at sector 0
gpt show: /dev/disk2: MBR part: type=11, start=2048, size=60618752
     start      size  index  contents
         0         1         MBR
         1      2047         
      2048  60618752      1  MBR part 11

--
--

fat32 disk by powershell

~ % sudo gpt -vvv show /dev/disk3
gpt show: /dev/disk3: mediasize=31001149440; sectorsize=512; blocks=60549120
gpt show: /dev/disk3: MBR at sector 0
gpt show: /dev/disk3: MBR part: type=12, start=2048, size=60547072
gpt show: /dev/disk3: Pri GPT at sector 1
     start      size  index  contents
         0         1         MBR
         1         1         Pri GPT header
         2        32         Pri GPT table
        34      2014         
      2048  60547072      1  MBR part 12
~ % sudo fdisk /dev/disk3   
Disk: /dev/disk3    geometry: 3769/255/63 [60549120 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: 0C    0  32  33 - 1023 254  63 [      2048 -   60547072] Win95 FAT32L
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
~ % diskutil list disk3                                
/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *31.0 GB    disk3
   1:             Windows_FAT_32 NO NAME                 31.0 GB    disk3s1 

--
--

 ~ % sudo newfs_msdos /dev/disk2  
newfs_msdos: warning: /dev/disk2 is not a character device
512 bytes per physical sector
/dev/disk2: 60591168 sectors in 1893474 FAT32 clusters (16384 bytes/cluster)
bps=512 spc=32 res=32 nft=2 mid=0xf0 spt=32 hds=255 hid=0 drv=0x00 bsec=60620800 bspf=14793 rdcl=2 infs=1 bkbs=6

~ % sudo newfs_msdos -F 32 /dev/disk2 
newfs_msdos: warning: /dev/disk2 is not a character device
512 bytes per physical sector
/dev/disk2: 60591168 sectors in 1893474 FAT32 clusters (16384 bytes/cluster)
bps=512 spc=32 res=32 nft=2 mid=0xf0 spt=32 hds=255 hid=0 drv=0x00 bsec=60620800 bspf=14793 rdcl=2 infs=1 bkbs=6

 ~ % sudo newfs_msdos -F 32 -v MYF /dev/disk2 
newfs_msdos: warning: /dev/disk2 is not a character device
512 bytes per physical sector
/dev/disk2: 60591168 sectors in 1893474 FAT32 clusters (16384 bytes/cluster)
bps=512 spc=32 res=32 nft=2 mid=0xf0 spt=32 hds=255 hid=0 drv=0x00 bsec=60620800 bspf=14793 rdcl=2 infs=1 bkbs=6
~ % diskutil list disk2
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                                                   *31.0 GB    disk2

~ % sudo fdisk /dev/disk2
Password:
Disk: /dev/disk2    geometry: 3773/255/63 [60620800 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 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      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      

 ~ % sudo gpt -vvv show /dev/disk2
gpt show: /dev/disk2: mediasize=31037849600; sectorsize=512; blocks=60620800
gpt show: /dev/disk2: MBR at sector 0
     start      size  index  contents
         0         1         MBR
         1  60620799  
2
  • 4
    Not 100% familiar with macOS CLI tools, but it looks like you’re attempting to use newfs_msdos against the entire device, not a partition. Is that intentional?
    – Daniel B
    Jan 16, 2022 at 14:27
  • 1
    Why do you specifically want to do it using newfs_msdos rather than diskutil eraseDisk? This makes it feel like an XY Problem
    – Tetsujin
    Jan 16, 2022 at 17:07

0

You must log in to answer this question.

Browse other questions tagged .