问题解决:pvcreate过程中错误Device /dev/sdb not found (or ignored by filtering)

问题解决:pvcreate过程中错误Device /dev/sdb not found (or ignored by filtering)在 pvcreate 创建物理卷时出错 Device dev sdbnotfound 我的报错情况没有 orignoredbyf 原因说明 显然 在 dev 目录下应该是要存在一个硬盘分区的 即 dev sdb 接下来我分两种情况来说明这个问题 解决 第一种情况 先列出硬盘分区 root centos7 fdisk lDisk d

在pvcreate创建物理卷时出错:Device /dev/sdb not found.我的报错情况没有(or ignored by filtering)

原因说明:显然,在/dev/目录下应该是要存在一个硬盘分区的,即/dev/sdb。接下来我分两种情况来说明这个问题。

解决:

第一种情况:

①先列出硬盘分区:

[root@centos7 ~]# fdisk -l Disk /dev/vda: 42.9 GB,  bytes,  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 label type: dos Disk identifier: 0x0008e2e1 Device Boot Start End Blocks Id System /dev/vda1 * 2048  + 83 Linux Disk /dev/vdb: 50.5 GB,  bytes,  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

从列出的信息可以看到,我事先分配的硬盘分区为:/dev/vdb.但是没有sdb,那么我就改用vdb了。虽然有分区了,但是需要经过一系列操作才能生效。

②如下:

[root@centos7 ~]# fdisk /dev/vdb Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0xec0e9e9e. Command (m for help): p Disk /dev/vdb: 50.5 GB,  bytes,  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 label type: dos Disk identifier: 0xec0e9e9e Device Boot Start End Blocks Id System Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): Using default response p Partition number (1-4, default 1): 1 First sector (2048-, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-, default ): Using default value  Partition 1 of type Linux and of size 47 GiB is set Command (m for help): p Disk /dev/vdb: 50.5 GB,  bytes,  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 label type: dos Disk identifier: 0xec0e9e9e Device Boot Start End Blocks Id System /dev/vdb1 2048   83 Linux Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.

其中按提示操作 p打印  n新增 d 删除 w操作生效 q退出。

③查看分区是否完成分配。

[root@centos7 ~]# fdisk -l Disk /dev/vda: 42.9 GB,  bytes,  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 label type: dos Disk identifier: 0x0008e2e1 Device Boot Start End Blocks Id System /dev/vda1 * 2048  + 83 Linux Disk /dev/vdb: 50.5 GB,  bytes,  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 label type: dos Disk identifier: 0xec0e9e9e Device Boot Start End Blocks Id System /dev/vdb1 2048   83 Linux

可以看到,出现了/dev/vdb1分区表已成功分配。

④更新分区表,并查看系统是否接收新的分区表。

[root@centos7 ~]# partprobe [root@centos7 ~]# cat /proc/partitions major minor  #blocks  name  253        0    vda  253        1    vda1  253       16    vdb  253       17    vdb1

上述信息出现vdb的两条信息说明已成功更新分区表。

⑤格式化新加的分区表

[root@centos7 ~]# mkfs.ext3 /dev/vdb1 mke2fs 1.42.9 (28-Dec-2013) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks  inodes,  blocks  blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks= 376 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, , , , , , , , , ,  Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done

那么到此就完成了,我的目标是完成硬盘分区来创建物理卷。

⑥查看系统有无PV

[root@centos7 ~]# pvscan   No matching physical volumes found

没有。

⑦这里我将刚才创建的分区 /dev/vdb1作为物理卷。

[root@centos7 ~]# pvcreate /dev/vdb1 WARNING: ext3 signature detected on /dev/vdb1 at offset 1080. Wipe it? [y/n]: y   Wiping ext3 signature on /dev/vdb1.   Physical volume "/dev/vdb1" successfully created.

⑧再次查看

[root@centos7 ~]# pvscan PV /dev/vdb1 lvm2 [<47.00 GiB] Total: 1 [<47.00 GiB] / in use: 0 [0 ] / in no VG: 1 [<47.00 GiB] [root@centos7 ~]# pvdisplay "/dev/vdb1" is a new physical volume of "<47.00 GiB" --- NEW Physical volume --- PV Name /dev/vdb1 VG Name PV Size <47.00 GiB Allocatable NO PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID p9pkiw-Pd5G-mKFY-eTqw-xYEv-56tJ-SLa4te

 成功。

