服务器硬盘做了read,但装完系统后没有分盘挂载,因此不能使用。
1、硬盘分区
首先查看机器所有的硬盘状态sudo fdisk -l,结果如下:
可以看到有个/dev/sdb:21.8T的硬盘。
执行 sudo fdisk /dev/sdb按照提示进行硬盘分区:一般分到2T以内(记得w保存分区)。
Welcome to fdisk (util-linux 2.27.1).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Command (m for help): nPartition number (1-128, default 1): First sector (3124756478-46871347166, default 15623782400): Last sector, +sectors or +size{K,M,G,T,P} (15623782400-46871347166, default 46871347166): q^H1Last sector, +sectors or +size{K,M,G,T,P} (15623782400-46871347166, default 46871347166): 20000000000Created a new partition 1 of type 'Linux filesystem' and of size 2 TiB.Command (m for help):注意:大于2T时,执行下面操作
2、格式化硬盘
sudo mkfs -t ext4 /dev/sdb13、挂载
在/home下面创建相关挂载节点并挂载
至此就挂载好了,可用df -l查看挂载情况,不过重启所有的挂载会失效。
若要每次重启不需要重新挂载,还需要进行下面的操作:
在文件 /etc/fstab 中加入配置sudo vim /etc/fstab: