Disk full; Terminal in Recovery mode won’t delete files; boot kernel panics I’m in a pickle here. macOS Mojave, just updated the other day. I managed to fill my disk up while creating a .dmg, and the system froze. I rebooted. Kernel panic.

Boot to Recovery mode. Mount the disk. Open Terminal.

–bash–3.2# rm /path/to/large/file
rm: /path/to/large/file: No space left on device


Essentially the same issue as this Unix thread from ‘08!
https://www.unix.com/linux/69889-unable-remove-file-using-rm-disk-space-full.html

I’ve tried echo x &gt; /path/to/large/file, no good.

It’s borked. Does anyone have any suggestions that aren’t “wipe the drive and restore from your backup”?
In spite this post is old, I decided to leave my solution here to help community with one more approach. 

note: I wrote a medium with more description.

In my case, I din't have that extra partition available so, in recovery mode: 


Run the terminal

 
run diskutil list


 


Find the identifier of "VM" volume. In the case of the previous image is "disk1s5". You'll probably have "disk2s4"
delete the volume VM: 


diskutil apfs deleteVolume disk1s5 

(replace the disk1s5 for your VM identifier)


You are now able to remove files on "/Volumes/Macintosh HD"


I hope it helps someone.