使用parted工具:
#yum install parted
#parted /dev/sdb //选择要分的硬盘
#(parted) mklabel gpt //类型GPT
Warning: The existing disk label on /dev/sdb will be destroyedand all data on this disk will be lost. Do you want to continue?
Yes/No? y //确定
#(parted) mkpart prinmary 1 -1 //将硬盘分成一个分区
#(parted) print //查看
#(parted) quit //退出Information: You may need to update /etc/fstab.
#mkfs.ext4 /dev/sdb1 //格式化文件系统为ext4
GPT(全局唯一标识磁盘分区表,适合UEFI下启动的系统)与MBR(主引导记录,适合BIOS下启动的系统)不同,GPT只有主分区,没有逻辑分区
推荐: https://my.oschina.net/ailoveai5521/blog/737359?utm_medium=referral
ipmitool和megacli这两款硬件维护工具,俗称业内“倚天剑”和“屠龙刀”
#megacli -PDList -aALL
#megacli -CfgLdAdd -r1 [252:0,252:1] WB Direct -a0
#megacli -CfgLdAdd -r1 [252:2,252:3] WB Direct -a0
此时/dev/下会多出 sdb 和 sdc,再进行分区就行。
#blkid /dev/sdb
[root@node-1 ~]# parted -l (查看所有磁盘状态)
Model: SMC LSI2208 (scsi)
Disk /dev/sda: 1998GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: pmbr_boot
Number Start End Size File system Name 标志
1 1049kB 26.2MB 25.2MB primary bios_grub
2 26.2MB 236MB 210MB primary 启动
3 236MB 498MB 262MB ext4 primary
4 498MB 1004GB 1003GB primary lvm
5 1004GB 1998GB 994GB primary lvm
Model: SMC LSI2208 (scsi)
Disk /dev/sdb: 999GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system 标志
1 1049kB 999GB 999GB primary
Model: SMC LSI2208 (scsi)
Disk /dev/sdc: 999GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system 标志
1 1049kB 999GB 999GB primary
Model: SMC LSI2208 (scsi)
Disk /dev/sdd: 999GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system 标志
1 1049kB 999GB 999GB primary
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/mongo-mongodb: 994GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:
Number Start End Size File system 标志
1 0.00B 994GB 994GB ext4
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/storage-stor: 1990GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:
Number Start End Size File system 标志
1 0.00B 1990GB 1990GB xfs
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/os-swap: 4295MB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:
Number Start End Size File system 标志
1 0.00B 4295MB 4295MB linux-swap(v1)
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/os-root: 1998GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:
Number Start End Size File system 标志
1 0.00B 1998GB 1998GB ext4
https://blog.csdn.net/iamzhangzhuping/article/details/50011793