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
    • 最新
    • 标签
主页 / computer / 问题 / 1449834
Accepted
KidACrimson
KidACrimson
Asked: 2019-06-18 14:43:05 +0800 CST2019-06-18 14:43:05 +0800 CST 2019-06-18 14:43:05 +0800 CST

CentOS 7虚拟机似乎无法扩展/dev/mapper/centos-root LV

  • 772

我的空间一直不足/dev/mapper/centos-root作为临时修复,我删除了我正在使用的文件/目录,但这阻碍了我的工作效率。一开始我应该让 CentOS VM 大于 20 GB,但现在为时已晚。我关闭了 VM 并向 VMDK (vDisk) 添加了 20GB,但我似乎无法让操作系统在我需要的地方使用它,它位于/dev/mapper/centos-root 逻辑卷中

这是输出lsblk:

    root@CentOS-7:/# lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda               8:0    0   30G  0 disk
├─sda1            8:1    0    1G  0 part /boot
└─sda2            8:2    0   29G  0 part
  ├─centos-root 253:0    0   17G  0 lvm  /
  └─centos-swap 253:1    0    2G  0 lvm  [SWAP]
sr0              11:0    1 1024M  0 rom

pgs vgs和lvs命令的输出:

    root@CentOS-7:/# pvs
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda2  centos lvm2 a--  <19.00g    0
root@CentOS-7:/# vgs
  VG     #PV #LV #SN Attr   VSize   VFree
  centos   1   2   0 wz--n- <19.00g    0
root@CentOS-7:/# lvs
  LV   VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root centos -wi-ao---- <17.00g
  swap centos -wi-ao----   2.00g

如您所见,我有 10 GB 的未分配空间。我需要将它应用到逻辑卷,但到目前为止我尝试的一切都失败了。我想我没有可用的使用范围,但我不确定。我在存储 VM 的主机上有足够的空间,我只需要知道如何实际让操作系统使用它。

在此处输入图像描述

virtual-machine storage
  • 1 1 个回答
  • 2291 Views

1 个回答

  • Voted
  1. Best Answer
    KidACrimson
    2019-06-19T13:28:59+08:002019-06-19T13:28:59+08:00

    固定的。交换分区挡住了路。一旦我删除它,我就可以/dev/mapper/centos-root像这样扩展:

    #Delete & Create new volume
    root@CentOS-7:/# fdisk /dev/sda
    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.
    
    Command (m for help): d
    Partition number (1,2, default 2):
    Partition 2 is deleted
    
    Command (m for help): p
    
    Disk /dev/sda: 96.6 GB, 96636764160 bytes, 188743680 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: 0x000b14c7
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048     2099199     1048576   83  Linux
    /dev/sda2         2099200   125829119    61864960   8e  Linux LVM
    
    Command (m for help): n
    Partition type:
       p   primary (2 primary, 0 extended, 2 free)
       e   extended
    Select (default p):
    Using default response p
    Partition number (3,4, default 3):
    First sector (125829120-188743679, default 125829120):
    Using default value 125829120
    Last sector, +sectors or +size{K,M,G} (125829120-188743679, default 188743679):
    Using default value 188743679
    Partition 3 of type Linux and of size 30 GiB is set
    
    Command (m for help): t
    Partition number (1-3, default 3):
    Hex code (type L to list all codes): 8e
    Changed type of partition 'Linux' to 'Linux LVM'
    
    Command (m for help): wq
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    
    WARNING: The kernel still uses the old table. The new table will be used at
    the next reboot or after you run partprobe(8) or kpartx(8)
    Syncing disks.
    

    然后我跑了...

    pvresize /dev/sda2
    lvextend /dev/mapper/centos-root -l +100%FREE
    xfs_growfs /dev/mapper/centos-root
    
    • 1

相关问题

  • 无法从 App Store 下载 xCode (Mojave VM Ware)

  • 来宾运行时主机 MacOS 自动更新后虚拟框 linux 来宾死机

  • vmwared 共享文件夹不工作

  • virtualbox 是否需要 CPU 来支持 VT-d 以托管 64 位客户操作系统?

  • VMware Workstation USB 仲裁服务无法自动启动

Sidebar

Stats

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

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    Windows 10 服务称为 AarSvc_70f961。它是什么,我该如何禁用它?

    • 2 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Marko Smith

    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1056)

    • 4 个回答
  • Marko Smith

    我如何知道 Windows 安装在哪个驱动器上?

    • 6 个回答
  • Martin Hope
    Albin 支持结束后如何激活 WindowsXP? 2019-11-18 03:50:17 +0800 CST
  • Martin Hope
    fixer1234 “HTTPS Everywhere”仍然相关吗? 2019-10-27 18:06:25 +0800 CST
  • Martin Hope
    Kagaratsch Windows 10 删除大量小文件的速度非常慢。有什么办法可以加快速度吗? 2019-09-23 06:05:43 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    Inter Sys Ctrl+C 和 Ctrl+V 是如何工作的? 2019-05-15 02:51:21 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve