挂载数据盘
mkdir /data
usr@ubuntu:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
sda1 8:1 0 512M 0 part /boot/efi
sda2 8:2 0 464.3G 0 part /
sda3 8:3 0 976M 0 part
cryptswap1 252:0 0 975.5M 0 crypt
sdb 8:16 0 5.5T 0 disk
sdc 8:32 0 5.5T 0 disk
重新初始化、并且格式化数据盘
parted /dev/sdb mklabel gpt
mkfs.ext4 /dev/sdb
挂载数据盘
获取 UUID
root@ubuntu:/# blkid /dev/sdb |awk '{print $2}'|sed 's/"//g'
UUID=0b238fbf-ea33-49dd-bb5c-adf7b763d9c6
修改vim /etc/fstab文件
增加一行
UUID=0b238fbf-ea33-49dd-bb5c-adf7b763d9c6 /data ext4 defaults 0 0
挂载
root@ubuntu:/# mount -a
看挂载结果
root@ubuntu:/# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb 5.5T 58M 5.2T 1% /data
usr@ubuntu:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
sda1 8:1 0 512M 0 part /boot/efi
sda2 8:2 0 464.3G 0 part /
sda3 8:3 0 976M 0 part
cryptswap1 252:0 0 975.5M 0 crypt
sdb 8:16 0 5.5T 0 disk
sdc 8:32 0 5.5T 0 disk
重新初始化、并且格式化数据盘
parted /dev/sdb mklabel gpt
mkfs.ext4 /dev/sdb
挂载数据盘
获取 UUID
root@ubuntu:/# blkid /dev/sdb |awk '{print $2}'|sed 's/"//g'
UUID=0b238fbf-ea33-49dd-bb5c-adf7b763d9c6
修改vim /etc/fstab文件
增加一行
UUID=0b238fbf-ea33-49dd-bb5c-adf7b763d9c6 /data ext4 defaults 0 0
挂载
root@ubuntu:/# mount -a
看挂载结果
root@ubuntu:/# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb 5.5T 58M 5.2T 1% /data