Mount


From Linuxconfig.org

Jump to: navigation, search

.. back to the list of Linux Commands

Name

mount - mount a file system

Synopsis - man page

mount [-lhV]

mount -a [-fFnrsvw] [-t vfstype] [-O optlist]
mount [-fnrsvw] [-o options [,...]] device | dir
mount [-fnrsvw] [-t vfstype] [-o options] device dir

Frequently used options

-t     vfstype The  argument following the -t is used to indicate the file system type.  
The file system types which are  currently  supported include:  
adfs,  affs,  autofs,  coda, coherent, cramfs, devpts,
efs, ext, ext2, ext3, hfs, hpfs,  iso9660,  jfs,  minix,  msdos,
ncpfs,  nfs,  nfs4,  ntfs,  proc,  qnx4, ramfs, reiserfs, romfs,
smbfs, sysv, tmpfs, udf, ufs, umsdos, usbfs, vfat,  xenix,  xfs,
xiafs.
-o     Options are specified with a -o flag followed by a  comma  separated  string of options.

Examples

Check your partitions with command:

fdisk -l

Lets mount our /dev/sdb1 disk partition with ext3 filesystem to mount point /mnt/sdb1:

mkdir /mnt/sdb1
mount -t ext3 /dev/sdb1 /mnt/sdb1

Image:mount.gif

we can now use -o remount option to remount it with read only permitions only:

mount -o remount,ro /dev/sdb1

Image:remount.gif

To mount it back with read & write permitions:

mount -o remount,rw /dev/sdb1

Image:remount_rw.gif

With mount command we can mount all kinds of filesystem. For example to mount ISO image we can do:

mount -t iso9660 myiso.iso /mnt/cdrom -o loop

ISO image is now available from /mnt/cdrom direcotry.

.. back to the list of Linux Commands

Personal tools