今天在centos下用xfs格式化磁盘出现如下错误

mkfs.xfs: cannot open /dev/sdb1: Device or resource busy 设备或资源忙

时出现:

重启服务器后再格式化也一样,也就是重启服务器没什么用。

用lsof查看是谁在占用,也没什么效果。

解决方法:

dmsetup ls

dmsetup ls
datavg1-data1 (253:0)

然后我们移除这个占用

dmsetup remove datavg1-data1

再次dmsetup ls
No devices found 已经显示没有绑定的设备了

然后就可以开始格式化了

mkfs.xfs -f /dev/sdb1

分析原因:

之前的硬盘是我们在安装系统的时候分区并挂载的

根据官方解释,dmsetup是 low level logical volume management 。我理解的意思是,这是一个更加底层的逻辑卷管理工具

dmsetup常用命令参数:

显示当前devicemapper 的信息

demsetup ls #列出所有逻辑设备

demsetup status # 列出所有逻辑设备的状态信息

desetup remove # 移除逻辑设备

显示设备依赖关系

dmsetup deps

[root@node103 ~]# fdisk -l
Disk /dev/sdd: 278.9 GiB, 299439751168 bytes, 584843264 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
Disklabel type: dos
Disk identifier: 0xe6ac2d12

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sdd1  *       2048   2099199   2097152     1G 83 Linux
/dev/sdd2       2099200 584843263 582744064 277.9G 8e Linux LVM


Disk /dev/sda: 558.9 GiB, 600127266816 bytes, 1172123568 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/sdb: 838.4 GiB, 900185481216 bytes, 1758174768 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
Disklabel type: gpt
Disk identifier: 9136C384-ECA5-44E1-B3D8-735EFA99934A

Device     Start        End    Sectors   Size Type
/dev/sdb1   2048       6143       4096     2M VMware Virtual SAN
/dev/sdb2   6144 1758174734 1758168591 838.4G VMware Virsto


Disk /dev/sdc: 838.4 GiB, 900185481216 bytes, 1758174768 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
Disklabel type: gpt
Disk identifier: 4B1B1BDC-46FB-46BA-80FA-DBA8FB4D3BD2

Device     Start        End    Sectors   Size Type
/dev/sdc1   2048 1758173183 1758171136 838.4G Linux filesystem




Disk /dev/mapper/onn-ovirt--node--ng--4.4.10.2--0.20220303.0+1: 169 GiB, 181466562560 bytes, 354426880 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-swap: 15.7 GiB, 16840130560 bytes, 32890880 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/350014ee7aaad2514: 838.4 GiB, 900185481216 bytes, 1758174768 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
Disklabel type: gpt
Disk identifier: 9136C384-ECA5-44E1-B3D8-735EFA99934A

Device                          Start        End    Sectors   Size Type
/dev/mapper/350014ee7aaad2514p1  2048       6143       4096     2M VMware Virtua
/dev/mapper/350014ee7aaad2514p2  6144 1758174734 1758168591 838.4G VMware Virsto


Disk /dev/mapper/350014ee7000283fc: 838.4 GiB, 900185481216 bytes, 1758174768 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
Disklabel type: gpt
Disk identifier: 4B1B1BDC-46FB-46BA-80FA-DBA8FB4D3BD2

Device                         Start        End    Sectors   Size Type
/dev/mapper/350014ee7000283fc1  2048 1758173183 1758171136 838.4G Linux filesyst


Disk /dev/mapper/onn-var_log_audit: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-var_log: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-var_crash: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-var: 15 GiB, 16106127360 bytes, 31457280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-tmp: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-home: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/gluster_vg_sda-gluster_lv_engine: 100 GiB, 107374182400 bytes, 209715200 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/gluster_vg_sda-gluster_lv_data: 480 GiB, 515396075520 bytes, 1006632960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 131072 bytes / 262144 bytes
[root@node103 ~]# parted /dev/sdb
GNU Parted 3.2
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help
  align-check TYPE N                        check partition N for TYPE(min|opt)
        alignment
  help [COMMAND]                           print general help, or help on
        COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition
        table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table,
        available devices, free space, all found partitions, or a particular
        partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START
        and END
  resizepart NUMBER END                    resize partition NUMBER
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected
        device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition
        NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and
        copyright information of GNU Parted
