Common Linux devices and corresponding/dev/xxx file names, mount point, Mount points, Mount commands, fstab, Mount partitions

Source: Internet
Author: User

There are 2 types of devices in Linux: Character devices (unbuffered and can only be accessed sequentially), block devices (buffered and randomly accessible). Some of these devices are abstractions of physical hardware that actually exist, while others are the functionality provided by the kernel itself (independent of specific physical hardware, also known as "virtual devices"). Each device has a corresponding file (node) in the/dev directory.
common devices and file names under the corresponding/dev/:

    • /dev/usb/hiddev0 | /DEV/USB/HIDDEV1---USB character device (mouse/keyboard/joystick/handwritten version, etc for computer-operated devices)
    • /dev/uba | /dev/ubb---USB block device (USB stick, etc.)
    • /DEV/SDA | /DEV/SDB---nth SCSI disk (entire disk)
    • /dev/hda | /DEV/HDB---nth IDE disk (entire disk)
    • /DEV/SDC1 | /DEV/SDC2---The nth partition linux/i386 of the 3rd SCSI disk, Partition 1-4 is the primary partition and 5-15 is the logical partition.
    • /dev/scd0 | /DEV/SCD1---nth SCSI CD-ROM
    • /dev/tty0 | /dev/tty1---Current Virtual Console, nth Virtual Console TTY (terminal) device


Linux system mount point: Mount when the target folder for Mount/media/cdrom to be created manually
Mount/dev/cdrom/media/cdrom

Enter the mount command without parameters to display the file system that is already mounted

mount command: mount (Mount) disc image file, removable hard disk, USB drive, and Windows network Share and UNIX NFS network share
Command format: Mount [-t vfstype] [-O options] Device dir
which
1.-t vfstype Specifies the type of file system that is not normally specified. Mount will automatically select the correct type. Common types are:

    • Disc or disc Image: iso9660
    • DOS FAT16 file system: MSDOS
    • Windows 9x FAT32 file system: VFAT
    • Windows NT NTFS file system: NTFS
    • Mount Windows file network share: SMBFS
    • UNIX (LINUX) file network share: NFS


The 2.-o options are primarily used to describe the way devices or files are hooked up. The commonly used parameters are:

    • Loop: Used to attach a file as a hard disk partition on the system
    • RO: Hook device with read-only method
    • RW: Mount device with read-write mode
    • Iocharset: Specifies the character set used to access the file system


3.device the device to mount (Mount).
Mount point of the 4.dir device on the system.

/etc/fstab:

This file is the individual partitions that need to be mounted when the system starts.

    • The first column is the label of the partition;
    • The second column is the mount point;
    • The third column is the format of the partition;
    • The fourth column is mount of some of the mount parameters, and so on will be described in detail what parameters, under normal circumstances, directly write defaults can;
    • The number in the fifth column indicates whether the dump was backed up, so this is 1, otherwise it is 0;
    • The sixth column is whether the self-test disk is turned on, which is the fsck test that I just talked about. All means detection, 0 means no detection, in the Redhat, this is also a statement,/partition must be set to 1, and the entire fstab only allow a 1, there is a priority to say. 1:2 priority high, so first detect 1, and then detect 2, if there are multiple partitions need to boot detection then all set to 2 bar, 1 testing will be at the same time to detect 2. Here are the parameters that are commonly used in the fourth column.

    • Async/sync:async indicates that it is not synchronized with the disk and memory, and the system writes the memory data to disk at intervals, while sync synchronizes the memory and disk data at all times;
    • Auto/noauto: Boot automatically mounted/not automatically mounted;
    • Default: Set the mount definition according to the default value of most permanent file system, it contains RW, suid, dev, exec, auto, Nouser,async;
    • RO: Mount by read-only permission;
    • RW: Mount According to readable writable permission;
    • Exec/noexec: Allow/Do not allow executable file execution, but do not mount the root partition as NOEXEC, then can not use the system, even mount command can not be used, at this time only to re-do the system;
    • User/nouser: Allow/Do not allow other users to mount the partition outside the root, for security purposes, please use nouser;
    • Suid/nosuid: Allow/Disallow partition has suid attribute, general setting nosuid;
    • Usrquota: Start Consumer disk quota mode, disk quota related content in the following chapters will be introduced;
    • Grquota: Start the group disk quota mode;


After learning this/etc/fstab, we can modify the file ourselves, adding a line to mount the new partition. For example, the author adds such a line
/dev/hdb1/test1 ext3 defaults 0 0
Then the system reboots and mounts the partition, or runs the mount-a directly to mount the line you added, so you don't have to restart it.

Common Linux devices and corresponding/dev/xxx file names, mount point, Mount points, Mount commands, fstab, Mount partitions

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.