Example: The new disk's device file name is/dev/vdb size 100GB. #fdisk-L View the new Disk 1, partition the new disk #fdisk/dev/vdb prompt operation p print n new d Delete W operation effective Q exit Operation W#partprobe Forcing the kernel to re-locate the partition table (update partition table) Here we add a partition/dev/vdb1 size 40GB 2, partition format #mkfs-t ext4/dev/vdb1 format to EXT4 Format 3, temporarily mount a new hard disk in a directory # cd/mnt/#mkdir home#mount/dev/vdb1/mnt/home mount to/mnt/home#df-h view #cp-a/home/*/mnt/home/ Copy the things under the home to the attached directory, backup #rm-rf/home/* to remove things from the home #umount/dev/vdb1 unmount the hard drive #df-h View 4, set the boot Mount #vi/etc/fstab end add a line /DEV/VDB1/Home ext4 defaults 1 2 Save exit
#df-H to see if/home is mounted and found not mounted
#mount-a mounted/etc/fstab in the execution of a partition #df-h view found Mount succeeded
Filesystem Size used Avail use% mounted onlabel=cec-rootfs 16G 1.9G 13G 13%/TMPFS 1.9G 0 1.9G 0%/dev/shm/dev/vda1 194M 28M 157M 15%/boot/dev/vdb1 40G 176M 38G 1%/Home
OK, you are done.
"Reprint" Linux How to mount a new hard drive to the home directory