(parted) mklable
  align-check TYPE N                        check partition N for TYPE(min|opt)
        alignment
  help [COMMAND]                           print general help, or help on
        COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition
        table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table,
        available devices, free space, all found partitions, or a particular
        partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START
        and END
  resizepart NUMBER END                    resize partition NUMBER
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected
        device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition
        NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and
        copyright information of GNU Parted
(parted) p
Model: WD WD9001BKHG (scsi)
Disk /dev/sdb: 900GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  3146kB  2097kB
 2      3146kB  900GB   900GB

(parted) rm 2
(parted) rm1
  align-check TYPE N                        check partition N for TYPE(min|opt)
        alignment
  help [COMMAND]                           print general help, or help on
        COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition
        table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table,
        available devices, free space, all found partitions, or a particular
        partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START
        and END
  resizepart NUMBER END                    resize partition NUMBER
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected
        device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition
        NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and
        copyright information of GNU Parted
(parted) p
Model: WD WD9001BKHG (scsi)
Disk /dev/sdb: 900GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  3146kB  2097kB

(parted) rm
Partition number? 1
(parted) p
Model: WD WD9001BKHG (scsi)
Disk /dev/sdb: 900GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start  End  Size  File system  Name  Flags

(parted) help
  align-check TYPE N                        check partition N for TYPE(min|opt)
        alignment
  help [COMMAND]                           print general help, or help on
        COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition
        table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table,
        available devices, free space, all found partitions, or a particular
        partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START
        and END
  resizepart NUMBER END                    resize partition NUMBER
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected
        device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition
        NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and
        copyright information of GNU Parted
(parted) mkpart
Partition name?  []? disk1
File system type?  [ext2]? xfs
Start? 0%
End? 100%
(parted) p
Model: WD WD9001BKHG (scsi)
Disk /dev/sdb: 900GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size   File system  Name   Flags
 1      1049kB  900GB  900GB  xfs          disk1

(parted) w
  align-check TYPE N                        check partition N for TYPE(min|opt)
        alignment
  help [COMMAND]                           print general help, or help on
        COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition
        table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table,
        available devices, free space, all found partitions, or a particular
        partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START
        and END
  resizepart NUMBER END                    resize partition NUMBER
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected
        device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition
        NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and
        copyright information of GNU Parted
(parted) q
Information: You may need to update /etc/fstab.

[root@node103 ~]# fdisk -l
Disk /dev/sdd: 278.9 GiB, 299439751168 bytes, 584843264 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
Disklabel type: dos
Disk identifier: 0xe6ac2d12

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sdd1  *       2048   2099199   2097152     1G 83 Linux
/dev/sdd2       2099200 584843263 582744064 277.9G 8e Linux LVM


Disk /dev/sda: 558.9 GiB, 600127266816 bytes, 1172123568 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/sdb: 838.4 GiB, 900185481216 bytes, 1758174768 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
Disklabel type: gpt
Disk identifier: 9136C384-ECA5-44E1-B3D8-735EFA99934A

Device     Start        End    Sectors   Size Type
/dev/sdb1   2048 1758173183 1758171136 838.4G Linux filesystem


Disk /dev/sdc: 838.4 GiB, 900185481216 bytes, 1758174768 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
Disklabel type: gpt
Disk identifier: 4B1B1BDC-46FB-46BA-80FA-DBA8FB4D3BD2

Device     Start        End    Sectors   Size Type
/dev/sdc1   2048 1758173183 1758171136 838.4G Linux filesystem




Disk /dev/mapper/onn-ovirt--node--ng--4.4.10.2--0.20220303.0+1: 169 GiB, 181466562560 bytes, 354426880 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-swap: 15.7 GiB, 16840130560 bytes, 32890880 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/350014ee7aaad2514: 838.4 GiB, 900185481216 bytes, 1758174768 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
Disklabel type: gpt
Disk identifier: 9136C384-ECA5-44E1-B3D8-735EFA99934A

