pavement

Mount

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
m (link disambiguation)
(Further expansion on the mount commands)
Line 1: Line 1:
'''mount''' is used to mount drives on the filesystem for access.  For an example, see [[USB storage]].
+
{{System-Commands}}
 +
 
 +
The '''mount''' command is used to link a file system to the local host allowing access to files stored upon themThese file systems could be on physical media, such as a hard drive, CD-ROM or USB memory key, or virtual media, such as file server shares.  FreeBSD has support for a large number of file systems and can write files to a majority of them.
 +
 
 +
== Operation ==
 +
 
 +
The mounting of a file system to the local host works by creating a ''''mount-point'''' at which the file system can then be accessed.  This fits in with the Unix concept of 'everything is a file' and as such a CD-ROM drive, for example, is typically ''''mounted'''' as '''/cdrom'''.  Other file systems are typically mounted under the '''/mnt''' directory.  The technical term is called 'grafting' a device to the local file system tree.
 +
 
 +
An typical installation of FreeBSD might have the following mount-points:
 +
 
 +
/      - file system root;
 +
/var    - log files;
 +
/usr    - user specific directories, [[ports]], etc.;
 +
/tmp    - temporary workspace;
 +
/cdrom  - physical CD-ROM drive.
 +
 
 +
These mount-points are automatically mounted when the system is started because they are stored in a file called '[[/etc/fstab]]' or '''f'''ile-'''s'''ystem '''t'''able.  The fstab file used to mount the above listed mount-points contains the following entires:
 +
 
 +
# Device                Mountpoint      FStype  Options        Dump    Pass#
 +
/dev/ad0s1b            none            swap    sw              0      0
 +
/dev/ad0s1a            /              ufs    rw              1      1
 +
/dev/ad0s1e            /tmp            ufs    rw              2      2
 +
/dev/ad0s1f            /usr            ufs    rw              2      2
 +
/dev/ad0s1d            /var            ufs    rw              2      2
 +
/dev/acd0              /cdrom          cd9660  ro,noauto      0      0
 +
 +
The mounted file systems are physical devices located under the '''/dev''' directory with the hard drive being '''ad0s1x''' and CD-ROM being '''acd0''' on this particular system.  Further details of the fstab file can be found in the [[fstab|fstab article]].
 +
 
 +
== Mount Commands ==
 +
 
 +
The mount command exists on its own a command to mount FreeBSD formatted file systems.  In order to permit the mounting of ''''foreign'''' (or non-native FreeBSD formatted) file systems each supported file system has its own mount command using the common naming scheme of 'mount_filesystem'.  The command to mount an 'MS-DOS' (or DR-DOS, FAT16 or FAT32) formatted file system the command is 'mount_msdosfs'.  The file systems available to FreeBSD and the associated mount commands are as follows:
 +
 
 +
=== mount_cd9660 ===
 +
=== mount_devfs ===
 +
=== mount_ext2fs ===
 +
=== mount_fdescfs ===
 +
=== mount_linprocfs ===
 +
=== mount_linsysfs ===
 +
=== mount_mfs ===
 +
=== mount_msdosfs ===
 +
=== mount_nfs ===
 +
=== mount_nfs4 ===
 +
=== mount_ntfs ===
 +
=== mount_nullfs ===
 +
=== mount_procfs ===
 +
=== mount_reiserfs ===
 +
=== mount_std ===
 +
=== mount_udf ===
 +
=== mount_umapfs ===
 +
=== mount_unionfs ===
 +
 
 +
== See Also ==
 +
 
 +
See also related articles: [[umount]] and [[etc/fstab]]
  
see also: [[umount]], [[etc/fstab]]
 
 
[[Category:System Commands]]
 
[[Category:System Commands]]

Revision as of 06:46, 7 May 2008

The Mediawiki system (the 'software' that runs this site) capitalises all articles. Please note that commands on most UNIX and Unix-like systems are entered in lower case. As an example the article documenting the Ln command would be issued from the command line as 'ln'.

The mount command is used to link a file system to the local host allowing access to files stored upon them. These file systems could be on physical media, such as a hard drive, CD-ROM or USB memory key, or virtual media, such as file server shares. FreeBSD has support for a large number of file systems and can write files to a majority of them.

Contents

Operation

The mounting of a file system to the local host works by creating a 'mount-point' at which the file system can then be accessed. This fits in with the Unix concept of 'everything is a file' and as such a CD-ROM drive, for example, is typically 'mounted' as /cdrom. Other file systems are typically mounted under the /mnt directory. The technical term is called 'grafting' a device to the local file system tree.

An typical installation of FreeBSD might have the following mount-points:

/       - file system root;
/var    - log files;
/usr    - user specific directories, ports, etc.;
/tmp    - temporary workspace;
/cdrom  - physical CD-ROM drive.

These mount-points are automatically mounted when the system is started because they are stored in a file called '/etc/fstab' or file-system table. The fstab file used to mount the above listed mount-points contains the following entires:

# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad0s1b             none            swap    sw              0       0
/dev/ad0s1a             /               ufs     rw              1       1
/dev/ad0s1e             /tmp            ufs     rw              2       2
/dev/ad0s1f             /usr            ufs     rw              2       2
/dev/ad0s1d             /var            ufs     rw              2       2
/dev/acd0               /cdrom          cd9660  ro,noauto       0       0

The mounted file systems are physical devices located under the /dev directory with the hard drive being ad0s1x and CD-ROM being acd0 on this particular system. Further details of the fstab file can be found in the fstab article.

Mount Commands

The mount command exists on its own a command to mount FreeBSD formatted file systems. In order to permit the mounting of 'foreign' (or non-native FreeBSD formatted) file systems each supported file system has its own mount command using the common naming scheme of 'mount_filesystem'. The command to mount an 'MS-DOS' (or DR-DOS, FAT16 or FAT32) formatted file system the command is 'mount_msdosfs'. The file systems available to FreeBSD and the associated mount commands are as follows:

mount_cd9660

mount_devfs

mount_ext2fs

mount_fdescfs

mount_linprocfs

mount_linsysfs

mount_mfs

mount_msdosfs

mount_nfs

mount_nfs4

mount_ntfs

mount_nullfs

mount_procfs

mount_reiserfs

mount_std

mount_udf

mount_umapfs

mount_unionfs

See Also

See also related articles: umount and etc/fstab

Personal tools