【问题标题】:Increasing disk size in Vagrant archlinux using resize2fs使用 resize2fs 在 Vagrant archlinux 中增加磁盘大小
【发布时间】:2020-10-12 19:35:08
【问题描述】:

我目前正在运行一个带有 archlinux 的 Vagrant box 用于开发目的。我想超过 2GB,所以我安装了 vagrant-disksize 插件,在 ssh 进入盒子并更改分区大小后,我按照 here 的建议运行了 resize2fs。

但是,当我这样做时,我收到以下错误:

resize2fs: Device or resource busy while trying to open /dev/sdax
Couldn't find valid filesystem superblock.

这是手册页中关于 resize2fs 的内容:

如果文件系统被挂载,它可以用来扩展文件系统的大小 挂载的文件系统,假设内核和文件系统支持 在线调整大小。

如何在我的 archlinux 机器上使用 resize2fs

【问题讨论】:

    标签: vagrant archlinux partition btrfs


    【解决方案1】:

    tldr:resize2fs 不适用于 btrfs

    分辨率:

    在调查了这个问题后,我发现archlinux Vagrant box 设置为btrfs 而不是ext4。如果你想在 Vagrant/VirtualBox 和 Arch Linux 上扩展你的磁盘大小,你将不得不这样做。

    要遵循的步骤

    1. 通过以下方式增加物理磁盘大小:1. 使用 Vagrant disk-resize plugin,2. 使用 VBoxManage 手动卸载和克隆驱动器,或者 3. 激活 Vagrant 实验功能标志(2020 年 10 月)。

    2. 使用{,c}fdiskparted 调整操作系统内的分区大小。

    3. 使用lsblk --fs 检查分区上的文件系统。如果你碰巧在 btrfs 上运行,你将无法使用resize2fs。你必须通过 btrfs filesystem resize max / (the mount point)

    一些可能有用的链接:

    https://www.suse.com/support/kb/doc/?id=000018798

    https://gist.github.com/christopher-hopper/9755310

    https://askubuntu.com/questions/317338/how-can-i-increase-disk-size-on-a-vagrant-vm

    【讨论】:

      猜你喜欢
      • 2019-05-03
      • 1970-01-01
      • 1970-01-01
      • 2022-10-18
      • 1970-01-01
      • 2022-11-25
      • 1970-01-01
      • 2023-01-24
      • 1970-01-01
      相关资源
      最近更新 更多