Linux disk partition
Basics
- In Linux, everything corresponds to an image file to disk as well.
- schematic diagram:
- 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)
- Disk space to apply the virtual machine Linux system
After performing the above operation, restart, used in the terminal lsblk - f disk command to view the current situation.
- To partition the disk
partition disk command: fdisk -f / dev / sdb (may also be other, here refers to the disk directory added)
- 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)
- 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
- 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
Everywhere all over, there are insufficient areas for learning