刚装了一台服务器,有3组Raid硬盘,还有1块PCI-e接口的硬盘,把CentOS7装到到了Virtual Disk0上,进系统默认找不到另外2组硬盘和PCI-e的硬盘。
硬盘配置:
Virtual Disk0: RAID1 600GB
Virtual Disk1: RAID5 1.8TB
Virtual Disk1: PCI-e 1.5TB
Virtual Disk3: RAID5 4TB
1.先查看服务器的硬件信息:
fdisk -l查看的信息是很详细的,这里只把需要硬盘信息列出来
[root@CentOS7 ~]# fdisk -l
Disk /dev/sda: 599.6 GB, 599550590976 bytes, 1170997248 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000d1efb
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 1170997247 584449024 8e Linux LVM
Disk /dev/sdb: 1918.2 GB, 1918239768576 bytes, 3746562048 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x5bbc95ee
Device Boot Start End Blocks Id System
/dev/sdb1 2048 3746562047 1873280000 83 Linux
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sdc: 4316.0 GB, 4316039479296 bytes, 8429764608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt
Disk identifier: 8518D2F4-5842-441B-9F5D-35C13F47F68E
# Start End Size Type Name
1 34 8429764574 3.9T Microsoft basic data
Partition 1 does not start on physical sector boundary.
Disk /dev/nvme0n1: 1600.3 GB, 1600321314816 bytes, 3125627568 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x712c6c73
Device Boot Start End Blocks Id System
/dev/nvme0n1p1 2048 3125627567 1562812760 83 Linux
Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/centos-swap: 4294 MB, 4294967296 bytes, 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/centos-home: 540.5 GB, 540490596352 bytes, 1055645696 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
查看到下列信息,并且均已有分区
Disk /dev/sda: 599.6 GB, 599550590976 bytes, 1170997248 sectors
Disk /dev/sdb: 1918.2 GB, 1918239768576 bytes, 3746562048 sectors
Device Boot Start End Blocks Id System
/dev/sdb1 2048 3746562047 1873280000 83 Linux
Disk /dev/nvme0n1: 1600.3 GB, 1600321314816 bytes, 3125627568 sectors
Device Boot Start End Blocks Id System
/dev/nvme0n1p1 2048 3125627567 1562812760 83 Linux
Disk /dev/sdc: 4316.0 GB, 4316039479296 bytes, 8429764608 sectors
# Start End Size Type Name
1 34 8429764574 3.9T Microsoft basic data
2. 因为已经有分区,创建对应目录,挂载对应磁盘
在根目录下,建一个文件夹,待会将分区挂载在这个文件夹上,以后要往新硬盘存东西就存在新建文件夹下就可以了。
[root@CentOS7 ~]# mkdir /disk1
[root@CentOS7 ~]# mount /dev/sdb1 /disk1
[root@CentOS7 ~]# mkdir /disk2
[root@CentOS7 ~]# mount /dev/sdc1 /disk2
[root@CentOS7 ~]# mkdir /disk3
[root@CentOS7 ~]# mount /dev/nvme0n1p1 /disk3
3.查看磁盘空间信息
[root@CentOS7 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 8.9G 42G 18% /
/dev/nvme0n1p1 1.5T 1.4T 115G 93% /disk3
/dev/sdb1 1.8T 19G 1.7T 2% /disk1
/dev/sdc1 3.9T 950G 2.8T 26% /disk2
/dev/sda1 1014M 150M 865M 15% /boot
/dev/mapper/centos-home 504G 201G 304G 40% /home
[root@CentOS7 ~]#
4.设置开机自动挂载目录
编辑配置文件如下:
[root@CentOS7 ~]# vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Mon Aug 24 10:16:27 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root / xfs defaults 0 0
UUID=ecea48d2-fa35-4a6b-a63d-4fe8b5068796 /boot xfs defaults 0 0
/dev/mapper/centos-home /home xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
/dev/nvme0n1p1 /disk3 xfs defaults 0 0
/dev/sdb1 /disk1 ext3 defaults 0 0
/dev/sdc1 /disk2 ext4 defaults 0 0
注意:填写磁盘分区格式要准确,否则可能造成系统无法正常启动,进入单用户模式,查看磁盘分区格式如下:
[root@CentOS7 ~]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/mapper/centos-root xfs 52403200 9241412 43161788 18% /
/dev/nvme0n1p1 xfs 1562049668 1442204608 119845060 93% /disk3
/dev/sdb1 ext3 1843755988 19613580 1730478408 2% /disk1
/dev/sdc1 ext4 4148592052 995351652 2942479904 26% /disk2
/dev/sda1 xfs 1038336 153352 884984 15% /boot
/dev/mapper/centos-home xfs 527565124 209750092 317815032 40% /home
[root@CentOS7 ~]#