Linux Mount Mount devices (U disk, CD, ISO, etc.) instructions for use

Source: Internet
Author: User

For beginners to learn, the Mount command will definitely have a lot of questions. In fact, I think the source of doubt is more about the specifics of the Linux system itself to understand the problem. Linux is based on file systems, and all devices correspond to:/dev/devices. Such as:

[[email protected] dev]$ ls | Grep-e "^ (SD|HD)"
hDC
Sda
Sda1
Sda2
Sdb
Sdb1

sd* represents SCIC HDD

Therefore, we need to mount the system when we need to access the device. So mount can actually mount those devices. We can take a look.

One, mount can be used to mount what:

Different operating systems use different file system formats. MS-DOS supports the FAT16 file system, WINDOWS98 supports FAT16, FAT32 file systems, WindowsNT supports FAT16, NTFS file systems, Windows2000 supports FAT16, FAT32, NTFS three file system formats, Now XP can support FAT32,NTFS, and now the latest version of Windows 7 introduces the new WinFS file system. Linux supports almost all file system formats, but generally uses the ext2 or ext3 file system. Many users use the Windows operating system, which is implemented with the Linux mount command if they want to access resources in other file systems under running Linux.

Second, Mount uses the format:

Mount command [-parameter] [device name] [Mount Point]

Description

[Mount point] must be a directory that already exists, this directory can not be empty, but the previous contents of the directory after the mount is not available, Umount will return to normal.

[Device name] can be a partition, a USB device, CD-ROM, floppy disk, network sharing and so on.

Common parameter Description:

Mount mount file system usage Help
Parameters Description
Common parameters:
-T Vfstype

Mount the specified device type: 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, u DF, UFS, Umsdos, VFAT, Xenix, XFS, xiafs


Generic file types, can be automatically detected without the need to specify (ADFS, BFS, Cramfs, ext, ext2, ext3, HFS, HPFS, iso9660, JFS, Minix, NTFS, qnx4, ReiserFS, Romfs, UDF, UFS, VxFS, XFS, Xiafs, and so on), if the probe fails, the/etc/filesystems will be accessed to specify the file system Measuring. Note: If you have a clear file system, it is best to specify a specific type. Detection errors are disastrous.

multiple file systems can be separated by ","
Mount-a-t nomsdos,ext 
The Fstab file will be mounted to specify all file systems except those of type Msdos and ext. &NBSP

common file Types

  1. ext2 Linux currently used file system
  2. msdos MS-DOS FAT, which is FAT16 VFAT
  3. Li>windows98 commonly used FAT32
  4. NFS Network File system
  5. smbfs Windows shared system
  6. iso9660 CD-ROM CD standard file system
  7. NTFS Windows nt/2000/xp file system
  8. Auto automatically detects the file system
