RTEMS Logo

RTEMS 4.9.0 On-Line Library


File and Directory Commands mount - mount disk

PREV UP NEXT Bookshelf RTEMS Shell User's Guide

3.2.12: mount - mount disk

SYNOPSYS:

mount [-t fstype] [-r] [-L] device path

DESCRIPTION:

The mount command will mount a block device to a mount point using the specified file system. The files systems are:

When the file system type is 'msdos' the driver is a "block device driver" node present in the file system. The driver is ignored with the 'tftp' and 'ftp' file systems. For the 'nfs' file system the driver is the 'host:/path' string that described NFS host and the exported file system path.

EXIT STATUS:

This command returns 0 on success and non-zero if an error is encountered.

NOTES:

The mount point must exist.

The services offered by each file-system vary. For example you cannot list the directory of a TFTP file-system as this server is not provided in the TFTP protocol. You need to check each file-system's documentation for the services provided.

EXAMPLES:

Mount the Flash Disk driver to the '/fd' mount point:

$ mount -t msdos /dev/flashdisk0 /fd

Mount the NFS file system exported path 'bar' by host 'foo':

$ mount -t nfs foo:/bar /nfs

Mount the TFTP file system on '/tftp':

$ mount -t tftp /tftp

To access the TFTP files on server '10.10.10.10':

$ cat /tftp/10.10.10.10/test.txt

CONFIGURATION:

This command is included in the default shell command set. When building a custom command set, define CONFIGURE_SHELL_COMMAND_MOUNT to have this command included.

This command can be excluded from the shell command set by defining CONFIGURE_SHELL_NO_COMMAND_MOUNT when all shell commands have been configured.

The mount command includes references to file-system code. If you do not wish to include file-system that you do not use do not define the mount command support for that file-system. The file-system mount command defines are:

An example configuration is:

#define CONFIGURE_SHELL_MOUNT_MSDOS
#ifdef RTEMS_NETWORKING
  #define CONFIGURE_SHELL_MOUNT_TFTP
  #define CONFIGURE_SHELL_MOUNT_FTP
  #define CONFIGURE_SHELL_MOUNT_NFS
#endif

PROGRAMMING INFORMATION:

The mount is implemented by a C language function which has the following prototype:

int rtems_shell_rtems_main_mount(
  int    argc,
  char **argv
);

The configuration structure for the mount has the following prototype:

extern rtems_shell_cmd_t rtems_shell_MOUNT_Command;


PREV UP NEXT Bookshelf RTEMS Shell User's Guide

Copyright © 1988-2008 OAR Corporation