Reprinted from: https://blog.51cto.com/12185273/2048111
In the actual production server, you will encounter a lack of disk space, temporary mount disk expansion of capacity, if the increase is less than 2TB of disk space, you can use fdisk to complete, if your partition is larger than 2TB with parted; planning is generally recommended to use linux server lvm logical disk management. Then demonstrate how to use fdisk to partition the disk is formatted and the boot automatically mount.
4 steps to go:
add disk - Partition - Format and mount - set the boot automatically mount the
first to add a virtual disk 5G capacity,
execute fdisk -l View partition details, you can see more than a / dev / sdb 5g available space
execution fdisk / dev / sdb its partition
n-- new partition
p-- new primary partition for the new extended partition e-- input
section number 1 input, to continue the transport
input p to print the partition information, the ID of the back refers to the linux partition type codes
linux partition type code 83
commands can be entered unfamiliar m see help,
enter w enter to save the partition information
formatted partition
Linux kernel since 2.6.28 officially support the new file system ext4, before the file system It is ext3;; centos7 xfs file system format to
view the system kernel version and boot loader fstab file system type
format the / dev / sdb1
mkfs.ext4 / dev / sdb1 Note: this is sdb1, sdb not
see done representation formatting is complete
to create a mount directory
mkdir / dbfile
Mount: mount / dev / sdb1 / dbfile
unmounted: umount / dev / sdb1 / dbfile
will be added to the mounted disk boot automatically mount
here I use uuid mount, more reliable; mainly worried if we add the other disks that may lead to zoning changes cause the system to fail to start;
blkid view disk uuid
vim / etc / fstab to add record screenshots
added after the check for the next available normal
mount -a
Figure that there is no problem, you can try to restart the system to see to see whether the boot automatically mount.
After the restart we enter the directory to create a file, touch a.sh said that it has successfully working properly mounted 5G hard drive. . .