Fix Docker ‘No Space Left on Device’ on VMware by Expanding LVM Partitions
When a VMware VM with a 200 GB system disk runs an 11 GB Docker service, it may report ‘no space left on device’ because the LVM logical volume for /var is only 1 GB, and the guide shows how to extend the relevant LVM volumes and resize the filesystems to resolve the issue.
Problem Description
A VMware‑created server was allocated a 200 GB system disk, but starting an ~11 GB Docker service fails with the error no space left on device. The underlying cause is that the logical volume used for Docker’s isolation (mounted at /var) is only 1 GB.
Investigation
Check the disk and LVM layout:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 1T 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 199G 0 part
├─VolGroup00-LogVol03 253:0 0 30G 0 lvm /
├─VolGroup00-LogVol00 253:1 0 15.7G 0 lvm [SWAP]
├─VolGroup00-LogVol02 253:2 0 1G 0 lvm /var
└─VolGroup00-LogVol01 253:3 0 1G 0 lvm /tmp
sr0 11:0 1 1.5G 0 romThe root filesystem resides on VolGroup00-LogVol03 (30 GB). The Docker isolation volume /var is backed by VolGroup00-LogVol02, which is only 1 GB, causing the space shortage.
Solution – Expand System Partition
Extend the root logical volume by 100 GB:
lvextend -L +100G /dev/VolGroup00/LogVol03
# Output
Size of logical volume VolGroup00/LogVol03 changed from 30.00 GiB (7680 extents) to 130.00 GiB (33280 extents).
Logical volume VolGroup00/LogVol03 successfully resizedResize the filesystem to use the new space:
resize2fs /dev/VolGroup00/LogVol03
resize2fs 1.46.4 (18-Aug-2021)
Filesystem at /dev/VolGroup00/LogVol03 is mounted on /; on-line resizing required
old_desc_blocks = 4, new_desc_blocks = 17
The filesystem on /dev/VolGroup00/LogVol03 is now 34078720 (4k) blocks long.Verify the changes:
lsblk
... (shows LogVol03 now 130G)
df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol03 ext4 128G 17G 106G 14% /Solution – Expand Docker Isolation Volume
Extend VolGroup00-LogVol02 (the /var volume) by 50 GB:
lvextend -L +50G /dev/VolGroup00/LogVol02
Size of logical volume VolGroup00/LogVol02 changed from 1.00 GiB (256 extents) to 51.00 GiB (13056 extents).
Logical volume VolGroup00/LogVol02 successfully resized.Resize its filesystem:
resize2fs /dev/VolGroup00/LogVol02
resize2fs 1.46.4 (18-Aug-2021)
Filesystem at /dev/VolGroup00/LogVol02 is mounted on /var; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 7
The filesystem on /dev/VolGroup00/LogVol02 is now 13369344 (4k) blocks long.Confirm the new capacity:
df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol02 ext4 51G 66M 49G 1% /varAfter extending both the root and Docker’s /var logical volumes and resizing their filesystems, Docker can now start without encountering the “no space left on device” error.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
