In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Today, I would like to share with you the relevant knowledge of what the linux mount command is. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.
In linux, mount is to use a directory as the entry point to place the data of the disk partition in that directory, and the directory of the entry point is called the mount point; simply put, the mount point is the entry directory of the disk file system in linux.
The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
Everything in Linux is saved and managed in the form of files, and hardware devices are also files, which is completely different from Windows. Windows manages hardware through device manager, and linux device files are saved in the / dev/ directory, such as hard disk files are / dev/sd [AFUP], CD files are / dev/hdc, etc. Hardware devices need to be mounted to the corresponding directory files before they can be used.
The so-called mount is to use a directory as the entry point to place the data of the disk partition under that directory, that is to say, if you enter the directory, you can read the meaning of the partition. This action is called mount. The directory of the entry point is called the mount point.
To put it simply: the mount point is actually the entry directory of the disk file system in linux.
Since the most important thing in the whole Linux system is the root directory (/), the root directory must be mounted to a partition, while other directories can be mounted to different partitions according to the user's own needs.
Common hardware device file names are as follows:
Hardware device name IDE hard disk / dev/hd [Amurd] SCSI/SATA/USB hard disk / dev/sd [Amurp]
Optical drive
/ dev/cdrom or / dev/sr0 floppy disk / dev/fd [01-1] printer (25-pin) / dev/lp [0-2] printer (USB) / dev/usb/lp [0-15] mouse / dev/mouse
The illustration shows:
As shown in the figure above, the hard disk is divided into three available partitions, of which sda1 and sda2 are mounted in the / boot and / directory, respectively, and sda3 is an extended partition that contains a logical partition sda5,sda5 mounted in the / home directory. All data under the / boot directory is stored in the sda1 partition, all data under the / home directory is stored in the sda5 partition, and the data under the root directory / (except / boot, / home) is stored in the sda2 partition.
1.sda1 represents the first partition of the first hard disk, sda2 represents the second partition of the first hard disk, sdb1 represents one partition of the second hard disk, and so on.
two。 Logical partitions must start with sda5 because sda1, sda2, sda3, and sda4 filenames are occupied by primary or extended partitions
Mount command
Mount or mount-l
Query the mounted devices in the system,-l will display the volume label name
Mount-a
Automatically mount according to the contents of the configuration file / etc/fstab
Mount [- t file system type] [- L volume label name] [- o special option] device file name mount point
-t file system: add a file system type to specify the type of mount, which can be ext3, ext4, iso9660 and other file systems
-L volume label name: Mount the partition of the specified volume label instead of mounting the device file name
-o Special options: you can specify additional options for mounting, such as read / write permissions, synchronous async, etc. If not specified, the default value takes effect. Specific special options are shown in the table below.
Manual mount
Option
Umount device file name or umount mount point
Uninstall mounted Devic
Because the device file name and mount point are connected, you can uninstall either one
Supplement (mount special option parameter description):
Special options describe atime/noatime update access time / do not update access time. When accessing a partition file, whether to update the access time of the file is updated asynchronously / synchronously by default, asynchronous auto/noauto automatically / manually by default, and whether / etc/fstab file content mount is automatically installed when the mount-a command is executed. Default is the default value of automatic defaults definition, which is equivalent to the seven options of rw,suid,dev,exec,auto,nouser,async: exec/noexec execution / no execution. Sets whether executable files are allowed to be executed in the file system. By default, exec allows remount to remount the mounted file system, which is generally used to specify special permissions for modification. Example: mount-o remount,noexec / boot remount / boot partition and use noexec permission rw/ro read-write / read-only. When mounting a file system, whether it has read-write permission? by default, rwsuid/nosuid has / does not have SUID permission; set whether the file system has the permission of SUID and SGID; by default, it has user/nouser to allow / disallow ordinary users to mount; set whether the file system allows ordinary users to mount. Default is not allowed. Only root can mount partition usrquota write on behalf of file system supports user disk quota, default does not support grpquota write on behalf of file system support group disk quota, default does not support all the contents of this article "what is linux mount command", thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.