Introduction to Linux Operation and Maintenance 06-04 (Management of Hard Disk Partition, Formatting and File System II)

Please indicate the source " Old Boy IT Education "
Source URL: https://www.sholdboyedu.com/new/415.html

To learn Linux operation and maintenance, you must understand core issues such as hard disk partitions. This article teaches you how to manage Linux disks and file systems, how to manage Liux disks and file systems, let's take a look!

1. Mount and unmount the file system (see linux system management P406 for details)

1) Grasp the definition of mounting: Mounting refers to attaching a device (usually a storage device) to an existing directory.

2) Master the function of the mount command: realize the mounting of the file system.

3) Flexible application of mount command to achieve file system mounting:

  For example: the command to mount the /dev/sdb1 partition to the /wg directory:

    mount /dev/sdb1 /wg

4) Master the function of the umount command: realize the unloading of the file system.

5) Flexible application of umount command to unload the file system:

  For example: the command to unmount the file system on /wg:

    umount /wg

2. The concept and setting and management of virtual memory (see linux system management P414 for details)

1) Grasp the definition of virtual memory: The so-called virtual memory is a piece of hard disk space used as memory, also known as swap.

2) Understand the type of Linux swap partition: 0x82

3) Master the function of the mkswap command: set the swap partition.

4) Grasp the usage example of using the mkswap command to set the swap partition:

For example: the command to set the partition /dev/sdb2 as the swap partition: mkswap /dev/sdb2

5) Master the function of the swapon command: start the swap partition.

6) Master the function of the swapon-a command: start all swap partitions.

7) Master the function of the swapon -s command: List the status of all system swap partitions currently in use.

8) Grasp the usage example of using swapon command:

  For example: the command to enable the swap partition /dev/sdb2: swapon /dev/sdb2

3. i node (see linux system management P170 for details)

1) Grasp the definition of i-node: i-node is actually a data structure that stores basic information about a common file, directory or other file system object.

4. Symbol (soft) link (see linux system management P174 for details)

1) Grasp the definition of a symbolic link: a symbolic link is a file that points to another file.

2) Grasp the usage example of ln command to create soft connection:

  a) To create a dog_wolf.boy symbolic link for the wolf/dog.wolf.baby file and place it in the bodydog directory:

    ln –s wolf/dog.wolf.baby bodydog/dog_ wolf.boy

5. Hard link (see linux system management P179 for details)

1) Grasp the definition of hard link: A hard link is the correspondence between a file name and an i-node. It can also be considered that a hard link is an additional path name added to the corresponding file.

2) Grasp the usage example of ln command to create hard link:

  a) Create a hard link command named wolf.dog2 in the backup directory for the wolf/wolf.dog file:

    ln wolf/wolf.dog backup/wolf.dog2

6. File types in Linux system (see linux system management P183 for details)

1) Master the common file types in Linux system:

  -: Regular file (regular file), also known as regular file.

  d: directory (directory).

  l: Symbol (soft) link.

  b: Block special file (b is the first character of block), generally refers to block devices, such as hard disks.

  c: Character special file (c is the first character of character), generally refers to a character device, such as a keyboard.

7. How to check the disk space (see P185 of Linux System Management for details)

1) Master the function of the df command: display the number of disk usage and free areas in the file system.

  -a show all disks

  -h unit conversion

2) Master the function of the du command: display the size of directories and files ah the same as above

8. Homework (65 minutes)

1) Add a 15G SCSI hard disk before starting the Linux system

2) Turn on the system, right-click on the desktop, and open the terminal

3) 为新加的硬盘分区,一个主分区大小为5G,剩余空间给扩展分区,在扩展分区上划分1个逻辑分区,大小为5G

4) 格式化主分区为ext3系统

5) 将逻辑分区设置为交换分区

6) 启用上一步的交换分区

7) 查看交换分区的状态

8) 新建目录/dir1

9) 将主分区挂载到/dir1目录

10) 查看整个磁盘的使用情况

11) 查看/分区的使用总量

12) 在root用户的家目录新建文件file1

13) 为file1创建硬链接file2

14) 为file1创建符号链接file3

15) 以长列表格式显示root用户家目录下的内容,要求显示i阶段,并比较硬链接、符号链接的i节点和原文件的关系


Guess you like

Origin blog.51cto.com/15064427/2679464