Mount Command detailed

Source: Internet
Author: User
Tags readable

Function: Loads the specified file system.

Syntax: Mount [-AFFHNRVVW] [-l< tab] [-o<] [-t< file system type [device name] [load Point]

Usage Description: Mount can load the file system specified in the specified device into the Linux directory (that is, the mount point). You can write frequently used devices to file/etc/fastab so that the system loads automatically at each startup. The Mount loading device information is recorded in the/etc/mtab file. When you uninstall a device by using the Umount command, the record is cleared.

-A loads all devices set in the file/etc/fstab.

-F does not physically load the device. Can be used at the same time as-V to view the execution of the mount.

-F must be used with the-a parameter. All devices set in/etc/fstab are loaded at the same time to speed up execution.

-H displays online help information.

-l< tags > load file system tags for < tags > devices.

-N does not record the load information in the/etc/mtab file.

-o< Options > Specifies the options for loading the file system. Some options can also be used in/etc/fstab. These options include:

Async performs the input and output actions of the file system in an asynchronous manner.

Atime Each access updates the Inode's access time, the default setting, and the cancellation option is noatime.

Auto must specify this option in the/etc/fstab file. When the-a parameter is executed, the device set to Auto is loaded and deselected as Noauto.

Defaults use the default option. The default options are RW, suid, dev, exec, Anto Nouser, and async.

A character or block device on the dev readable file system, and the cancellation option is Nodev.

exec executable binary, cancel option is noexec.

Noatime does not update the access time of the inode each time it is accessed.

Noauto cannot be loaded with the-a parameter.

Nodev does not read characters or block devices on the file system.

Noexec cannot execute binary files.

Nosuid Turn off Set-user-identifier (set User ID) and Set-group-identifer (set group ID) set bit.

Nouser makes a user unable to perform the load operation, the default setting.

Remount Reload the device. Typically used to change the setting state of a device.

RO is loaded in read-only mode.

RW is loaded in readable and writable mode.

Suid start Set-user-identifier (set User ID) and Set-group-identifer (set group ID) Set bit, cancel option is nosuid.

Sync performs the input and output actions of the file system synchronously.

User can let the general user load the device.


-R loads the device in read-only mode.

-t< File System Type > Specifies the file system type of the device. The common options are:
Minix Linux is the first file system to use.

Ext2 Linux's current common file system.
Msdos MS-DOS FAT.

VFAT Win85/98 's VFAT.
NFS Network File System.

Standard file system for iso9660 CD-ROM discs.
File system for NTFS Windows NT.

HPFS OS/2 file System. A previous version of the file system for Windows NT 3.51.
Auto automatically detects file system.

-V displays detailed information when executing.
-V Displays version information.

-W Loads the device in read-write mode, the default setting.


One. To hook up a disc image file

1. Make CD-ROM image files from CD-ROM. Put the CD into the CD drive, and execute the following command

#dd If=/dev/cdrom Of=/home/sunky/mydisk.iso

2, the files and directories made into a CD-ROM image files, execute the following command

#mkisofs-R-j-v Mydisk-o/home/sunky/mydisk.iso/home/sunky/mydir

3, CD-ROM image file Hook (mount)
#mkdir/mnt/vcdrom
Note: Create a directory for hanging contacts (mount point)

#mount-O loop-t iso9660/home/sunky/mydisk.iso/mnt/vcdrom
Note: Use/mnt/vcdrom to access all files in the disk image file Mydisk.iso

Two. Hook up a mobile hard disk for Linux systems, the USB interface's removable hard disk is treated as a SCSI device. Before inserting a removable hard drive, you should first use the Fdisk–l

Or More/proc/partitions view the system's hard disk and hard drive partitions.

#mount-T NTFS/DEV/SDC1/MNT/USBHD1

#mount-T VFAT/DEV/SDC5/MNT/USBHD2
Note: Disk partitions in NTFS format should use the-T NTFS parameter, and the-T VFAT parameter should be used for disk partitions in FAT32 format.

If the Chinese character file name appears garbled or does not display, you can use the following command format.

#mount-T Ntfs-o iocharset=cp936/dev/sdc1/mnt/usbhd1
#mount-T Vfat-o iocharset=cp936/dev/sdc5/mnt/usbhd2

The use of the Fdisk partitioning command and the Mkfs file system creation command under Linux system makes the partition of the removable hard disk a Linux system special

Some ext2, ext3 format. In this way, it is more convenient to use Linux. Use the following command to hook up directly.

#mount/DEV/SDC1/MNT/USBHD1

On the mount, the partition under Windows automatically hangs Windows D disk onto the/mnt/d and opens/etc/fstab with VI,

Add the following line:
/dev/hda5/mnt/d vfat defaults,codepage=936,iocharset=cp936 0 0
Note that you first have to manually create a/mnt/d directory

A directory shared by other Windows machines on the Mount Lan (BJCHENXU)
Mount-t Smbfs-o username=guest,password=guest//machine/path/mnt/cdrom

Three. Hook up u disk

As with the USB interface of the mobile hard disk on the Linux system as a USB disk is treated as a SCSI device. Using the method and moving the hard drive completely

The same. Before inserting a U disk, you should use Fdisk–l or more/proc/partitions to view the system's hard disk and hard disk partitions.

Insert a U disk, then use Fdisk–l or more/proc/partitions to view the system's hard disk and hard disk partitions.

[Root at Pldyrouter root]# fdisk-l
disk/dev/sda:73 Dot 4 GB, 73407820800 bytes
255 heads, Sectors/track, 8924 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/SDA1 1 4 32098+ de Dell Utility
/DEV/SDA2 * 5 2554 20482875 7 Hpfs/ntfs
/dev/sda3 2555 7904 42973875 Linux
/DEV/SDA4 7905 8924 8193150 f Win95 Ext ' d (LBA)
/dev/sda5 7905 8924 8193118+ Linux Swap
disk/dev/sdd:131 MB, 131072000 bytes
9 Heads, Sectors/track, 888 cylinders
Units = Cylinders of 147456 bytes
Device Boot Start End Blocks Id System
/DEV/SDD1 * 1 889 127983+ b Win95 FAT32
Partition 1 has different physical/logical endings:
phys= (1000, 8) logical= (888, 7, 31)
The system has a SCSI hard drive/DEV/SDD and a disk partition/dev/sdd1,/dev/sdd1 is the U disk we want to hook up.

#mkdir-P/MNT/USB
Note: Create a directory for hanging contacts (mount point)

#mount-T Vfat/dev/sdd1/mnt/usb

Note: Now you can access the U disk by/mnt/usb, if the Chinese character file name is garbled or not displayed, you can use the following command.
#mount-T Vfat-o iocharset=cp936/dev/sdd1/mnt/usb

Four. Hook up Windows file sharing

The core of Windows network sharing is smb/cifs, where you must install and use the Samba package to connect (mount) Windows disk sharing under Linux. Most popular Linux distributions now contain samba packages, and if you install the Linux system without samba, install Samba first. Of course, can also be downloaded to the www.samba.org website ... The new version is the 3.0.10 version.

When Windows system sharing is set up, you can hook up the Linux client (mount), as follows:

# Mkdir–p/mnt/samba
Note: Create a directory for hanging contacts (mount point)

# mount-t Smbfs-o &nbs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.