Device                          Start        End    Sectors   Size Type
/dev/mapper/350014ee7aaad2514p1  2048       6143       4096     2M VMware Virtua
/dev/mapper/350014ee7aaad2514p2  6144 1758174734 1758168591 838.4G VMware Virsto


Disk /dev/mapper/350014ee7000283fc: 838.4 GiB, 900185481216 bytes, 1758174768 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
Disklabel type: gpt
Disk identifier: 4B1B1BDC-46FB-46BA-80FA-DBA8FB4D3BD2

Device                         Start        End    Sectors   Size Type
/dev/mapper/350014ee7000283fc1  2048 1758173183 1758171136 838.4G Linux filesyst


Disk /dev/mapper/onn-var_log_audit: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-var_log: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-var_crash: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-var: 15 GiB, 16106127360 bytes, 31457280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-tmp: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-home: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/gluster_vg_sda-gluster_lv_engine: 100 GiB, 107374182400 bytes, 209715200 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/gluster_vg_sda-gluster_lv_data: 480 GiB, 515396075520 bytes, 1006632960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 131072 bytes / 262144 bytes
[root@node103 ~]# dmsetup ls
350014ee7000283fc       (253:6)
350014ee7000283fc1      (253:9)
350014ee7aaad2514       (253:5)
350014ee7aaad2514p1     (253:7)
350014ee7aaad2514p2     (253:8)
gluster_vg_sda-gluster_lv_data  (253:22)
gluster_vg_sda-gluster_lv_engine        (253:17)
gluster_vg_sda-gluster_thinpool_gluster_vg_sda  (253:21)
gluster_vg_sda-gluster_thinpool_gluster_vg_sda-tpool    (253:20)
gluster_vg_sda-gluster_thinpool_gluster_vg_sda_tdata    (253:19)
gluster_vg_sda-gluster_thinpool_gluster_vg_sda_tmeta    (253:18)
onn-home        (253:16)
onn-ovirt--node--ng--4.4.10.2--0.20220303.0+1   (253:3)
onn-pool00      (253:10)
onn-pool00-tpool        (253:2)
onn-pool00_tdata        (253:1)
onn-pool00_tmeta        (253:0)
onn-swap        (253:4)
onn-tmp (253:15)
onn-var (253:14)
onn-var_crash   (253:13)
onn-var_log     (253:12)
onn-var_log_audit       (253:11)
[root@node103 ~]# dmsetup remove 350014ee7aaad2514
device-mapper: remove ioctl on 350014ee7aaad2514  failed: Device or resource busy
Command failed.
[root@node103 ~]# dmsetup remove 350014ee7aaad2514p1
[root@node103 ~]# dmsetup remove 350014ee7aaad2514p2
[root@node103 ~]# dmsetup remove 350014ee7aaad2514
[root@node103 ~]# dmsetup ls
350014ee7000283fc       (253:6)
350014ee7000283fc1      (253:9)
gluster_vg_sda-gluster_lv_data  (253:22)
gluster_vg_sda-gluster_lv_engine        (253:17)
gluster_vg_sda-gluster_thinpool_gluster_vg_sda  (253:21)
gluster_vg_sda-gluster_thinpool_gluster_vg_sda-tpool    (253:20)
gluster_vg_sda-gluster_thinpool_gluster_vg_sda_tdata    (253:19)
gluster_vg_sda-gluster_thinpool_gluster_vg_sda_tmeta    (253:18)
onn-home        (253:16)
onn-ovirt--node--ng--4.4.10.2--0.20220303.0+1   (253:3)
onn-pool00      (253:10)
onn-pool00-tpool        (253:2)
onn-pool00_tdata        (253:1)
onn-pool00_tmeta        (253:0)
onn-swap        (253:4)
onn-tmp (253:15)
onn-var (253:14)
onn-var_crash   (253:13)
onn-var_log     (253:12)
onn-var_log_audit       (253:11)
[root@node103 ~]# mkfs.xfs -f /dev/sdb
meta-data=/dev/sdb               isize=512    agcount=4, agsize=54942962 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=0 inobtcount=0
data     =                       bsize=4096   blocks=219771846, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=107310, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@node103 ~]# blkid
/dev/mapper/onn-var_crash: UUID="00050fc2-5319-46da-b6c2-b0557f602845" BLOCK_SIZE="512" TYPE="xfs"
/dev/sdd2: UUID="DWXIm1-1QSa-qU1q-0urm-1sRl-BEiz-NaemIW" TYPE="LVM2_member" PARTUUID="e6ac2d12-02"
/dev/sdd1: UUID="840d0f88-c5f0-4a98-a7dd-73ebf347a85b" BLOCK_SIZE="512" TYPE="xfs" PARTUUID="e6ac2d12-01"
/dev/sda: UUID="kMvSz0-GoE5-Q0vf-qrjM-3H5m-NCLg-fSTZb8" TYPE="LVM2_member"
/dev/mapper/onn-ovirt--node--ng--4.4.10.2--0.20220303.0+1: UUID="8bef5e42-0fd1-4595-8b3c-079127a2c237" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/onn-swap: UUID="18284c2e-3596-4596-b0e8-59924944c417" TYPE="swap"
/dev/mapper/onn-var_log_audit: UUID="928237b1-7c78-42d0-afca-dfd362225740" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/onn-var_log: UUID="cb6aafa3-9a97-4dc5-81f6-d2da3b0fdcd9" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/onn-var: UUID="47b2e20c-f623-404d-9a12-3b6a31b71096" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/onn-tmp: UUID="599eda13-d184-4a59-958c-93e37bc6fdaa" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/onn-home: UUID="ef67a11a-c786-42d9-89d0-ee518b50fce5" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/gluster_vg_sda-gluster_lv_engine: UUID="3b99a374-baa4-4783-8da8-8ecbfdb227a4" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/gluster_vg_sda-gluster_lv_data: UUID="eb5ef30a-cb48-4491-99c6-3e6c6bfe3f69" BLOCK_SIZE="512" TYPE="xfs"
/dev/sdb: UUID="7606748a-9cc4-4508-b15e-5c92a33c30a0" BLOCK_SIZE="512" TYPE="xfs"
/dev/sdc: PTUUID="4b1b1bdc-46fb-46ba-80fa-dba8fb4d3bd2" PTTYPE="gpt"
/dev/mapper/350014ee7000283fc: PTUUID="4b1b1bdc-46fb-46ba-80fa-dba8fb4d3bd2" PTTYPE="gpt"
/dev/mapper/350014ee7000283fc1: PARTLABEL="disk1" PARTUUID="925b0d54-3aa4-4e3d-8a96-db329553c5c6"
[root@node103 ~]# mkfs.xfs -f /dev/sdb

mkfs.vfat: unable to open /dev/sdb: Device or resource busy操作记录

Disk /dev/mapper/onn-tmp: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-home: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/gluster_vg_sdc-gluster_lv_engine: 100 GiB, 107374182400 bytes, 209715200 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/gluster_vg_sdc-gluster_lv_data: 480 GiB, 515396075520 bytes, 1006632960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 131072 bytes / 262144 bytes
[root@node101 gluster_bricks]# clear
[root@node101 gluster_bricks]# fdisk -l
Disk /dev/sdd: 278.9 GiB, 299439751168 bytes, 584843264 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
Disklabel type: dos
Disk identifier: 0x233fb4db

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sdd1  *       2048   2099199   2097152     1G 83 Linux
/dev/sdd2       2099200 584843263 582744064 277.9G 8e Linux LVM


Disk /dev/sdc: 558.9 GiB, 600127266816 bytes, 1172123568 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: 838.4 GiB, 900185481216 bytes, 1758174768 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/sdb: 838.4 GiB, 900185481216 bytes, 1758174768 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/onn-ovirt--node--ng--4.4.10.2--0.20220303.0+1: 169 GiB, 181466562560 bytes, 354426880 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-swap: 15.7 GiB, 16840130560 bytes, 32890880 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/350014ee7aaacc108: 838.4 GiB, 900185481216 bytes, 1758174768 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/onn-var_log_audit: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-var_log: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-var_crash: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-var: 15 GiB, 16106127360 bytes, 31457280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-tmp: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-home: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/gluster_vg_sdc-gluster_lv_engine: 100 GiB, 107374182400 bytes, 209715200 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/gluster_vg_sdc-gluster_lv_data: 480 GiB, 515396075520 bytes, 1006632960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 131072 bytes / 262144 bytes
[root@node101 gluster_bricks]# dmsetup ls
350014ee7aaacc108       (253:6)
gluster_vg_sdc-gluster_lv_data  (253:19)
gluster_vg_sdc-gluster_lv_engine        (253:14)
gluster_vg_sdc-gluster_thinpool_gluster_vg_sdc  (253:18)
gluster_vg_sdc-gluster_thinpool_gluster_vg_sdc-tpool    (253:17)
gluster_vg_sdc-gluster_thinpool_gluster_vg_sdc_tdata    (253:16)
gluster_vg_sdc-gluster_thinpool_gluster_vg_sdc_tmeta    (253:15)
onn-home        (253:13)
onn-ovirt--node--ng--4.4.10.2--0.20220303.0+1   (253:3)
onn-pool00      (253:7)
onn-pool00-tpool        (253:2)
onn-pool00_tdata        (253:1)
onn-pool00_tmeta        (253:0)
onn-swap        (253:4)
onn-tmp (253:12)
onn-var (253:11)
onn-var_crash   (253:10)
onn-var_log     (253:9)
onn-var_log_audit       (253:8)
[root@node101 gluster_bricks]# 350014ee7aaacc108^C
[root@node101 gluster_bricks]# dmsetup remove 350014ee7aaacc108
[root@node101 gluster_bricks]# dmsetup ls
gluster_vg_sdc-gluster_lv_data  (253:19)
gluster_vg_sdc-gluster_lv_engine        (253:14)
gluster_vg_sdc-gluster_thinpool_gluster_vg_sdc  (253:18)
gluster_vg_sdc-gluster_thinpool_gluster_vg_sdc-tpool    (253:17)
gluster_vg_sdc-gluster_thinpool_gluster_vg_sdc_tdata    (253:16)
gluster_vg_sdc-gluster_thinpool_gluster_vg_sdc_tmeta    (253:15)
onn-home        (253:13)
onn-ovirt--node--ng--4.4.10.2--0.20220303.0+1   (253:3)
onn-pool00      (253:7)
onn-pool00-tpool        (253:2)
onn-pool00_tdata        (253:1)
onn-pool00_tmeta        (253:0)
onn-swap        (253:4)
onn-tmp (253:12)
onn-var (253:11)
onn-var_crash   (253:10)
onn-var_log     (253:9)
onn-var_log_audit       (253:8)
[root@node101 gluster_bricks]# mkfs.xfs /dev/sdb
meta-data=/dev/sdb               isize=512    agcount=4, agsize=54942962 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=0 inobtcount=0
data     =                       bsize=4096   blocks=219771846, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=107310, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@node101 gluster_bricks]#
[root@node103 ~]# fdisk -l
Disk /dev/sdd: 278.9 GiB, 299439751168 bytes, 584843264 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
Disklabel type: dos
Disk identifier: 0xe6ac2d12

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sdd1  *       2048   2099199   2097152     1G 83 Linux
/dev/sdd2       2099200 584843263 582744064 277.9G 8e Linux LVM


