Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com Jul 11 '12 at 12:30

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

You are likely running a 32 bit kernel. You can just create 2 x 1 GB swap files and add them separately.

# rm /swap.file
# /usr/sbin/mkfile 1024m /swap1
# /usr/sbin/mkfile 1024m /swap2
# /usr/sbin/swap -a /swap1
# /usr/sbin/swap -a /swap2

Also, for this setting to survive a reboot, you'll also need to add lines to the /etc/vfstab file, eg:

/swap1 - - swap - no -
/swap2 - - swap - no -
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.