"Reprint" Linux How to mount a new hard drive to the home directory

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.