Currently my MacOS Catalina is installed onto my SSD. I have 128GB SSD and 3TB HDD. Half space of the SSD and large part of the HDD will be used for Linux that I am going to install. For MacOS I have around 60GB available on SSD and around 1.2TB on HDD.
I am looking for the best way (or all possible ways) to make my MacOS saving content of my VM partition (kernelcore, sleepimage and swap files) on my HDD. I am looking for a way to either:
- remove VM partition completely, force system to use /vm folder instead (not disk) as it used to be in the past, save /vm on HDD and make symlink to it on SSD in /private/var/
- remove VM partition completely, make another VM partition on my HDD (disk3s1), and use that one instead
- remove VM partition completely, use my whole MacOS partition (that is already being used for my user account - disk1s2) that resides on my HDD to save virtual memory files onto it
My disks list:
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *121.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk2 60.5 GB disk0s2
3: Linux Filesystem 60.6 GB disk0s3
/dev/disk1 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *3.0 TB disk1
1: EFI NO NAME 536.9 MB disk1s1
2: Apple_HFS MacOS HDD 1.2 TB disk1s2
3: Apple_APFS Container disk3 29.5 GB disk1s6
4: Linux Filesystem 1.3 TB disk1s3
5: Linux Filesystem 500.1 GB disk1s4
/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +60.5 GB disk2
Physical Store disk0s2
1: APFS Volume MacOS SSD – dane 5.5 GB disk2s1
2: APFS Volume Preboot 86.1 MB disk2s2
3: APFS Volume Recovery 529.0 MB disk2s3
4: APFS Volume VM 2.1 GB disk2s4
5: APFS Volume MacOS SSD 11.2 GB disk2s5
/dev/disk3 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +29.5 GB disk3
Physical Store disk1s6
1: APFS Volume VM 897.0 KB disk3s1
I found similar question here, however I can't make it working with the "UPDATE: Simpler method". I can't mount anything by using the fstab - when I did as it was described in the question from the link, my disk appears as unmounted and can't be mounted due to an error (Error com.apple.DiskManagement.disenter: 49218). Also I can't unmount the original VM disk:
diskutil unmount /dev/disk2s4
Volume VM on disk2s4 failed to unmount: dissented by PID 0 (kernel_task)
With sudo prefix, it just freezes the terminal.
Also mounting a volume didn't work when I tried:
sudo diskutil mount -mountPoint /volumes/ disk3s1
Volume on disk3s1 failed to mount
Perhaps the operation is not allowed by the invoking user (kDAReturnNotPrivileged)
This appears to be an APFS Volume; note that locked APFS volumes
will not mount unless unlocked (e.g. "diskutil apfs unlockVolume")
I also tried to mount to /private/var/vm with the same result. Volume is not locked - when I tried unlockVolume.
At the end I can add that when I eddied fstab by adding this line:
UUID=<disk2s4 UUID here> none hfs rw,noauto
it still mounted to /private/var/vm.