Windows program claims no disk free space under Wine

wine

A Windows game refuses to save any games because it claims there's no disk space free. I've used XP and 98 modes in winecfg, and this is a 32-bit wineprefix (at least, I'm pretty sure it is; not sure how to confirm). My suspicion is that it's the old favourite problem of having more than 2GB free space, for which we used to have a little fix script back when we used OS/2 and there were DOS programs that had trouble. Is there a way to get Wine to announce less disk space than there actually is?

edit for version numbers: Debian Testing (Stretch), Wine 1.8.5 as distributed by Debian.

Best Answer

Without much knowledge of Wine, I'd work around that problem making the program happy and giving it a disk that is smaller than 2 GB.

It's very simple. First, create a file filled with 0s that is 512 MB (or more, but less than 2048):

dd if=/dev/zero of=smalldisk.img bs=1M count=512

Next, format it using the default file system:

mkfs smalldisk.img

Move the existing directory to a temporary name:

mv .wine-demo .wine-demo-orig

Mount the new disk as a loop device at the original location:

sudo mount smalldisk.img .wine-demo
sudo chown your-user-name: .wine-demo

Copy the entire tree in:

cp -r .wine-demo-orig/* .wine-demo

And run the program from there. If it still doesn't work, then you'll need a different solution.

(There is, unfortunately, a chance that it won't work. If it can't handle 2 GB of disk space, it will probably not handle 2 GB of RAM...)

Provided it works, I suggest your unmount it and put it in your /etc/fstab:

/path/to/smalldisk.img /path/to/mount ext4 auto,noexec,rw,loop,fmask=0177,dmask=0077,user 0 0

In this line fmask and dmask are mask permissions for files and directories. Notice that they are the opposite of what you would use with chmod. That is, 7 stands for no permissions (---) and 0 stands for full permissions (wrx). Read more here: fstab Permission Masks Explained.

Related Question