Disk /dev/sda: 558.9 GiB, 600127266816 bytes, 1172123568 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/sdb: 838.4 GiB, 900185481216 bytes, 1758174768 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/sdc: 838.4 GiB, 900185481216 bytes, 1758174768 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
Disklabel type: gpt
Disk identifier: 4B1B1BDC-46FB-46BA-80FA-DBA8FB4D3BD2

Device     Start        End    Sectors   Size Type
/dev/sdc1   2048 1758173183 1758171136 838.4G Linux filesystem




Disk /dev/mapper/onn-ovirt--node--ng--4.4.10.2--0.20220303.0+1: 169 GiB, 181466562560 bytes, 354426880 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-swap: 15.7 GiB, 16840130560 bytes, 32890880 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/onn-var_log_audit: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-var_log: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-var_crash: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-var: 15 GiB, 16106127360 bytes, 31457280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-tmp: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/onn-home: 1 GiB, 1073741824 bytes, 2097152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/gluster_vg_sda-gluster_lv_engine: 100 GiB, 107374182400 bytes, 209715200 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/gluster_vg_sda-gluster_lv_data: 480 GiB, 515396075520 bytes, 1006632960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 131072 bytes / 262144 bytes
[root@node103 ~]#
[root@node103 ~]# parted /dev/sdc
GNU Parted 3.2
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help
  align-check TYPE N                        check partition N for TYPE(min|opt)
        alignment
  help [COMMAND]                           print general help, or help on
        COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition
        table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table,
        available devices, free space, all found partitions, or a particular
        partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START
        and END
  resizepart NUMBER END                    resize partition NUMBER
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected
        device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition
        NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and
        copyright information of GNU Parted
