Friday, August 12, 2011

Mounting MSDOS/FAT filesystems under Solaris

I needed to copy over a bunch of photographs to my EON NAS so I put them on a USB stick and attached the stick directly to the NAS to get the maximum speed while copying.  It turns out, while on Linux you type something like:
mount -t vfat /dev/sdd1 /tmp/usbstick

to mount the FAT or FAT32 filesystem from /dev/sdd1 to /tmp/usbstick, that command doesn't work on Solaris which is what EON NAS is running on.  Here are all the steps I took to mount the USB stick under Solaris:
  • Run the "format" command to see the device name of the new USB stick.  The output looks like:
#formatSearching for disks... 
The current rpm value 0 is invalid, adjusting it to 3600done 
c3t0d0: configured with capacity of 465.74GB 
     /pci@0,0/pci1458,b002@11/disk@0,0 1. c0t1d0
     /pci@0,0/pci1458,b002@11/disk@1,0 2. c0t2d0
     /pci@0,0/pci1458,b002@11/disk@2,0 3. c0t3d0
     /pci@0,0/pci1458,b002@11/disk@3,0 4. c3t0d0
Specify disk (enter its number): ^C

Use Ctrl-C to break out of the format command.  Based on the output of the format command, I know my Seagate FreeAgentGoFlex USB drive is /dev/dsk/c3t0d0.
  • Create a mount point for that USB stick using:
mkdir /tmp/usbstick"
  • Mount the FAT filesystem on the first partition of /dev/dsk/c3t0d0 using the command:
mount -F pcfs /dev/dsk/c3t0d0s0:c /tmp/usbstick

Et voila!  You should have the disk mounted and writable.  Finish copying to/from the disk and then issue a umount /tmp/usbstick command to unmount.  Don't forget to clean up and remove the /tmp/usbstick directory.