Linux operation and maintenance tutorial 06-03 (hard disk partition, format and file system management 1)

Please indicate the source " Old Boy IT Education "
Source URL: https://www.sholdboyedu.com/new/407.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. Correspondence between hardware devices and file names (see linux system management P297 for details)

1) In the Linux system, each device is treated by a file at the beginning.

2) Master the file names of various devices in Linux

2. Hard disk structure and hard disk partition (see linux system management P301 for details)

1) Understand why you need to partition the hard disk:

  a) It is easier to manage and control the system because the related files and directories are placed in one partition.

  b) The system is more efficient.

  c) You can limit the user's share of the hard disk (the size of the disk space).

  d) Easier to backup and restore.

2) Master the logical structure of the hard disk:

  A hard disk can be logically divided into blocks, tracks, cylinders, and partitions.

3) Master the definition of a block: A block is the smallest unit of addressing (access) on the disc, and a block can store a certain byte of data.

4) Grasp the definition of a track: a track is a circle composed of a series of blocks connected end to end.

5) Grasp the definition of a magnetic cylinder: a magnetic cylinder is a stack of tracks composed of tracks on each disk surface on the same radius.

6) Grasp the definition of partition: a partition is composed of a group of adjacent magnetic cylinders.

3. The partition of the hard disk in the Linux system (see linux system management P303 for details)

1) Master the classification of hard disk partitions: Hard disk partitions can be divided into primary partition, extended partition and logical partition.

2) Master the number of primary partitions: up to 4 primary partitions can be divided on a hard disk.

3) Understand that the number of partitions on each hard disk supported by the kernel of the Linux operating system is still limited. The Linux kernel can support at most on each hard disk:

  a) Divide 15 partitions (Partitions) on the SCSI hard disk.

  b) Divide 63 partitions (Partitions) on the IDE hard disk.

4. Use fdisk and partprobe commands to manage hard disk partitions (see linux system management P394 for details)

1) Master the function of the fdisk command: create disk partitions.

2) Master the commonly used commands in the fdisk command list:

  a) d: Delete a (already existing) partition, where d is the first letter of delete.

  b) l: List the types of (already existing) partitions, where l is the first letter of the list.

  c) m: List all commands used in fdisk, where m is the first letter of menu.

  d) n: Add a new partition, where n is the first letter of new.

  e) p: List the contents of the partition table, where p is the first letter of print.

  f) q: Quit fdisk, but do not store the changes made, where q is the first letter of quit.

  g) t: Change the id of the partition system, where t is the first letter of the title.

  h) w: Exit fdisk and store the changes, where w is the first letter of write.

3) Master the function of the partprobe command: reinitialize the partition table of the kernel in the memory.

5. Create a file system (data management) (see linux system management P399 for details)

1) Grasp the definition of formatting: The so-called formatting is to divide the hard disk space in the partition into blocks of equal size, and set how many i-nodes in this partition can be used, etc.

2) Grasp the definition of file system: File system is the method and data structure used by the operating system to clarify the files on the disk or partition; that is, the method of organizing files on the disk.

3) Understand commonly used file system types

  ext2: standard file system in Linux system

  ext3: a journaled file system

  ext4: an extended journal file system for ext3 system

  lvm: Logical volume management

  iso9660: Currently the only universal CD file system

4) Master the function of the mkfs command: format the disk.

5) Flexible application of commonly used formatting commands:

  mkfs. file system type

    For example, the command to format the partition /dev/sdb1 as an ext4 file system is:

  mkfs.ext4 /dev/sdb1

6. Set the label (partition name) for a partition (see linux system management P405 for details)

1) 掌握e2label命令的功能:设定或查看一个设备的label名称。

2) 灵活应用e2label命令设定label:

  a) 例如:查看/dev/sdb1分区的label的命令为:

    e2label /dev/sdb1

  b) 例如:将/dev/sdb1分区的label设定为wg的命令:

    e2label /dev/sdb1 wg

7. 课后作业(用时40分钟)

1) 开启Linux系统前添加一块大小为20G的SCSI硬盘

2) 开启系统,右击桌面,打开终端

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

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

5) 格式化两个逻辑分区为ext4系统

6) 为主分区添加卷标wg

7) 查看主分区的卷标


Guess you like

Origin blog.51cto.com/15064427/2678319