/dev/sdb1 is apparently in use by the system; will not make a 文件系统 here!

格式化磁盘分区报错

[root@localhost ~]# mke2fs -t ext4 /dev/sdb1mke2fs 1.42.9 (28-Dec-2013)
/dev/sdb1 is apparently in use by the system; will not make a 文件系统 here!

执行 dmsetup status,显示有lvm 逻辑卷

[root@localhost ~]# dmsetup statusvg1-lv1: 0 204800 linear

执行dmsetup remove_all

[root@localhost ~]# dmsetup remove_all

再次执行 mke2fs -t ext4 /dev/sdb1,格式化磁盘分区成功

[root@localhost ~]# mke2fs -t ext4 /dev/sdb1mke2fs 1.42.9 (28-Dec-2013)
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks65536 inodes, 262144 blocks13107 blocks (5.00%) reserved for the super user第一个数据块=0Maximum filesystem blocks=2684354568 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 
	32768, 98304, 163840, 229376Allocating group tables: 完成                            
正在写入inode表: 完成                            
Creating journal (8192 blocks): 完成
Writing superblocks and filesystem accounting information: 完成

[root@localhost ~]#