In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Cloud Computing Learning Route syllabus Courseware: Mount mounting details:
=
Detailed explanation of common mounting options
Mount device files, volume labels, UUID
ISO file creation and mount
Mount option-t file system type-o option 1, option 2.
Example:
Mount-t ext4-o acl / dev/sdb1 / mnt/disk1
File system type: vfat,ext4,xfs,nfs,cifs,iso9660,loop
Example 1:exec/noexec
[root@tianyun ~] # mount / dev/vg01/lv01 / mnt/lv01
[root@tianyun] # mount-o noexec / dev/vg01/lv02 / mnt/lv02
[root@tianyun ~] # cp-rf / bin/date / mnt/lv01
[root@tianyun ~] # cp-rf / bin/date / mnt/lv02
[root@tianyun ~] # / mnt/lv01/date
Fri Jan 10 10:40:21 CST 2019
[root@tianyun ~] # / mnt/lv02/date
-bash: / mnt/lv02/date: Permission denied
[root@tianyun ~] # mount
/ dev/mapper/vg01-lv01 on / mnt/lv01 type ext4 (rw)
/ dev/mapper/vg01-lv02 on / mnt/lv02 type ext4 (rw,noexec)
If no option is specified, the default option man mount
Defaults
Use default options: rw, suid, dev, exec, auto, nouser, and async.
Common mount options
Rw read and write
Ro read-only
Suid supports suid
Dev supports device files
Nodev does not support device files
Noexec does not allow binary files to be executed
Exec allows binary files to be executed
Auto mount-an auto mount on boot
Noauto mount-a does not mount automatically when it is powered on
Async asynchronous write
Sync synchronization and synchronization
Usrquota supports user-level disk quotas
Grpquota supports group-level disk quotas
Acl supports facl function
Remount online remount
Pri specifies priority
=
Relatime drive access optimization
The POSIX standard requires the operating system to maintain and record the file system metadata that each file last accessed. This timestamp is called atime
Maintaining it requires a duplicate write operation to the storage. These write operations keep the storage device and its connections busy and powered on. Because of
Since few applications use atim e data, this storage device activity is a waste of power. Especially if it is not read from the storage
The file also has an event that is written to the store, but written from the buffer. Sometimes the Linux kernel also supports the noatime option of mount, and
Do not write atime on a file system mounted with this option. But it is problematic to just turn off this feature, because some applications depend on the
Depends on atime data and fails if this data is not available.
This is another alternative to the kernel used by Red Hat Enterprise Linux 6-relatime. Relatime maintains atime data, but not
Changes each time the file is accessed. Enable this option to modify the file only after the last update of atime (mtime), or for the last time
Accessing this file does not write atime data to disk until quite a long time ago (the default is one day).
By default, relatime is enabled for all file systems that are now mounted. To restrict this feature throughout the system, use the boot parameter
Count default_relatime=0. If relatime is enabled on a system by default, you can use the option norelatime
Mount a system to limit its use in a specific file system. Finally, you want the system to update the default period of the atime data for the file
Different, use the relatime_interval= boot parameter to specify the period in seconds. The default value is 86400.
Note: when RHEL6 starts relatime,atime delay modification, one of the conditions must be met:
86400 seconds since the last atime modification
When a write operation occurs
=
Example 2: avatar async Sync
[root@tianyun ~] # mount / dev/vg01/lv01 / mnt/lv01
[root@tianyun] # mount-o sync / dev/vg01/lv02 / mnt/lv02
[root@tianyun ~] # mount
/ dev/mapper/vg01-lv01 on / mnt/lv01 type ext4 (rw)
/ dev/mapper/vg01-lv02 on / mnt/lv02 type ext4 (rw,sync)
[root@tianyun ~] # time cp-rf / etc / mnt/lv01
[root@tianyun ~] # time cp-rf / etc / mnt/lv02
Can be used when mounting (for basic partitions)
Device name / dev/sda3
Volume label LABEL=yang
UUID UUID= "353a34b8-9233-465c-b7cf-92c8d308c05b"
UDEV can create an alias for the device
Example 3: mounting with volume label
[root@localhost ~] # tune2fs-l / dev/vda1 | less
Filesystem volume name:
[root@tianyun ~] # tune2fs-L yang / dev/sda3 / / set volume label LABEL
Tune2fs 1.39 (29-May-2006)
[root@tianyun ~] # vim / etc/fstab
LABEL=yang / mnt/disk1 ext4 defaults 0 0
Example 4: mounting using UUID
[root@tianyun ~] # blkid / dev/sda5
Dev/sda5: UUID= "353a34b8-9233-465c-b7cf-92c8d308c05b" SEC_TYPE= "ext2" TYPE= "ext3"
[root@tianyun ~] # vim / etc/fstab
UUID= "353a34b8-9233-465c-b7cf-92c8d308c05b" / mnt/disk1 ext4 defaults 0 0
UUID= "cf0d4159-f8ea-4fc4-93a3-cb249ad95ed0" / mnt/lv1 xfs defaults 0 0 does not backup and does not detect
1. This is used to specify the device name or block information of the file system you want to mount, or it can be a remote file system
2 、 . Mount point, that is, to find or create a dir (directory)
3 、 . This is used to specify the type of file system.
4 、 . This is used to fill in the setting options, which are separated by commas. Because there are so many options, and the space here is limited, I won't go into more detail. If you need to know, please check it with the command man mount.
Default setting defaults
5 . If it is 1 here, it means to back up the contents of the whole file; if it is 0, it means it is not backed up. The tool dump is rarely used now, and it is generally chosen to be 0 here.
6 、 . This is used to specify how to use fsck to check the hard drive. If you fill in 0 here, it will not be checked; if the mount point is / (that is, the root partition), you must enter 1 here, and nothing else can be filled in 1. If there is a partition that is greater than 1, after checking the root partition, then check the number from small to large. Check the same number at the same time. For example, if the first and second partitions fill in 2, and the third and fourth partitions fill in 3, the system checks the root partition, then checks the first and second partitions at the same time, and then checks the third and fourth partitions at the same time.
Mount the ISO file
Make the CD into iso
[root@tianyun ~] # dd if=/dev/cdrom of=/centos7u3.iso
[root@tianyun ~] # dd / centos7u3.iso
Make the file into iso, for example, / etc into etc.iso
[root@tianyun] # genisoimage-o / tmp/etc.iso-r / etc
[root@tianyun ~] # file / tmp/etc.iso
/ var/etc.iso: ISO 9660 CD-ROM filesystem data 'CDROM'
Using iso, mount
[root@tianyun] # mount-t iso9660-o loop / tmp/etc.iso / mnt/iso/
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: 236
*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.