使用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
