格式化磁盘(包含Ceph盘)

[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 894.3G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 890G 0 part
└─cl-root 253:0 0 890G 0 lvm /
sdb 8:16 0 3.7T 0 disk
└─sdb1 8:17 0 16M 0 part
sdc 8:32 0 3.7T 0 disk
└─sdc1 8:33 0 16M 0 part
sdd 8:48 0 3.7T 0 disk
└─sdd1 8:49 0 16M 0 part
[root@localhost ~]# parted /dev/sdb
GNU Parted 3.2
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes
(parted)
(parted)
(parted) q
Information: You may need to update /etc/fstab.

[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 894.3G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 890G 0 part
└─cl-root 253:0 0 890G 0 lvm /
sdb 8:16 0 3.7T 0 disk
sdc 8:32 0 3.7T 0 disk
└─sdc1 8:33 0 16M 0 part
sdd 8:48 0 3.7T 0 disk
└─sdd1 8:49 0 16M 0 part
[root@localhost ~]# mkfs.xfs -f /dev/sdb
meta-data=/dev/sdb isize=512 agcount=4, agsize=244188662 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=976754646, imaxpct=5
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=476930, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@localhost ~]#

[root@localhost sysconfig]# dmsetup ls
cl-root (253:0)
ceph--6cf722db--1d13--43af--b907--4e01f9bf5316-osd--block--807e7c0a--ff98--4121--8bcc--9538ab7d44ce (253:1)
ceph--62c1a5ba--ab0c--4b19--853e--381697b89e9f-osd--block--e8332d70--801e--45dd--b1ae--1b9155c8e35a (253:2)
ceph--e1fd509c--021d--4f44--8a19--9c32ba2e6360-osd--block--3e1b16c6--d8ea--414c--b119--9b3f131bc19c (253:3)
[root@localhost sysconfig]# dmsetup remove ceph--6cf722db--1d13--43af--b907--4e01f9bf5316-osd--block--807e7c0a--ff98--4121--8bcc--9538ab7d44ce
[root@localhost sysconfig]# dmsetup remove ceph--62c1a5ba--ab0c--4b19--853e--381697b89e9f-osd--block--e8332d70--801e--45dd--b1ae--1b9155c8e35a
[root@localhost sysconfig]# dmsetup remove ceph--e1fd509c--021d--4f44--8a19--9c32ba2e6360-osd--block--3e1b16c6--d8ea--414c--b119--9b3f131bc19c
[root@localhost sysconfig]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 894.3G 0 disk
├─sda1 8:1 0 1G 0 part
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 890G 0 part
└─cl-root 253:0 0 890G 0 lvm /
sdb 8:16 0 3.7T 0 disk
sdc 8:32 0 3.7T 0 disk
sdd 8:48 0 3.7T 0 disk

你可能感兴趣的:(格式化磁盘(包含Ceph盘))