scenario

The storage space of the Linux system is insufficient. You need to mount a new diskCopy the code

Configuring a New Disk

Fdisk -l The new disk is /dev/sdbCopy the code

Setting disk Partitions

Fdisk /dev/sdb -n - create a partition -p - print the partition table -d - delete a partition -q - Exit without saving changes -w - save changes and exit create a partition, use the n option.Copy the code

Create a primary or extended partition. By default we can have up to four primary partitions.Copy the code

Enter the partition number as required. The default value 1 is recommended.Copy the code

Enter the size of the first sector. If it is a new disk, the default value is usually chosen. If you are creating a second partition on the same disk, we need to add 1 to the last sector of the previous partition.Copy the code

Enter the value of the last sector or partition size. It is usually recommended to enter the size of the partition. Always add the prefix + to prevent out-of-range errors.Copy the code

Save and exit and enter WCopy the code

Disk formatting

MKFS -t ext4 /dev/sdbCopy the code

Disk mount

Mount /dev/sdb1/storage in /etc/fstab in defaults 0 0Copy the code