SUCCESS: D50 - Format 4GB *SD* in Mac OSX Tiger

Discussion in 'Digital Photography' started by cube, Oct 22, 2008.

  1. cube macrumors G4

    Joined:
    May 10, 2004
    #1
    Hello,

    How do you format a 4GB *SD* (not SDHC) card in the Mac so that the Nikon D50 recognizes it?
    I tried Disk Utility and newfs_msdos and "Get Info" shows it as FAT32, but it doesn't work. Does one need a specific volume name or directory structure or what?

    Thanks
     
  2. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #2
    My D50 user manual says the D50 can use up to 2GB cards. It could be because there were no 4GB cards when the camera was made so they couldn't test them but I suspect there is a limitation in the camera.
     
  3. cube thread starter macrumors G4

    Joined:
    May 10, 2004
    #3
    No, I read about people using 4GB SD formatted as FAT32.

    I don't know what sector, cluster sizes it needs, directory structure, etc.
     
  4. mbrizan macrumors newbie

    Joined:
    Jun 2, 2008
    #4
    Try using the format command from the user menu on the camera with the card inserted in the camera.
     
  5. cube thread starter macrumors G4

    Joined:
    May 10, 2004
    #5
    No, the camera can only format upto 2GB and in FAT16, that's the whole point of wanting to do it on the Mac.

    The SD Card association has a formatter, but only for Windows. :mad:
     
  6. Artful Dodger macrumors 68020

    Artful Dodger

    Joined:
    May 28, 2004
    Location:
    In a false sense of reality...My Mind!
    #6
    cube if you ever get this figured out please post how as I also have a D50 and had hoped that this could be done even though I have plenty of 2GB SD cards.
     
  7. cube thread starter macrumors G4

    Joined:
    May 10, 2004
    #7
    Could you tell me what the directory structure and the volume name are? I have no smaller cards yet to find it out.

    Thanks
     
  8. cube thread starter macrumors G4

    Joined:
    May 10, 2004
    #8
    Wanting to verify if FAT32 is in fact a problem, I formatted the partition as FAT16 and it is still not recognized.
     
  9. leighonigar macrumors 6502a

    Joined:
    May 5, 2007
    #9
  10. cube thread starter macrumors G4

    Joined:
    May 10, 2004
    #10
    I could just use the 4GB card formatted in another camera.

    If I modify it by only formatting the partition using newfs_msdos in the Mac with the same parameters as those that the other camera used, it doesn't work in the D50.

    Besides wanting to find a Mac solution, I wanted to try changing the sectors per cluster to 32, like in the D70, because my other camera only uses 8.
    The sector size was already 512, like in the D70.

    The D50 seemed slow for writing so I think it was because of the small cluster size.

    I didn't see anything in the file structure that seemed special, just DCIM and a picture folder inside it (because of the different camera convention, the D50 created a new one besides the original one following the number sequence at the beginning of the name).
     
  11. cube thread starter macrumors G4

    Joined:
    May 10, 2004
    #11
    SUCCESS!!

    You get about 460 RAW+BASIC pictures on a 4GB card.

    HOW TO:

    - Open Disk Utility and do "Get Info" on this drive to see which device it is (eg: /dev/disk1)

    - If the drive is formatted somehow, unmount, not eject, the drive/partitions (eg, for each of them, in the Terminal) :
    Code:
    sudo umount /Volumes/WHOLE-DRIVE-OR-PARTITION-NAME
    - In the Terminal, create a correct and optimized filesystem in the whole drive, using the raw device for the disk indicated by Disk Utility (change the drive device parameter in the following). THIS ERASES THE WHOLE DRIVE:

    Code:
    newfs_msdos -v UNTITLED -S 512 -c 64 -F 32 -m 0xf8 -k 0x6 -o 63 -i 0x1 /dev/rdisk1
    (the optimization is the cluster size, the fix is to the bad layout created by Disk Utility or defaulted BSD newfs_msdos).

    That creates a card without partition table, I'll check about doing the similar thing also with a partition table (for what?). Maybe creating a partitioned scheme with Disk Utility is safer, as this might leave some free space around the filesystem also for an MS-DOS scheme.

    The D50 accomplished bursts of 3 pictures in RAW+BASIC with a takeMS 133x 4GB SD card.


    Use at your own risk. If you lose pictures, it's your fault.

    If you unmount and reformat the wrong disk/partition, it's also your fault.
     
  12. cube thread starter macrumors G4

    Joined:
    May 10, 2004
    #12
    - HOW TO with partition table

    - Erase the whole drive as MS-DOS in Disk Utility, giving it the name you like (eg: UNTITLED)

    - In Disk Utility do "Get Info" on this drive to see which device it is (eg: /dev/disk1)

    - Unmount, not eject, the single partition in the drive (eg, in the Terminal) :
    Code:
    sudo umount /Volumes/UNTITLED
    - In the Terminal, fix and optimize the filesystem in the single partition, using the raw device for the first partition in the disk indicated by Disk Utility (change the partition device parameter in the following, note not only the drive number, but also the "s1" suffix). THIS ERASES THE PARTITION:

    Code:
    newfs_msdos -v UNTITLED -S 512 -c 64 -F 32 -m 0xf8 -k 0x6 -o 63 -i 0x1 /dev/rdisk1s1
    (the optimization is the cluster size, the fix is to the bad layout created by Disk Utility or defaulted BSD newfs_msdos).

    Use at your own risk. If you lose pictures, it's your fault.

    If you unmount and reformat the wrong disk/partition, it's also your fault.[/QUOTE]
     
  13. cube thread starter macrumors G4

    Joined:
    May 10, 2004
    #13
    I wrote a script. This will destroy the contents of the disk you tell it. Use at your own risk

    Copy the following code into a plain text file, for example: sdformat32.sh
    Code:
    #!/bin/sh
    
    # This script is for formatting SD cards of at least 4GB
    # It formats them as FAT32 with 32K cluster size
    #
    # Argument 1: Device inside /dev to be formatted, eg.: disk99
    # Argument 2: Volume name for the partition, eg: UNTITLED
    
    if [ $# -ne 2 ]
    then
      echo Usage: sdformat32 diskname volumename
      exit 1
    fi
    
    disk=/dev/"$1"
    partition=/dev/r"$1"s1
    volume=$2
    
    echo This will DESTROY $disk. Are you sure? "(y/n)"
    read yn
    if [ $yn == 'y' ]
    then
      echo Partitioning $disk with volume name $volume ...
      diskutil partitionDisk $disk 1 MBRFormat MS-DOS $volume 3G
    
      if [ $? -eq 0 ] 
      then
        echo Unmounting $disk ...
        diskutil unmountDisk $disk
    
        if [ $? -eq 0 ]
        then
          echo Fixing and optimizing partition ...
          newfs_msdos -v $volume -S 512 -c 64 -F 32 -m 0xf8 -k 0x6 -o 63 -i 0x1 $partition
    
          if [ $? -eq 0 ]
          then
            echo Mounting $disk in case you want to write to it ...
            echo Do not forget to eject the drive before removing it!
            diskutil mountDisk $disk
    
            if [ $? -eq 0 ]
            then
              echo Done
            else
              echo The disk was formatted but could not be mounted!
              exit 6
            fi
          else
            echo Could not reformat the partition!
            exit 5
          fi
        else
          echo Could not unmount volume!
          exit 4
        fi
      else
        echo Could not partition disk!
        exit 3
      fi
    else
      echo Aborting. Nothing done
      exit 2
    fi
    exit 0
    
    You have to give it the device name inside /dev of the disk to be formatted. For example, if the disk is /dev/disk99, you pass disk99.

    You also have to give it the name of the new volume, for example UNTITLED.

    Save it in a directory in your PATH, or execute by giving its full path, or change directory to wehere it's saved and execute, for example:
    Code:
    ./sdformat32.sh disk99 UNTITLED
    If you don't want to give execution rights to the file, you can always run it like (for example):
    Code:
    sh sdformat32.sh disk99 UNTITLED
    It will destroy your disk without asking for the root password
     
  14. cube thread starter macrumors G4

    Joined:
    May 10, 2004
    #14
    I modified the script above so that it doesn't need to ask for the root password for the last steps.

    The script only works if the device is already mounted, so if you have an unformatted card, format it to whatever in Disk Utility first.
     
  15. t-bird macrumors newbie

    Joined:
    Nov 20, 2008
    #15
    There must be an actual difference between SD and SDHC cards. Never found anything definitive, nor could I find a 4G SD card, so I bought a 2G SD card and a 4G SDHC card to try things out.

    The SD card works fine in the D50 in both FAT16 and FAT32. (Use -c 32 in the newfs_msdos command line to get enough FAT32 clusters on a 2G partition). The SDHC card resulted in "CHA" for both a 4G and 2G partition.
     
  16. cube thread starter macrumors G4

    Joined:
    May 10, 2004
    #16
    SDHC hardware is incompatible with older cameras designed only for SD.

    You must use a 4GB SD card, which are not really standard.

    I can confirm takeMS. Other of the off-brands have them too.
     

Share This Page