linux 挂载报错解决方案集锦

  • Post author:
  • Post category:linux




Can’t initialize physical volume “/dev/sdb” of volume group “xxx” without -ff /dev/sdb: physical volume not initialized.

解决方案:

sudo pvcreate -ff -y /dev/sdb1



Can’t open /dev/sdb1 exclusively. Mounted filesystem?

解决方案:

查看物理卷(PV)的详细信息

sudo pvdisplay
ll /dev/mapper/
总用量 0
lrwxrwxrwx 1 root root       7 9月  21 10:14 ao-root -> ../dm-0
lrwxrwxrwx 1 root root       7 9月  21 10:14 ao-swap -> ../dm-1
crw------- 1 root root 10, 236 9月  21 10:14 control
lrwxrwxrwx 1 root root       7 9月  21 10:25 myvg1-mylv1 -> ../dm-2
sudo dmsetup remove myvg1-mylv1



xfs_growfs: /data is not a mounted XFS filesystem
sudo xfs_growfs /dev/myvg1/mylv1

不知道LV Path先查询

sudo lvdisplay
 --- Logical volume ---
  LV Path                /dev/myvg1/mylv1
  LV Name                mylv1
  VG Name                myvg1
  LV UUID                UDwj1D-EeHA-1t82-IRnk-8Re3-tlMK-2zxlg7
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2022-09-21 10:18:22 +0800
  LV Status              available
  # open                 1
  LV Size                1.46 TiB
  Current LE             383998
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:2



WARNING: Device for PV 6bnkEQ-UlDh-FgK0-Pl2A-l5tj-51D1-fxmzBD not found or rejected by a filter.

解决:

VG是VG Name,可以通过sudo pvdisplay命令查询

sudo vgreduce --removemissing VG



版权声明:本文为weixin_43933728原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。