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.
/dev/mapper/ubuntu--vg-ubuntu--lv
has only 3.9G of space