我目前正在运行一个带有archlinux的Vagrant,用于开发目的。我想超越2GB,所以我安装了vagrant-disksize插件,并且在ssh‘’ing到方框中并改变分区大小之后,我按照建议运行了resize2fs。
但是,当我这样做时,我会得到以下错误:
resize2fs: Device or resource busy while trying to open /dev/sdax
Couldn't find valid filesystem superblock.下面是手册页对resize2fs的看法
如果安装了文件系统,则可以使用
来扩展已安装文件系统的大小,前提是内核和文件系统支持在线调整大小。
如何在archlinux盒中使用resize2fs?
发布于 2020-10-15 07:04:46
tldr:resize2fs不适用于btrfs
解决方案:
在调查了这个问题之后,我发现archlinux是用btrfs而不是ext4设置的。如果您想在Vagrant/VirtualBox和Arch上扩展磁盘大小,您必须这样做。
应遵循的步骤
disk-resize插件增加物理磁盘大小;2.使用VBoxManage手动卸载和克隆驱动器;3.激活Vagrant实验特性标志(oct )。()
使用parted.或
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
https://stackoverflow.com/questions/64324309
复制相似问题