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

2023-11-20

今天在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"

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

mkfs.xfs: cannot open /dev/sdb1: Device or resource busy 设备或资源忙 的相关文章

  • 为 Qt 应用程序创建 Linux 安装

    我刚刚用 Qt Creator 制作了一个很棒的程序 我对自己很满意 如何将其从台式机移至笔记本电脑 那么 最好的方法是安装程序 对吗 对于 Ubuntu 这是一个 Debian 软件包 对吗 我怎么做 有人这样做过吗 他们可以分享 QT
  • 在 Ubuntu 16.04 上找不到 printf.c

    我最近切换到Ubuntu 16 04 我在用vscode作为 Ubuntu 上的 IDE 我配置了其他语言 但我无法做到这一点C C 我创建c cpp properties json launch json tasks json 当我开始编
  • 每个进程每个线程的时间量

    我有一个关于 Windows 和 Linux 中进程和线程的时间量子的问题 我知道操作系统通常为每个线程提供固定的时间量 我知道时间量根据前台或后台线程而变化 也可能根据进程的优先级而变化 每个进程有固定的时间量吗 例如 如果操作系统为每个
  • Linux shell 脚本:十六进制数字到二进制字符串

    我正在 shell 脚本中寻找一些简单的方法来将十六进制数字转换为 0 和 1 字符的序列 Example 5F gt 01011111 是否有任何命令或简单的方法来完成它 或者我应该为其编写一些开关 echo ibase 16 obase
  • Bash 方法的返回值总是模 256

    我有一个 bash 脚本方法 它返回输入值 然而 返回值始终是模 256 的值 我用 google 搜索了一段时间 发现this http www tldp org LDP abs html exitcodes html文章说它总是以 25
  • C 程序从连接到系统的 USB 设备读取数据

    我正在尝试从连接到系统 USB 端口的 USB 设备 例如随身碟 获取数据 在这里 我可以打开设备文件并读取一些随机原始数据 但我想获取像 minicom teraterm 这样的数据 请让我知道我可以使用哪些方法和库来成功完成此操作以及如
  • 让 MongoDB 在 Linux 上监听远程连接

    我已在 Windows 本地计算机上 上成功安装 MongoDB 作为服务 但现在我想将 MongoDb 移动到单独的服务器 所以我将 tarball 解压到网络上的虚拟服务器 运行 Linux 当我从本地计算机使用 PuTTY 连接到服务
  • 归档文件系统或格式

    我正在寻找一种文件类型来存储已退役系统的档案 目前 我们主要使用 tar gz 但从 200GB tar gz 存档中查找并提取几个文件是很麻烦的 因为 tar gz 不支持任何类型的随机访问读取规定 在你明白之前 使用 FUSE 安装 t
  • 在 /dev/input/eventX 中写入事件需要哪些命令?

    我正在开发一个android需要将触摸事件发送到 dev input eventX 的应用程序 我知道C执行此类操作的代码结构如下 struct input event struct timeval time unsigned short
  • 并行运行 make 时出错

    考虑以下制作 all a b a echo a exit 1 b echo b start sleep 1 echo b end 当运行它时make j2我收到以下输出 echo a echo b start a exit 1 b star
  • 在 Linux 中禁用历史记录 [关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 要在 Linux 环境中禁用历史记录 我执行了以下命令 export HISTFILESIZE 0 export HISTSIZE 0 u
  • 在Linux上编译C# + WPF以便在Windows上运行

    我有一个 C 应用程序 其中某些部分是使用 WPF 编写的 Mono 不支持 可以在 Linux 上编译这个应用程序吗 最终 该应用程序将在 Windows 上运行 但它是更大框架的一部分 并且我们的整个构建过程在 Linux 上运行 因此
  • 拆分字符串以仅获取前 5 个字符

    我想去那个地点 var log src ap kernelmodule 10 001 100 但看起来我的代码必须处理 ap kernelmodule 10 002 100 ap kernelmodule 10 003 101 等 我想使用
  • 何时使用 pthread 条件变量?

    线程问题 看来 只有在其他线程调用 pthread cond notify 之前调用 pthread cond wait 时 条件变量才起作用 如果在等待之前发生通知 那么等待将被卡住 我的问题是 什么时候应该使用条件变量 调度程序可以抢占
  • 使用 find - 删除除任何一个之外的所有文件/目录(在 Linux 中)

    如果我们想删除我们使用的所有文件和目录 rm rf 但是 如果我希望一次性删除除一个特定文件之外的所有文件和目录怎么办 有什么命令可以做到这一点吗 rm rf 可以轻松地一次性删除 甚至可以删除我最喜欢的文件 目录 提前致谢 find ht
  • 在 Linux 上更快地分叉大型进程?

    在现代 Linux 上达到与 Linux 相同效果的最快 最好的方法是什么 fork execve combo 从一个大的过程 我的问题是进程分叉大约 500MByte 大 并且一个简单的基准测试只能从进程中实现约 50 个分叉 秒 比较最
  • Android:ANT 构建失败,并显示 google-play-services-lib:“解析为没有项目的 project.properties 文件的路径”

    我正在尝试使用 ANT 构建我的应用程序 但在包含 google play services lib 库项目后 我惨遭失败 Step 1 我在 project properties 文件中设置了对库项目的引用 android library
  • 强制卸载 NFS 安装目录 [关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 Locked 这个问题及其答案是locked help locked posts因为这个问题是题外话 但却具有历史意义 目前不接受新的答案
  • 使用 grep 查找包含所有搜索字符串的行

    我有一个文件 其中包含很多与此类似的行 id 2796 some model Profile message type MODEL SAVE fields account 14 address null modification times
  • Linux TUN/TAP:无法从 TAP 设备读回数据

    问题是关于如何正确配置想要使用 Tun Tap 模块的 Linux 主机 My Goal 利用现有的路由软件 以下为APP1和APP2 但拦截并修改其发送和接收的所有消息 由Mediator完成 我的场景 Ubuntu 10 04 Mach

随机推荐

  • mid360 SLAM 建图实现

    用别人分享的数据集试了下 室内建图问题不大 室外还不确定
  • Exynos4412 中断驱动开发(一)—— 中断基础及中断的注册过程

    一 中断基础概念 所谓中断 指CPU在执行程序的过程中 出现了某些突发事件即待处理 CPU必须暂停当前的程序 转去处理突发事件 处理完毕后CPU又返回原程序被中断的位置并继续执行 1 中断分类 a 内部中断和外部中断 根据中断的的来源 中断
  • (数据结构)树转换为二叉树、森林转换为二叉树、二叉树转换为树、二叉树转换为森林及树与森林的遍历

    1 树转换为二叉树 1 加线 在所有兄弟结点之间加一条线 2 去线 对树中每个结点 只保留它与第一个孩子结点的连线 删除它与其他孩子结点之间的连线 3 层次调整 以树的根结点为轴心 将整棵树顺时针旋转一定的角度 使之结构层次分明 注意第一个
  • 结束了在MSRA的实习

    从5月到11月底 总共在MSRA渡过了7个月的实习时光 这7个月似乎是我感觉过得最快的7个月 或许是一个人在北京 生活上没有太多的琐事 只有很单纯的工作 于是就有这种时光飞逝的感觉 当然 记忆里面也并非都是工作上的事情 在MSRA还认识来自
  • 通过External Tools在STM32CubeIDE下使用DAP-LINK

    目录 一 文章背景 二 准备工作 2 1 Stm32CubeIDE 2 2 DAP LINK 2 3 STM32目标板 三 配置过程 3 1 连接目标板 3 2 配置仿真器 3 3 更改调试设置为远程调试 3 4 新建OpenOcd扩展工具
  • 5种方法教你用Python玩转histogram直方图

    作者 xiaoyu 知乎 https zhuanlan zhihu com pypcfx 介绍 一个半路转行的数据挖掘工程师 直方图是一个可以快速展示数据概率分布的工具 直观易于理解 并深受数据爱好者的喜爱 大家平时可能见到最多就是 mat
  • 腾讯技术面经-后台-云计算虚拟化部门

    1 笔试 不区分 都是软开岗位 2个小时 一般1小时足够了 25道选择题 10道填空 还有2个选做题 涉及到操作系统 内存 HTTP协议 TCP UDP协议 LLR 0 LLR 1 数据结构 算法 C语言 协议 Ipv4
  • UE5学习笔记(一)——界面功能梳理&第一天知识点记录

    学习UE5的第一步 是软件安装 默认是安装好的 由于安装没有太多技术含量 所以就没有专门做记录 这里有个注意点 虚幻引擎是整合在Epic games launcher中的 也就是说开发引擎内嵌在游戏平台上 打个比方 就是如果你要下unity
  • SpringBoot项目拦截器过滤器配置

    1 我们在配置拦截器时需实现接口HandlerInterceptor package com example springbootdemo common conf interceptor import com example springb
  • QT窗体间传值总结

    在写程序时 难免会碰到多窗体之间进行传值的问题 依照自己的理解 我把多窗体传值的可以使用的方法归纳如下 1 使用QT中的Signal Slot机制进行传值 2 使用全局变量 3 使用public形式的函数接口 4 使用QT中的Event机制
  • pytesseract和PIL库用法是什么?【详细教程】

    Tesseraet是一个命令行工具 安装后只能通过tsseraet命令在Python的外部运行 而不能通过import语句引人使用 为了解决上述问题 Python 提供了支持Tssraec OCR引擎的Python版本的库pytessera
  • 04. 《Lombok 实战 —— @NoArgsConstructor, @RequiredArgsConstructor, @AllArgsConstructor》

    文章目录 Lombok 实战 NoArgsConstructor RequiredArgsConstructor AllArgsConstructor 1 NoArgsConstructor 1 1 NoArgsConstructor 实战
  • 夯实C++基础之刷题:链表——3合并两个有序列表

    题目 解题 递归和迭代 我的理解 递归是自己调用自己 迭代是按思路往下走 1 递归 class Solution public ListNode mergeTwoLists ListNode list1 ListNode list2 递归
  • 敏捷开发概述

    一 历史背景 20世纪60年代 软件规模小 已作坊式开发为主 20世纪70年代 硬件快速发展 软件规模和复杂度不同以往 引发软件危机 20世纪80年代 引入瀑布模型 以过程为中心分阶段控制软件开发 20世纪90年代 软件开发过程日益变重 开
  • mysql清缓存、查看连接数及链接时间

    mysql清缓存 查看连接数及链接时间 flush privileges 刷新缓存 SHOW FULL processlist 查看连接数据库的进程id ip 用户名 连接的数据库 连接状态 连接时长等 show variables lik
  • Node.js程序如何建立及使用Model

    建立Model 直接使用Sequelize虽然可以 但是存在一些问题 团队开发时 有人喜欢自己加timestamp var Pet sequelize define pet id type Sequelize STRING 50 prima
  • Unity中loading页加载的实现

    首先创建一个Global cs 使用单例用于存储场景的名字 便于后续脚本的调用 此脚本不必挂载在游戏物体上 using UnityEngine using System Collections public class Global Mon
  • Eclipse项目上有红色的叉或感叹号

    Eclipse中导入的项目没有报错 甚至都能正常运行 但就是会有一个红色的 或 对于一个有强迫症的我 忍不了 下面怎么解决 我提供一个平时解决的方法 首先 这个报错是IDE工具的报错 先找到报错描述 window gt show view
  • Go语言学习路线

    gogogo git 地址 Go 学习 学习路线 2 基础知识 3 开发工具安装地址 下载 Go基础知识 链接为gitee地址 放心查看 基础结构 learn1 go 基础语法 learn2 go 数据类型 learn3 go 变量 lea
  • mkfs.xfs: cannot open /dev/sdb1: Device or resource busy 设备或资源忙

    今天在centos下用xfs格式化磁盘出现如下错误 mkfs xfs cannot open dev sdb1 Device or resource busy 设备或资源忙 时出现 重启服务器后再格式化也一样 也就是重启服务器没什么用 用l