Linux disk partitions study notes

Linux disk partition

Basics

  1. In Linux, everything corresponds to an image file to disk as well.
  2. schematic diagram:
    Here Insert Picture Description
  3. The figure shows: figure 1 with the partition root (/) association, a partition boot directory associated with 2, 3 and the partition mnt directory associate. When you need to increase Linux system disk, the disk with the corresponding file directory can be mounted associate, and then use the disk.

Increase Linux system disk procedure (operation on a virtual machine)

  1. Disk space to apply the virtual machine Linux system
    Here Insert Picture Description
    Here Insert Picture Description
    Here Insert Picture Description
    Here Insert Picture Description
    Here Insert Picture Description
    Here Insert Picture Description
    After performing the above operation, restart, used in the terminal lsblk - f disk command to view the current situation.
    Here Insert Picture Description
  2. To partition the disk
    partition disk command: fdisk -f / dev / sdb (may also be other, here refers to the disk directory added)Here Insert Picture Description
    Here Insert Picture Description
    Here Insert Picture Description
    Here Insert Picture Description
  3. Format a partition
    formatting commands: mkfs -t ext4 / dev / sdb1 ( this instruction indicates that the disk is formatted / dev / sdb1 ext4 of the disk-type)
    Here Insert Picture Description
    Here Insert Picture Description
  4. Mount the disk file under Linux
    mount command: mount / dev / sdb1 / home / disk ( here represented the / dev / sdb1 disk mount under / home / disk directory, these two can be flexible modified)
    first choose to mount the file directory: for example, I mount to / home / disk under
    Here Insert Picture Description
  5. Set the disk and the file is automatically linked to the (otherwise it will be disconnected after the restart mount)
    to edit / etc / fstab file
    Here Insert Picture Description
    Here Insert Picture Description

Everywhere all over, there are insufficient areas for learning

Released nine original articles · won praise 0 · Views 1001

Guess you like

Origin blog.csdn.net/qq_43156103/article/details/88412779