Basic usage of Linux Mount/umount commands

Source: Internet
Author: User

Linux Mount/basic usage of the Umount command and boot auto mount format: Mount [-parameters] [Device name] [Mount Point] the commonly used parameters are:-A installation in/etc/all file systems in the Fstab file. -F pretends to mount, making a check on the device and the directory looks like, but does not really mount the file system. -N Do not record the installation in/etc/the mTAB file. -R tells the file system to be installed as read-only. -v Displays the installation information in detail. -W installs the file system as writable, which is the default for the command. -T < file system types >Specifies the file system type of the device, which is common: ext2 is the most commonly used file system for Linux msdos MS-dos fat, is FAT16 VFAT Windows98 commonly used FAT32 NFS Network File system iso9660 CD-ROM disc standard file system NTFS Windows NT/ -/XP file system Auto automatically detects the file system-O < options > Specify options for mounting the file system, some can also be written to the/etc/the fstab. Commonly used are: defaults use default values for all options (auto, Nouser, rw, suid) Auto/noauto Allow/installing dev with the –a option is not allowed/nodev pair/do not interpret special devices on the file system exec/noexec Allow/Do not allow binary code to be executed suid/nosuid Confirmation/do not confirm suid and sgid bit user/nouser Allow/do not allow general users to mount codepage=XXX code page iocharset=XXX Character Set ro read-only mount RW mount remount Reinstall installed file system loop mount "cyclotron device" and "ISO image file" It is important to note that the mount point must be a directory that already exists, and this directory may not be empty. However, the previous content in this directory will not be available after mounting, and Umount will return to normal later. Use multiple-O parameter,-o use only once, separated by commas between the parameters: # mount–o REMOUNT,RW/For example, to mount the D disk under Windows file System FAT32, which is generally the same as the Linux partition/dev/Hda5, depending on the specific zoning situation will be different, here is a hda5 to illustrate: # mkdir/mnt/hda5//Create a Hda5 directory as a mount point, and the location and directory name can be customized//# mount-t vfat/dev/hda5/mnt/Hda5 in general, Linux automatically detects the partition's file system, unless you specify it, otherwise-T VFAT can be omitted. # Mount/dev/hda5/mnt/Hda5 So you can enter/mnt/Hda5 directory to access resources in the partition. 1. Why does the partition on Mount not show Chinese file as question mark/garbled? Display a question mark indicating that there is no recognizable Chinese font in your system, please install the Chinese font first. Make sure your system is already well-displayed in Chinese. Shown as garbled is generally caused by the file system encoding used by the mount default and the actual encoding inconsistencies in the file system. To display Chinese files properly, mount requires-o the codepage and Iocharset options in the parameters. CODEPAGE specifies the code page of the file system, the Chinese code is 936;iocharset specified character set, Simplified Chinese is generally used cp936 or gb2312. # Mount–o Iocharset=gb2312 codepage=936/dev/hda5/mnt/Hda5 generally mount–o iocharset=cp936/dev/hda5/mnt/Hda5 can solve the problem. If you have problems with this, try UTF-8 Code: # mount–o Iocharset=utf8/dev/hda5/mnt/Hda52Why is the partition normal user not writable after mount up? Add –o umask on Mount= theyou can: # mount–o umask= the, iocharset=cp936/dev/hda5/mnt/Hda53Why does the file in the partition after mount go into a short file name? This is the reason why the file system hangs wrong, when the FAT32 is mounted as FAT16, this happens, first Umount, and then re-mount with –t vfat to solve the problem. # Mount–t VAT/dev/hda5/mnt/Hda54How do i mount a USB flash drive and MP3? If the computer does not have other SCSI devices and USB peripherals, the device path of the inserted USB drive is/dev/sda1, with the command: # mkdir/mnt/u# Mount/dev/sda1/mnt/u mount. 5. Can I use the ISO file directly? Yes, that's the option for Mount, which makes it possible to have a free virtual optical drive under Linux, using: # mkdir/mnt/iso# Mount–o Loop linux.iso/mnt/ISO Of course, mount the mount point after mounting/mnt/ISO is also read-only. 6. How do I automatically mount partitions on boot? It is cumbersome to enter a command of that length for each mount, as long as the partition information is written toThe/etc/fstab file can be automatically mounted for system startup, for example, for/dev/Add the following lines to the Hda5 auto mount:/dev/hda5/mnt/hda5 vfat defaults,iocharset=cp936, rw0 0 7How do i mount a samba partition? # mkdir/mnt/share# Mount-T Smbfs-o username=root,password=abc,codepage=936, iocharset=gb2312//192.168.1.100/share/mnt/shareIf the Chinese display is not normal, please try Utf-8 encoding. Of course, you can write to the fstab to implement automatic mounting. 8. Mount--What does bind mean? Mount--bind is to mount the contents of a directory to another directory, using the # Mount--bind olddir newdir This command makes it particularly convenient for you to build your own FTP to share a directory. If you want to cancel the Mount command: # mount--move Olddir Newdir. If the Mount--Bind also wants to write fstab in the words format as follows: Olddir newdir none Bind0 09Why does the Umount show device busy? This is because there is a program is accessing the device, the simplest way is to let the program to access the device to quit and then Umount. Maybe sometimes users do not clear what is the program in the access device, if the user is not anxious to umount, you can use: # Umount-l/mnt/hda5 to uninstall the device. The option –l is not immediately umount, but umount after the directory is idle. You can also use the command PS aux to see the device's program PID, and then use the command kill to kill the process of occupying the device, so umount very relieved. 

Basic usage of Linux Mount/umount commands

Related Article

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.