Experimental project:
1 Mastering methods for managing Linux disks and Partitions 2 mastering methods for mounting and uninstalling file Systems 3 Mastering how to create and manage LVM partitions
Theoretical part:
A: Introduction to disks and partitions
1 Representation of disk partitions: Common hard disks can be divided into primary partitions, extended partitions, and logical partitions. Typically there are only 4 primary partitions, and the extended partition is considered a special primary partition type, and logical partitioning can be established in the extended partition
2 The current drive is a SCSI hard disk, so here is the structure of the SCSI hard disk partition. The hard drive representation of the SCSI interface is: The first SCSI drive we can represent as "SDA" and the second SCSI drive as "SDB". And so on are "SDC", "SDD", "SDE", respectively.
3 Now speaking of the hard disk, with the hard disk will think of the hard disk partition, then look at the Linux SCSI interface of the hard disk partition should be how to express. The first primary partition of the first disk should be "sda1", and the first two primary partitions should be "sda2", and so on.
4 It is important to note that there are 4 primary partitions, and the extended partition is considered a special primary partition, and the logical partition is built on the extended partition. Therefore, the first logical partition is represented by "Sda5", followed by and so on.
5 partition is complete, next we should know the type of file system used in Linux. Here are the first two types of:
1 "EXT4 Type: 4th generation Extended File System (default file system used by Linux system) id:83
2 Swap Type: Swap file system (used to create a swap partition for a Linux system, equivalent to virtual memory), the recommended size is 1.5-twice times the physical memory
id:82
Second: Master mount, unmount file system
1 in Linux, we need to partition, format and mount a new disk. These 3 steps can be used on the disk and, of course, an uninstall after the last one is not used.
2 when a partition is mounted, it must be assigned a directory as the anchor point (called the mount point) where the user accesses the files and data in the device through this directory.
3 When uninstalling the file system, you can uninstall the mount point or file device. Uninstalling mount points is recommended because file devices can be mounted to multiple directories
III: Create a Management LVM logical volume (id:8e)
1在安装系统时,如何确定分配磁盘的容量,如果估计不准确,那么就会导致删除一些数据或者重装系统来获得容量。那么通过 对LVM的了解后,就会掌握动态调整LVM逻辑卷管理。
2 is the basic concept of the LVM mechanism, such as:
3 below we look at some of the LVM management commands, such as:
Experiment:
1 in the above, we understand the partition, mount and LVM logical volume management, let's do a bit from partition, format, Mount (or Auto-mount) to LVM logical volume management. First we open the Linux system in the VM virtual machine and add a few hard drives inside and then restart the Linux system. For example:
2 Next we want to create a partition for the newly added hard disk, using the command fdisk/dev/sdb such as:
3 below will configure the disk, such as the size of the disk, partition number, type. For example:
4 partition is complete, but I can make LVM logical volume here, so we need to convert the format, that is, modify the ID. For example:
5 The first disk SDB is partitioned, and the same is true for SDC. When both disks are ready, we will first make the two disks into physical volumes. For example,
6 completes the physical volume, then you need to merge the physical volume into a volume group, with the command: Vgcreate vg1/dev/sdb1/dev/sdc1 such as:
7 Now that the volume group has been built, then it is time to allocate the required capacity, Made into logical volumes (LV). 2 logical volumes are made here. For example:
8 Here The disk is allocated for completion, including the type of disk. The next step should be to format the disk. such as:
9 disk partitioning, formatting, mounting. In these three steps we complete 2 steps, so next we will mount, first we need to create a directory to mount. For example:
10 is now complete, you can use the Df-h command to see if the mount succeeds. Success means that this logical volume is available. For example:
11 Here is another point is mount this command is temporarily mounted, when rebooting the system will not be hung up, then want to permanently take effect will need to modify/etc/fstab this file. The mount-a (equivalent to a flush mount) can be permanently enforced. For example:
12 is successfully mounted and the experiment is closed.
Summarize:
1 Adding a disk requires 3 steps: partition, format, mount.
2 to make a logical volume (LV): First do the physical volume next do the volume group and then split from the volume group you want the capacity of the big down
3 mount requires a mount point to be created, but if you want to mount it permanently, you have to modify the/etc/fstab configuration file
4 Understanding the representation of a disk partition sda1 Sda2 Sda3
SDB1 SDB2 SDB3
The 5 swap type is the swap file system, which is 1.5 times times-twice times the size of the physical memory. function equivalent to virtual memory
6 know the ID of the device file type example: Swap (EXT4) LVM (8e)
Linux disk partitioning, permanently mounting, creating LVM logical volumes