-O Options Specify mount system options: Multiple options can be split with ",". Some options are only meaningful if they appear in file/etc/fstab. The following options are available for any file system to mount (but not all file systems care about them, for example, option Sync is only valid for EXT2,EXT3 and UFS today)
Options Description
Async All I/O operations to the file system must be done asynchronously.
Atime The Inode access time is updated on each access. This is the default option.
Auto Can be mounted when the-a option is used.
Defaults Includes the following options: RW, suid, dev, exec, auto, Nouser,async.
Dev Parses a character device or block device in a file system.
Exec Allow binary files to be executed
_netdev The file system resides on a device that requires network connectivity, avoiding off-grid, and constantly mounting the cost source
Noatime Do not update the file system Inode access time (increase the speed of the news server)
Noauto Can only be mounted explicitly,-a cannot make it mount
Nodev Do not parse character devices or block devices in the file system
Noexec Do not allow any binaries in the loaded file system to be executed
Nosuid Do not allow set-user-identifier or set-group-identifier bits to function
Nouser Prohibit normal mount file system (default)
Remount An attempt was made to re-mount a file system that is already mounted. Typically used to change mount marks, such as read-only mounts to be read-write.
Ro Mount in read-only mode
rw Mount in read-write mode
Suid Allow Set-user-identifier or set-group-identifier bits to function
Sync Synchronous I/O operation, sudden power loss will not drop data, but heavier disk burden
DirSync All updates to the directory within the filesystem should be done synchronously, affecting the following system calls: Creat,link, unlink, Symlink, mkdir, RmDir, Mknod and rename
User Allows the normal user to mount the file system, the user name of the mount is written to mTAB so that he can unmount the file system again. This option implies the option Noexec,nosuid, as well as the Nodev.
Users Allow each user to mount the Unmount file system
CodePage CODEPAGE=XXX code page
Iocharset Iocharset=xxx Character Set
Loop Mount Cyclotron devices often mount ISO files for
Username Username=user user name of the access device
Password Password=pass access the device's password
The following parameters are only useful for special file systems:
Uid/gid Uid=value and Gid=value Mount systems with special users and groups
Ownmask Ownmask=value Permissions Mask for owner permissions
Othmask Othmask=value Permission mask for othmask permissions
The attributes supported by different file systems are not necessarily systems. can find relevant information
-A Search the file system that satisfies the condition in the/etc/fstab file, and mount the operation.
Format: mount-a-t type-o options do not need to specify the device/directory
-F Test the Mount system, check only the devices and directories, and not actually mount the file system
-N Do not record the mounted records in the/etc/mtab file
-R Install file system as read-only, same as (-O ro)
-W Install file system as read/write, same as (-O rw)
-L Label Mount a partition with the specified volume label label
-W Install file system as read/write, same as (-O rw)
-V Show detailed Mount Progress
-L List all mounted file system lists
Other parameters:
--bind Re-attach a portion of the file hierarchy to another location. Only a single file system is attached, and if the directory has other file systems, it cannot be mounted. If you need to mount it, you can use:--rbind parameter.
Mount--bind olddir newdir 2 directories to access system content
--move Move a directory to another location, Mount--move Olddir newdir
-H Show Help
-V Show version

Three, common partition loading method:

    • mount Mount ISO file :

#mkdir/MNT/ISO1

#mount –o Loop Linuxsetup.iso/mnt/iso1

Linux does not require a virtual optical drive, you can directly read the ISO file.

    • Mount Mount Optical Drive system

Generally speaking, the CDROM device file is/DEV/HDC, using the method:

#mkdir/mnt/cdrom

#mount/dev/hdc/mnt/cdrom–o iocharset=cp936

The default optical drive system is not specified, can be automatically searched, the encoding is specified as Chinese

    • Mount Mount Floppy Drive

# Mkdir/mnt/floppy

# Mount/dev/fd0/mnt/floppy

Default file system is not specified, can be automatically searched for

    • Mount mount Windows shared file (Samba)

#mkdir/mnt/winshare

#mount-T Smbfs-o username=w,password=w,codepage=936,iocharset=gb2312//192.168.0.101/share/mnt/winshare

Specifies the user name, password, and codepage specified to access the share to the same meaning as Iocharset. The Windows system here is Simplified Chinese.

CODEPAGE specifies the code page for the file system, the Chinese code is 936;iocharset specified character set, Simplified Chinese is generally used cp936 or gb2312

    • Mount Mount U-Disk

If the computer does not have other SCSI devices and USB peripherals, the device path of the inserted USB drive is/dev/sda1, using the command:

#mkdir/mnt/upan

#mount/dev/sda1/mnt/upan

Mount it.

    • Mount Mount NFS System

Similar to Windows shared connections. The server-side NFS service needs to be configured correctly. The connection can then be viewed through the client's: Showmount-e 192.168.0.30.

Mount-t NFS 192.168.0.30:/tmp/mnt/nfs

    • Umount Uninstalling the file system

Umount dir

As above: Umout/mnt/upan or UMOUNT/DEV/SDA1

These are the instructions for using the Mount command. Where the-o parameter is the most complex. The parameters supported by each file system may vary. If a special file system is encountered. It is recommended to consult the relevant information. The next section will say, file associated with mount: Fstab format.

Linux Mount Mount devices (U disk, CD, ISO, etc.) instructions for use

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.