I'm trying to add a swap file on Solaris 10. I have already created a 2GB file
swap.file. Then, I add a swap file with the command:
swap -a /swap.file
which shows an error:
/swap.file: size is invalid
What am I doing wrong?
You are likely running a 32 bit kernel. You can just create 2 x 1 GB swap files and add them separately.
Also, for this setting to survive a reboot, you'll also need to add lines to the /etc/vfstab file, eg: