2

TL;DR: VirtualBox VM running Ubuntu doesn't seem to recognize virtual hard drive size. How to fix? FWIW, I used to run this same setup on VirtualBox 5.2 with Ubuntu 16.04 and MySQL 5.6 and never had any problems of this sort.


I just got a new hard drive with a clean Windows 10 install, and installed my regularly-used programs for development, including VirtualBox. I created a virtual machine running Ubuntu 18.04 Server to host my LAMP stack for my dev environment.

While trying to run my create script (MySQL) that imports my database backup of my live database, it runs into a disk space problem and reports two errors:

ERROR 1114 (HY000): The table 'trial' is full

And:

ERROR 3 (HY000): Error writing file './dbname/#sql-52b_13.frm' (Errcode: 28 - No space left on device)

After running into those two errors, I can't even start MySQL anymore. I thought it was a config problem, but when I went to edit the config file I couldn't even use tab to auto-complete the name of the file, because apparently that also requires disk space (who knew?).

Here's the kicker: when I created the VM, I created a static 30GB virtual hard drive (.vdi for VirtualBox Disk Image) for it - far more than I should ever need for this project. When I look at the used space on the hard drive, it doesn't show nearly that much being used. It's as if the OS doesn't recognize the size of its hard drive. The largest file system it shows is only 3.9GB

df -h output:

Filesystem                         Size  Used Avail Use% Mounted on
udev                               967M     0  967M   0% /dev
tmpfs                              200M  988K  199M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv  3.9G  3.7G     0 100% /
tmpfs                              997M     0  997M   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              997M     0  997M   0% /sys/fs/cgroup
/dev/loop0                          87M   87M     0 100% /snap/core/4917
/dev/loop1                          90M   90M     0 100% /snap/core/6818
/dev/sda2                          976M  143M  767M  16% /boot
tmpfs                              200M     0  200M   0% /run/user/1000

Here are my setup details:

  • Host: Windows 10 Home (Version 10.0.17763)
  • Host HDD: 1TB
  • .vdi File Size (as shown in host File Explorer): 30.0 GB (31,459,328 KB)
  • VirtualBox: Version 6.0.6 (the most recent)
  • VM OS: Ubuntu 18.04 (Bionic Beaver)
  • VM Hard Drive: 30 GB .vdi (static)
  • VM RAM: 2GB allotted
  • MySQL: Version 5.7
  • Database Dump .sql File Size: ~75 MB (uncompressed plain text)

Edit

Thomas Ward's comment below is correct. Rather than fight with the LVM and trying to get that to work, I decided to scrap that VM and do a fresh install without using Ubuntu 18.04's LVM.

2
  • You installed with LVM didnt you. There is a known issue in the 18.04 Ubuntu Server installers where they wont provision more than 4GB for the LVM. Expand the PV and VG in the LVM to fill the rest of the drive allotment given then the problem will be resolved. Commented May 2, 2019 at 11:47
  • your root on /dev/mapper/ubuntu--vg-ubuntu--lv has only 3.9G of space
    – phuclv
    Commented Jun 23, 2021 at 1:04

1 Answer 1

0

I've recently had a similar issue and because you seem to have resolved yours, I want to add something that might help others and should've helped you.

The df -h output indicates that some of your partitions, as I understand it, are full. To resize them, I mostly followed this tutorial (at least until the full setup of GParted). Once you have increased the size of your virtual hard drive (if it is big enough already, but the free space is just unassigned, you don't need to do that) you can use GParted to assign unassigned space on the drive to certain partitions / increase the size of partitions of your choice.

A few things to keep in mind while doing that:

  1. Never change the position of the boot partition.
  2. You can only assign unassigned space to a directly preceding partition.
  3. To increase the size of a partition that is wrapped between other partitions, you have to "move" an arbitrary chunk of unassigned space through the partitions by changing the size of "Free space preceding", of a partition adjacent to unassigned space, to the size of "Free Space following" and the size of "Free space following" to zero. If you do that until the unassigned space is subsequent to the partition you want to increase the size of, you can just increase the size of that partition by the size of the unassigned space.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .