Mounting with sync

Table of Contents

  1. OS X
  2. Linux

Mbed OS 2 and Mbed OS 5

This is the handbook for Mbed OS 2. If you’re working with Mbed OS 5, please see the new handbook.

This page describes how to configure Linux or OS X to mount the mbed Microcontroller with the 'sync' option, this ensures files copied to the board are written immediately and without having to 'Eject' the drive.

Note: It is not necessary on all systems, but we haven't made up a list yet. Use this if you found you needed to "eject" before the file was properly transfered

OS X

Open a Terminal window and edit (or create) the file /etc/fstab with a text editor such as pico for example with the command:

sudo pico /etc/fstab

Add an entry to the end of the existing fstab file for the mbed device,

LABEL=MBED none msdos rw,sync

Do not change any other entries in /etc/fstab.

Save the updated /etc/fstab then reconnect the mbed board so that the drive is mounted with the new configuration.

Note that you must update the text following LABEL= in fstab if you change the volume label of your mbed board.

Linux

There are several possible ways to achieve this on Linux but the most reliable seems to be to simply add a static entry in fstab. For distributions that use tools like pmount or gnome-mount to automatically mount removable devices you may be able to configure these to get a similar result.

Open a Terminal window (shell) and run mount to get a list of the currently mounted file systems, you should see a entry for the mbed board like this:

/dev/sdb on /media/MBED type vfat (rw,nosuid,nodev,shortname=mixed,uid=1000,utf8,umask=077)

edit /etc/fstab with a text editor such as pico for example with the command:

sudo pico /etc/fstab

Add an entry to the end of the existing fstab file for the mbed device, changing /dev/sdb if necessary.

/dev/sdb /media/MBED vfat rw,user,sync 0 0

Do not change any other entries in /etc/fstab.

Save the updated /etc/fstab then create the mount point with:

sudo mkdir /media/MBED

Reconnect the mbed board so that the drive is mounted with the new configuration.

If you have several removable devices you may find that the mbed board is not always /dev/sdb. If so, you can replace /dev/sdb with a symbolic link from /dev/disk/by-id which uniquely identifies one mbed board using its serial number or create a udev rule to create a persistant name like /dev/mbed1.


All wikipages