FatFs - f_mount

## f_mount

The f_mount fucntion registers/unregisters a work area to the FatFs module.

    FRESULT f_mount (
      BYTE  vol,     /* [IN] Logical drive number */
      FATFS*  fatfs  /* [IN] File system object */
    );

#### Parameters

vol
  Logical drive number to register/unregister the work area. (0 to `_VOLUMES - 1`)
fatfs
  Pointer to the work area (file system object) to be registered.

#### Return Values

FR_OK, FR_INVALID_DRIVE

#### Description

The `f_mount()` function registers/unregisters a work area to the FatFs module. The work area must be given to the each volume with this function prior to use any other file function. To unregister a work area, specify a NULL to the `fatfs`, and then the work area can be discarded.

This function always succeeds regardless of the drive status. No media access is occured in this function. It only clears (uninitialize) the given work area and registers its address to the internal table. It can also be used to force cleared the registered work area of a logical drive. The volume mount process, initialize physical drive, detect the FAT volume and initialize the work area, is performed on first volume access when one or both of the work area and physical drive is not initalized.

#### QuickInfo

Always available.

#### See Also

`FATFS`

Return