Linux10.9

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_45213666/article/details/102489730

Linux mount hardware
1. Partition
fdisk command : used to manage disk partitions. Format: fdisk [disk name]. It provides a set of add, delete, convert the partition functions in a "one-stop service partition." This is an interactive command.
2. Format
mkfs command: means for formatting. Format:. Mkfs disk file type device files.
3. Mount and unloading
① action is to mount the operation of hardware devices associated with the directory
② unloading operation is to remove the hardware device is associated with the directory operation, unmount the file system, it means no longer use the hardware resources of the device
mount mount device directory
-a: mount all the file systems defined in the / etc / fstab in
-t: Specifies the type of file system
to uninstall the device or directory umount
mount with the mount command, it will fail after a system reboot. To / etc / fstab file additional information in order to mount a permanent mount. In the / etc / fstab file, the format of the mount information: "device file format type mount directory permissions option if the backup is self-test."
df command : mount for viewing status and disk usage information. Common parameters for the -h. Format: df -h.

du command : Lets you view the file data footprint. Format: du [option.
Adding swap
SWAP (swap) partition is a division in advance by a certain space in the hard drive and memory will be temporarily used data temporarily stored to the hard disk in order to free up physical memory space for more active program services the use of technology, which is designed to solve the real physical memory shortage. However, due to the swap partition, after all, it is through hard disk device to read and write data, so the speed is certainly true only when the physical memory is exhausted resources will be called the swap partition slower than physical memory.
Creation of swap partitions and mount mentioned earlier and use the storage devices are very similar. In front of / dev / sdb partition storage devices operate, it is necessary to talk about the division of swap advice: In a production environment, the size of the swap partition is generally 1.5 to 2 times the true physical memory.

Capacity disk quotas
designed Linux system is to allow many people to use and perform their tasks together, thus becoming a multi-user, multi-tasking operating system. However, the hardware resources are fixed and limited, if some users continue to create a file stored on a Linux system or a movie, hard disk space will one day be filled. In view of this situation, root administrator will need to use disk space quotas to restrict the service by the user or a user group for the largest number of specific folders can be used a maximum hard disk space or file once it is no longer allowed to reach this maximum continue to use. The maximum number of files you can use the quota command disk quota management capacity, thereby limiting the available capacity of the hard disk or user can create. The quota command as well as soft and hard limits of functions.
RHEL 7 has a quota system disk capacity quotas service packages installed, but not enabled by default storage device has the support of the quota, then you need to manually edit the configuration file, so that RHEL 7 system / boot directory disk quotas technology can support quota .
1. Edit / etc / fstab file , add the parameter so that the storage device supports disk quotas technology. Early file system parameters added to usrquota parameters, and xfs file system is uquota or usrquota.
Vim / etc / fstab
...
the UUID = 9d5e3b22-75ac-4f47-9e2b-dd33a06b0f81 / XFS Boot Defaults, Add # 2. 1 uquota uquota parameter (the XFS file system, usrquota also OK)
/ dev / sdb1 / newfs ext4 Defaults, usrquota 0 0 # Add usrquota parameters (early file system-specific parameters)

2. reboot the system , use the mount command to see if the directory already supports disk quotas quota technique.

3. Set the quota disk quotas.
xfs_quota command is a specific XFS file system disk capacity to manage quota quota service designed to command in the format of "xfs_quota [parameters] file quota system."

Soft and hard way to link
the presence of soft and hard links connecting the two files in the Linux system.
Hard link (hard link): it can be understood as a "pointer points to the original inode file", the system is not allocated to a separate file and its inode. So, hard-linked files with original file is actually the same file, just different names. We each add a hard link, the file inode number of connections will increase 1; and only when the file inode number of connections is 0, considered completely delete it. In other words, due to the hard link is actually a pointer to the original file's inode, so even if the original file is deleted, you can still be accessed via a hard link files. It should be noted that, due to technical limitations, we can not cross-linked files directory partition.
Soft links (also referred to as a symbolic link [symbolic link]): contains only the pathname linked, it is possible to link the directory file, the file system may be cross linked. However, when the original file is deleted, the linked file will be broken, and from that point on Windows systems "shortcut" has the same properties.
ln command
ln command is used to create the link file, the format is "ln [options] target", as shown in its available parameters and the role of Table 6-6. When using the ln command, whether to add the -s parameter, it will create different properties of the two "shortcut."

Guess you like

Origin blog.csdn.net/weixin_45213666/article/details/102489730