(parted) mkpart
Partition name?  []? ^C
File system type?  [ext2]? ^C
Error: Expecting a file system type.
(parted) rm
Partition number? 1
(parted) p
Model: WD WD9001BKHG (scsi)
Disk /dev/sdc: 900GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start  End  Size  File system  Name  Flags

(parted) q
Information: You may need to update /etc/fstab.

[root@node103 ~]# mkfs.xfs /dev/sdc
mkfs.xfs: /dev/sdc appears to contain a partition table (gpt).
mkfs.xfs: Use the -f option to force overwrite.
[root@node103 ~]# mkfs.xfs -f /dev/sdc
meta-data=/dev/sdc               isize=512    agcount=4, agsize=54942962 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=0 inobtcount=0
data     =                       bsize=4096   blocks=219771846, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=107310, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@node103 ~]#
[root@node103 ~]# blkid
/dev/mapper/onn-var_crash: UUID="00050fc2-5319-46da-b6c2-b0557f602845" BLOCK_SIZE="512" TYPE="xfs"
/dev/sdd2: UUID="DWXIm1-1QSa-qU1q-0urm-1sRl-BEiz-NaemIW" TYPE="LVM2_member" PARTUUID="e6ac2d12-02"
/dev/sdd1: UUID="840d0f88-c5f0-4a98-a7dd-73ebf347a85b" BLOCK_SIZE="512" TYPE="xfs" PARTUUID="e6ac2d12-01"
/dev/sda: UUID="kMvSz0-GoE5-Q0vf-qrjM-3H5m-NCLg-fSTZb8" TYPE="LVM2_member"
/dev/mapper/onn-ovirt--node--ng--4.4.10.2--0.20220303.0+1: UUID="8bef5e42-0fd1-4595-8b3c-079127a2c237" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/onn-swap: UUID="18284c2e-3596-4596-b0e8-59924944c417" TYPE="swap"
/dev/mapper/onn-var_log_audit: UUID="928237b1-7c78-42d0-afca-dfd362225740" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/onn-var_log: UUID="cb6aafa3-9a97-4dc5-81f6-d2da3b0fdcd9" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/onn-var: UUID="47b2e20c-f623-404d-9a12-3b6a31b71096" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/onn-tmp: UUID="599eda13-d184-4a59-958c-93e37bc6fdaa" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/onn-home: UUID="ef67a11a-c786-42d9-89d0-ee518b50fce5" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/gluster_vg_sda-gluster_lv_engine: UUID="3b99a374-baa4-4783-8da8-8ecbfdb227a4" BLOCK_SIZE="512" TYPE="xfs"
/dev/mapper/gluster_vg_sda-gluster_lv_data: UUID="eb5ef30a-cb48-4491-99c6-3e6c6bfe3f69" BLOCK_SIZE="512" TYPE="xfs"
/dev/sdb: UUID="7606748a-9cc4-4508-b15e-5c92a33c30a0" BLOCK_SIZE="512" TYPE="xfs"
/dev/sdc: UUID="bc42aac4-14ab-4a62-94c7-7634953b25a6" BLOCK_SIZE="512" TYPE="xfs"

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