Linux Mount File System __linux

Source: Internet
Author: User
1. The mount point must be a directory.

2. A partition is mounted on an existing directory, which may not be empty, but the previous contents of this directory will not be available when it is mounted.
This is also true for the mounting of file systems built by other operating systems. However, it should be understood that the format of the file system used by the CD, floppy disk, and other operating systems is different from the file system format used by Linux. The disc is ISO9660, the floppy disk is FAT16 or Ext2;windows NT is FAT16, NTFS;WINDOWS98 is FAT16, fat32;windows2000, and Windows XP are FAT16, FAT32, NTFS. Before you mount, see if Linux supports the file system format you want to mount.


Use Mount command when mounting:
Format: Mount [-parameters] [device name] [Mount Point]

Some of the commonly used parameters are
-t< File System Type > Specifies the file system type of the device, which is common:
Minix Linux The earliest file system used
Ext2 Linux currently used in the file system
Msdos MS-DOS FAT is the FAT16
The common FAT32 of VFAT Windows98
NFS Network File System
ISO9660 CD-ROM standard file system
File systems for NTFS Windows NT 2000
HPFS OS/2 File System
Auto Auto Detect file system
-o< Options > Specify options for mounting file systems. Some can also be used in/etc/fstab. Commonly used to have
CODEPAGE=XXX code page
Iocharset=xxx Character Set
RO is mounted as read-only
RW mounts in read-write mode
Nouser makes it impossible for general users to Mount
User can mount devices for general users

As a reminder, the Mount command does not have the capability to mount the point, so you should make sure that the mount point already exists when you execute the load command. (Don't understand.) The point is that you have to mount the file system, first of all to build a directory. That's OK. )

Example: Windows98 is mounted on the HDA1 partition, and there are floppy disks and discs on the computer that need to be mounted.
# Mk/mnt/winc
# Mk/mnt/floppy
# Mk/mnt/cdrom
# mount-t Vfat/dev/hda1/mnt/winc
# mount-t Msdos/dev/fd0/mnt/floppy
# mount-t Iso9660/dev/cdrom/mnt/cdrom
You can now access the/MNT/WINC and other directories to read and write these file systems.

To ensure that the last two lines of command are not faulted, make sure that there is a disk in the floppy drive and CD drive. (If disk slices of hard disk can be changed often at any time, I think I will not make such a mistake:->)
If you have a Chinese file name in your Windows98 directory, use the command above to mount a stack of garbled characters. This will use the CodePage iocharset option in the-o argument. CODEPAGE specifies the code page for the file system, the Simplified Chinese code is 936;iocharset the specified character set, and the Simplified Chinese is generally cp936 or gb2312.


When the mounted file system Linux is not supported, mount a certain error, such as the Windows2000 NTFS file system. You can recompile the Linux kernel to gain support for the filesystem. About recompiling the Linux kernel, it's not here to say.

Four, automatic mount
It is obviously too cumbersome to run the Mount command on every boot access windows partition, why not use the Mount command to access other Linux partitions.
In fact, every time the boot, Linux automatically will need to mount the Linux partition mount. So is it possible to configure Linux to mount the partitions that we want to mount, such as Windows partitions, to enable the file system to mount automatically when it is started?
This is perfectly possible. There is a fstab file in the/etc directory that lists the file systems that are automatically mounted when Linux is powered on. My/etc/fstab file is as follows:

/DEV/HDA2/EXT3 Defaults 1 1
/dev/hda1/boot ext3 Defaults 1 2
None/dev/pts devpts gid=5,mode=620 0 0
NONE/PROC proc Defaults 0 0
NONE/DEV/SHM TMPFS Defaults 0 0
/dev/hda3 Swap Defaults 0 0
/dev/cdrom/mnt/cdrom iso9660 noauto,codepage=936,iocharset=gb2312 0 0
/dev/fd0/mnt/floppy Auto Noauto,owner,kudzu 0 0
/dev/hdb1/mnt/winc vfat defaults,codepage=936,iocharset=cp936 0 0
/dev/hda5/mnt/wind vfat defaults,codepage=936,iocharset=cp936 0 0


In the/etc/fstab file, the first column is the device name of the mounted file system, the second column is the mount point, the third column is the mounted file system type, the fourth column is the mounted option, and the options are separated by commas. The 56th column does not know is what meaning, also hope master advice.

In the last two lines I manually added the c;d disk under Windows, adding codepage=936 and iocharset=cp936 parameters to support the Chinese filename. The parameter defaults actually contains a set of default parameters:

RW mounts in readable and writable mode
SUID Open User ID and group ID settings bit
Dev can interpret character or block devices on a file system
EXEC executable binaries
Auto Mount automatically
Nouser makes it impossible for general users to Mount
Async performs an input-output operation of the file system in a unsynchronized manner

As you can see in this list, the optical drive and floppy drive are not mounted automatically, and the parameters are set to Noauto. (If you want to set up automatic mount, you want to make sure that every time you turn on the CD-ROM and floppy drive must have a disk, hehe.) )

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.