AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 838436
Accepted
Toodarday
Toodarday
Asked: 2016-10-18 09:42:53 +0800 CST2016-10-18 09:42:53 +0800 CST 2016-10-18 09:42:53 +0800 CST

如何扩展我的 LVM 分区

  • 772

我已经在机器上安装了 Proxmox。我需要扩展/dev/mapper/pve-data未使用的空间/dev/sdb5

我怎样才能做到这一点?

fdisk -l

Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram1: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram2: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram3: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram4: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram5: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram6: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram7: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram8: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram9: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram10: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram11: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram12: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram13: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram14: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xfbd89a5c

Device     Boot    Start       End   Sectors  Size Id Type
/dev/sda1  *        4096  40962047  40957952 19.5G 83 Linux
/dev/sda2       40962048  43057151   2095104 1023M 82 Linux swap / Solaris
/dev/sda3       43057152 468854783 425797632  203G  f W95 Ext'd (LBA)
/dev/sda5       43059200 468854783 425795584  203G 8e Linux LVM

Disk /dev/sdb: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xafd793e2

Device     Boot    Start       End   Sectors  Size Id Type
/dev/sdb1           4096  40962047  40957952 19.5G fd Linux raid autodetect
/dev/sdb2       40962048  43057151   2095104 1023M 82 Linux swap / Solaris
/dev/sdb3       43057152 468854783 425797632  203G  f W95 Ext'd (LBA)
/dev/sdb5       43059200 468854783 425795584  203G fd Linux raid autodetect

Disk /dev/mapper/pve-data: 199 GiB, 213708177408 bytes, 417398784 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
partitioning
  • 1 1 个回答
  • 751 Views

1 个回答

  • Voted
  1. Best Answer
    Jorgen
    2016-10-18T10:27:00+08:002016-10-18T10:27:00+08:00

    问题中有趣的信息是 和pvs的vgs输出lvs。

    但是,如果我采取一些谨慎的猜测,我会猜你VG的名字是pve,你的名字lv是data。当前的物理卷是/dev/sda5,并且您使用完整的分区作为您的逻辑卷data。我还假设 /dev/sdb5 不包含任何数据,所以我们不会冒险丢失任何东西?

    我将从将分区类型更改为/dev/sdb5fromLinux raid autodetect 开始Linux LVM。

    您可以使用 fdisk 执行此操作。

    # fdisk /dev/sdb
    Command (m for help): t
    Partition number (1-5): 5
    Hex code (type L to list codes): 8e
    Changed system type of partition 5 to 8e (Linux LVM)
    Command (m for help): w
    

    然后你pvcreate用来制作一个新的物理卷:

    # pvcreate /dev/sdb5
    

    您现在应该在键入时列出 2 个物理卷pvs

    # pvs
    PV         VG        Fmt  Attr PSize  PFree
    /dev/sda5  pve       lvm2 a--  xx.xxg xx.00m
    /dev/sdb5            lvm2 a--  xx.xxg xx.00m
    

    下一步是将新的物理卷添加到您的卷组中,pve. 您可以通过扩展卷组来做到这一点, by /dev/sdb5, with vgextend。

    # vgextend pve /dev/sdb5
    

    如果您现在列出有关您的卷组的信息,vgs您应该会看到您拥有的可用空间大小为/dev/sdb5

    # vgs
    VG        #PV #LV #SN Attr   VSize  VFree
    pve       1   1   0 wz--n- xx.xxg xx.00m
    

    要扩展逻辑卷data,请使用命令lvextend。如果您希望使用所有可用的可用空间,您可以这样做:

    lvextend -rl +100%FREE pve/data
    

    如果您只想使用一些可用空间来扩展它,您可以这样做:

    lvextend -rL +50G pve/data
    

    -r 选项为您调整文件系统的大小,因此您不必在之后手动执行此操作。

    • 2

相关问题

  • 是否有更好的方式为 /home/userX 构建分区/挂载

  • Linux 文件系统层次结构中的默认目录是什么意思?

  • 如何将 /usr 移动到新分区?

  • 如何从双启动计算机访问加密的主文件夹?

  • 您对台式机和家庭服务器的驱动器分区方案有什么建议?[关闭]

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve