Post Reply 
HP 50g & SD Cards: Performance, Format, Notes
07-16-2016, 02:37 PM (This post was last modified: 07-16-2016 02:39 PM by Sylvain Cote.)
Post: #9
RE: HP 50g & SD Cards: Performance, Format, Notes
For the Mac OS/X or should I say the macOS users ...

How to format a SD card in FAT16 from the command line using the diskutil command.

At the command line given by the Terminal application

To list the available supported partition types, type: diskutil listFilesystems [enter]
Code:
 
Formattable file systems

These file system personalities can be used for erasing and partitioning.
When specifying a personality as a parameter to a verb, case is not considered.
Certain common aliases (also case-insensitive) are listed below as well.

-------------------------------------------------------------------------------
PERSONALITY                     USER VISIBLE NAME                               
-------------------------------------------------------------------------------
ExFAT                           ExFAT                                           
UFSD_EXTFS                      Extended Filesystem 2                           
UFSD_EXTFS3                     Extended Filesystem 3                           
UFSD_EXTFS4                     Extended Filesystem 4                           
Free Space                      Free Space                                      
  (or) free
MS-DOS                          MS-DOS (FAT)                                    
MS-DOS FAT12                    MS-DOS (FAT12)                                  
MS-DOS FAT16                    MS-DOS (FAT16)                                  
MS-DOS FAT32                    MS-DOS (FAT32)                                  
  (or) fat32
HFS+                            Mac OS Extended                                 
Case-sensitive HFS+             Mac OS Extended (Case-sensitive)                
  (or) hfsx
Case-sensitive Journaled HFS+   Mac OS Extended (Case-sensitive, Journaled)     
  (or) jhfsx
Journaled HFS+                  Mac OS Extended (Journaled)                     
  (or) jhfs+
UFSD_NTFS                       Windows NT Filesystem                           
UFSD_NTFSCOMPR                  Windows NT Filesystem (compressed)

To list the available disks, type: diskutil list [enter]
Code:
/dev/disk0 (internal, physical):
...
/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *507.4 MB   disk3
   1:                 DOS_FAT_32 MSDDATA                 507.3 MB   disk3s1
...

Identify the SD card
Code:
a) diskutil list [enter] (without the SD inserted) -> take note of the disks available and their numbers
b) diskutil list [enter] (SD inserted)             -> take note of the disks available and their numbers
c) diskutil list [enter] (without the SD inserted) -> take note of the disks available and their numbers
d) compare the disks numbers for all lists and one of them should only appears as (external,physical) at step (b)

WARNING: be sure to identify the correct disk for the SD card else you could erase your internal hard disk.

The diskutil partitionDisk command:
Code:
diskutil partitionDisk MountPoint|DiskIdentifier|DeviceNode [numberOfPartitions] [APM[Format]|MBR[Format]|GPT[Format]] [part1Format part1Name part1Size part2Format part2Name part2Size part3Format part3Name part3Size ...]

Tool.......: diskutil
Command....: partitionDisk
Where......: MountPoint|DiskIdentifier|DeviceNode      (/dev/disk?)
Partitions.: [numberOfPartitions]                      (1, 2, 3, ... )
Part.Type..: [APM[Format]|MBR[Format]|GPT[Format]]     (one of the following: APM, APMFormat, MBR, MBRFormat, GPT, GPTFormat)
Partition 1: [part1Format part1Name part1Size]         (supported formats as by listFilesystems)
Partition X: [partXFormat partXName partXSize]

Formatting example using a 500MB SD card mounted at /dev/disk3
Example: diskutil partitiondisk /dev/disk3 1 MBRFormat "MS-DOS FAT16" "HP50G01" 507M [ENTER]
Code:
Started partitioning on disk3
Unmounting disk
Creating the partition map
Waiting for the disks to reappear
Formatting disk3s1 as MS-DOS (FAT16) with name HP50G01
512 bytes per physical sector
/dev/rdisk3s1: 990336 sectors in 61896 FAT16 clusters (8192 bytes/cluster)
bps=512 spc=16 res=1 nft=2 rde=512 mid=0xf8 spf=242 spt=32 hds=54 hid=63 drv=0x80 bsec=990864
Mounting disk
Finished partitioning on disk3
/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *507.4 MB   disk3
   1:                 DOS_FAT_16 HP50G01                 507.3 MB   disk3s1

You have now a SD card FAT16 formatted ready to be used Smile

Sylvain

edit: typo
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 50g & SD Cards: Performance, Format, Notes - Sylvain Cote - 07-16-2016 02:37 PM



User(s) browsing this thread: 2 Guest(s)