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 -l
You 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