Ubuntu Mount HDD

Source: Internet
Author: User
Tags create directory

https://cndaqiang.github.io/2017/10/11/ubuntu-disk/view hard drive viewing method One view the device files under/dev
ll -h /dev/sd*


Pass sudo fdisk -lYou can also view the new partition
$ sudo fdisk /dev/sdb

After entering the command state, presumably this is the operation:

    • Enter M to view Help
    • Enter P to view the status of the/DEV/SDB partition
    • Enter N to create a partition of the SDB disk
    • Select P Primary = = Input P
    • Partition number = is divided into one area so enter 1
    • The other default carriage returns can be
    • Last enter W to save and exit the Command state.
Formatting
$ sudo mkfs.ext4 /dev/sdb1

EXT4 to partition format

Mount Create directory and mount
sudo mkdir /home/datasudo mount /dev/sdb1 /home/data
Auto mount on Boot

View SDB1 's UUID

$ sudo blkid

Adds a UUID to the /etc/fstab UUID=63295b70-daec-4253-b659-821f51200be9 /home/data ext4 defaults,errors=remount-ro 0 1 sdb1 that is added to the UUID /etc/fstab followed by the UUID restart

7. Check and mount the new additions:
sudo mount-a
Mount-a will mount all items in the/etc/fstab, if there is an error, it will prompt for errors and then identify the cause of the error.

Note: Modify/etc/fstab must pay attention to, do not modify the error, it is possible to reboot into the system, I was a modification error, did not go into the system, I will modify the error, finally how to modify the steps to write out the system.

Enter grub mode to modify/etc/fstab
Command: sudo vi/etc/fstab
Remove the last of your own additions. Use the method please yourself Baidu vim use.
Finally, ESC returns. Input: Wq save. Shut down the machine and restart.

Ubuntu Mount HDD

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.