⑨查看物理卷组,发现没有,并创建volume group 为stack-volumes-lvmdriver-1

[root@centos7 ~]# vgs [root@centos7 ~]# vgcreate stack-volumes-lvmdriver-1 /dev/vdb1 Volume group "stack-volumes-lvmdriver-1" successfully created [root@centos7 ~]# vgs VG #PV #LV #SN Attr VSize VFree stack-volumes-lvmdriver-1 1 0 0 wz--n- <47.00g <47.00g

完成。。。

如果想挂载硬盘到某个目录下,请继续。。。

⑩挂载硬盘到某一目录下,比如是/mnt.

# cd /mnt/ # mkdir home 挂载到/mnt/home # mount /dev/vdb1 /mnt/home 查看 # df -h 把home下的东西拷到挂载的目录下,备份 # cp -a /home/* /mnt/home/ 把home下的东西删干净 # rm -rf /home/* 卸载硬盘 # umount /dev/vdb1 查看 # df -h

设置开机挂载

# vi /etc/fstab 末尾增加一行 /dev/vdb1  /mnt/home  ext3  defaults  1  2 保存退出 查看 /home是否被挂载 # df -h 挂载/etc/fstab 中未挂载的分区 # mount -a 查看 # df -h

第二种情况:这也是网上的很多方式,这里推荐https://blog.csdn.net/sdu_king/article/details/。

最后推荐几篇博文:

LINUX磁盘分区、格式化、挂载、卸载全程详解

Linux 如何将一块硬盘进行挂载到任意目录下

增加一块新硬盘,如何把它挂载到/home目录 从而扩大home空间

总有一款适合你:)

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/220137.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 下午9:09
下一篇 2026年3月17日 下午9:09


相关推荐

  • 锂电池充电IC_锂电池充电器电路

    锂电池充电IC_锂电池充电器电路HE4484E是一款5VUSB适配器输入,高精度双节锂离子电池充电管理芯片。具有0V充电功能,涓流充电、恒流充电、恒压充电和自动截止、自动再充等一套完整充电循环的充电管理芯片。芯片内部特设9V抗浪涌,芯片应用更安全可靠。HE4484E标准浮充电压为8.40V,其底部带有散热片接地的ESOP8封装,极其精简的外部器件,使得HE4484E成为便携式双节锂锂电池充电应用的理想选择。HE4484E适合USB适配器或其它5V适配器工作,极大降低了外部配件成本。当输入电压(USB电源或AC适配器)被拿掉时,HE4484

    2022年10月6日
    3
  • outputstreamwriter用法_floating power object

    outputstreamwriter用法_floating power object写这个类的原因,网上有很多介绍这两个类的,InputStreamReader类的使用,没有任何异议,而OutputStreamWriter,看了网的帖子和博客说的都不是很清楚,所以小皮虾好好研究了一下OutputStreamWriter类,所以下面的总结有不对之处,欢迎指正!api类中解释:InputStreamReader是字节流通向字符流的桥梁,将字节流转换为字符流

    2025年8月28日
    13
  • 批处理 for命令_文件批处理命令

    批处理 for命令_文件批处理命令对所有的批处理初学者来说,for的应用是最难理解以及掌握的。本文由浅入深,为大家专门讲解for的用法,希望大家喜欢。首先应该明确的是,for不是一个简单的命令,它的用法比较复杂,它还可以带四个参数(/L/D/R/F),其中:/L和/F参数是最经常用到的。当然,它本身也可以不带参数,下面我们通过具体的例子来讲解for的运用。一、不带参数的for:@echo

    2022年10月12日
    3
  • 脏读、幻读与不可重复读[通俗易懂]

    脏读、幻读与不可重复读

    2022年2月17日
    56
  • 前端笔记-echarts加载bmap地图

    前端笔记-echarts加载bmap地图程序运行截图如下 这里首先要申请个百度地图密钥使用下面的方式输入密钥 这里使用 jsonp 的方式源码如下 html head title title scriptsrc echarts js scriptsrc echarts js head html

    2026年3月26日
    2
  • Java使用OSS实现上传文件

    Java使用OSS实现上传文件

    2021年11月12日
    53

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号