How Linux systems Mount external devices

Source: Internet
Author: User
Tags manual readable

Linux system is a command-line system, this is a well-known thing, regardless of any operation requires the corresponding command to execute, so users want to mount the CD-ROM, u disk or floppy drive, need to find the corresponding command, so the best way is to find the highest command, In this way, no matter how the computer operation can be arbitrary implementation. The topic that I want to discuss with you today is how to mount an external device on a Linux system, what you may not know is that there are automatic mount and manual mount two, can achieve the same effect, but the way of operation is different, the following by small series for everyone to explain the specific steps of the operation!

Mount-t Iso9660/dev/cdrom/mnt/cdrom Hanging Optical Drive

MOUNT-T vfat/dev/fd0/mnt/floppy Floppy drive (file type can be selected)

Mount-t Vfat-o Rw,utf8,umask=000/dev/sda1/media/usb

The Linux system's default mounted Windows partition is not displayed properly in Chinese. The Chinese in the optical drive is also not displayed properly. The workaround is as follows:

1 Automatic Mount

Modify/etc/fstab to increase Iocharset=utf8 in mount parameters

Examples are as follows:

/dev/sda5/media/sda5 vfat iocharset=utf8,defaults,umask=0 0 0

/dev/hda/media/cdrom0 udf,iso9660 User,noauto,iocharset=utf8 0 0

Mine is a SATA hard drive. /dev/sda5 is a partition of the hard disk. /dev/hda is the optical drive. where "umask=0" means that ordinary users also have read and write permission.

2 manual Mount

When mount, add parameter-o Iocharset=utf8

Examples are as follows:

$ sudo mount-o iocharser=utf8/dev/sdb1/media/usb

Mount Command detailed

Function: Loads the specified file system.

Syntax: Mount [-AFFHNRVVW] [-l tab] [-o option] [-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 a file

/etc/fastab to allow the system to load automatically each time it starts. 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.

Common parameters and options:

-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 the device labeled "tags" in the file system.

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

The-o option 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.

Simple usage:

FAT32 of the partition

Mount-o Codepage=936,iocharset=cp936/dev/hda7/mnt/cdrom (mount-t

Vfat-o Iocharset=cp936/dev/hda7/mnt/cdrom)

Partitions of NTFS

Mount-o Iocharset=cp936/dev/hda7/mnt/cdrom

ISO file

Mount-o Loop/abc.iso/mnt/cdrom

Floppy disk

Mount/dev/fd0/mnt/floppy

USB Flash

Mount/dev/sda1/mnt/cdrom Description:/mnt/cdrom directory must exist

All/etc/fstab content Mount-a

You can specify the file format "-t format", which can be vfat, ext2, ext3, and so on.

Mirrored file:

Mount FileName Mountpoint-o

The loop,filename is a mirrored filename (*.iso,*.img), and the rest is not to mention the same as above. Use case: If I have a a.iso CD image file, Mount

A.iso A-o Loop so that you can browse A.iso content by entering directory A, *.img file usage.

Show Chinese, if it is Fedora Core 1, use UTF8 better

Mount-o iocharset=uft8/dev/hda1/mnt/c

Mount-o Iocharset=uft8/dev/sda1/mnt/usb

Mount-t Smbfs//ip_addr/share/dir/mnt/smb/share-o

Iocharset=uft8,username=name, PASSWORD=PASSWD

On the boot, mount the partition under Windows

Automatically hook up Windows D disk to/mnt/d, open/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

The above two methods can be implemented in the Linux system plug-in devices, these two methods are relatively good operation! So whether you are a USB stick or a floppy disk can use this method Oh! Want to try the friends to quickly operate it!

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.