Ubuntu系统挂载磁盘硬盘
在电脑(Ubuntu16.04)新装了一个硬盘,然后只有挂载了我们才能正常使用,下面总结一下挂载的过程。
首先,打开命令行输入命令:
sudo fdisk -l
可以看到:磁盘格式化后
硬盘格式化
命令:sudo mkfs -t ext4 /dev/sda
说明一下:-t ext4表示将分区格式化为ext4文件系统类型
sudo blkid 这个能显示每个磁盘的UUID
uxsrt@ubuntu-algserver:/data1$ sudo blkid /dev/sda1: UUID="028b5062-e9d0-42af-be08-c3be080a0b7e" TYPE="ext4" PARTUUID="1ce07b8d-01" /dev/sda5: UUID="bafd3244-6eb9-4bdb-bbee-8f6c0e293927" TYPE="swap" PARTUUID="1ce07b8d-05" /dev/sdb: UUID="eded7b1d-65fb-49c1-81b1-73cc44309821" TYPE="ext4" /dev/sdc: UUID="e624b217-4b2e-409a-8f27-4b6b67ec9132" TYPE="ext4" /dev/sdd: UUID="454fa7d1-54f3-4be4-bd6d-e31d34934985" TYPE="ext4"
sudo vim /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda1 during installation UUID=028b5062-e9d0-42af-be08-c3be080a0b7e / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=bafd3244-6eb9-4bdb-bbee-8f6c0e293927 none swap sw 0 0 UUID=eded7b1d-65fb-49c1-81b1-73cc44309821 /data1 ext4 defaults 0 0 UUID=e624b217-4b2e-409a-8f27-4b6b67ec9132 /data2 ext4 defaults 0 0 UUID=454fa7d1-54f3-4be4-bd6d-e31d34934985 /data3 ext4 defaults 0 0
sudo reboot 重启