Solaris add swap file

Well the process is as simple as using ls to list files. But even there, I can screw up.

1. mkfile 1024m <filename>
    Units for the size can be kilobytes (k), blocks (b), or megabytes (m).
2. swap -a <complete file path>
3. swap -l (to list the swaps)

Now the problem is I created the file using my local user and was trying to add it as swap. I kept on getting the following error:
It must be a block device or a regular file with the “save user text on execution” bit set.

Finally, after half an hour of googling and leading nowhere, I decided to do everything as root. Voila!

So the steps are:
1. mkfile 1024m <filename>     (as root)
    Units for the size can be kilobytes (k), blocks (b), or megabytes (m).
2. swap -a <complete file path>     (as root)
3. swap -l (to list the swaps)     (as root)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s