Tuesday, June 28

Mount Comamnd In Unix/Linux


Mount Comamnd In Unix/Linux

The Unix command line utility mount instructs the operating system that a file system is ready to use, and associates it with a particular point in the system's file system hierarchy (its mount point). The counterpart umount instructs the operating system that the file system should be disassociated from its mount point, making it no longer accessible. The mount and umount commands requireroot user privilege or the corresponding fine-grained privilege, unless the file system is defined as "user mountable" in the /etc/fstab file (which can only be modified by the root user).

Use
The second partition of a hard disk is mounted with the command
$ mount /dev/hda2 /new/subdir
and unmounted with the command:
$ umount /dev/hda2 
or 
$ umount /new/subdir
 
To list all all mounted fill systems
$ mount 
 
To remount a partition with specific options
$ mount -o remount,rw /dev/hda2
 
To Mount all file system in fstab
$ mount -a
 
Return Codes
 
       mount has the following return codes (the bits can be ORed):
 
       0      success
       1      incorrect invocation or permissions
       2      system error (out of memory, cannot fork, no more loop devices)
       4      internal mount bug or missing nfs support in mount
       8      user interrupt
       16     problems writing or locking /etc/mtab
       32     mount failure
       64     some mount succeeded
Files


       /etc/fstab         file system table
       /etc/mtab          table of mounted file systems
       /etc/mtab~         lock file
       /etc/mtab.tmp      temporary file
       /etc/filesystems   a list of filesystem types to try

No comments:

Post a Comment