Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

swapon(2) [bsd man page]

SWAPON(2)							System Calls Manual							 SWAPON(2)

NAME
swapon - add a swap device for interleaved paging/swapping SYNOPSIS
swapon(special) char *special; DESCRIPTION
Swapon makes the block device special available to the system for allocation for paging and swapping. The names of potentially available devices are known to the system and defined at system configuration time. The size of the swap area on special is calculated at the time the device is first made available for swapping. RETURN VALUE
If an error has occurred, a value of -1 is returned and errno is set to indicate the error. ERRORS
Swapon succeeds unless: [ENOTDIR] A component of the path prefix is not a directory. [EINVAL] The pathname contains a character with the high-order bit set. [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters. [ENOENT] The named device does not exist. [EACCES] Search permission is denied for a component of the path prefix. [ELOOP] Too many symbolic links were encountered in translating the pathname. [EPERM] The caller is not the super-user. [ENOTBLK] Special is not a block device. [EBUSY] The device specified by special has already been made available for swapping [EINVAL] The device configured by special was not configured into the system as a swap device. [ENXIO] The major device number of special is out of range (this indicates no device driver exists for the associated hardware). [EIO] An I/O error occurred while opening the swap device. [EFAULT] Special points outside the process's allocated address space. SEE ALSO
swapon(8), config(8) BUGS
There is no way to stop swapping on a disk so that the pack may be dismounted. This call will be upgraded in future versions of the system. 4th Berkeley Distribution March 9, 1986 SWAPON(2)

Check Out this Related Man Page

swapon(2)							System Calls Manual							 swapon(2)

Name
       swapon - add a swap device for interleaved paging/swapping

Syntax
       swapon(special)
       char *special;

Description
       The  system  call  makes the block device special available to the system for allocation for paging and swapping.  The names of potentially
       available devices are known to the system and defined at system configuration time.  The size of the swap area on special is calculated	at
       the time the device is first made available for swapping.

Restrictions
       There is no way to stop swapping on a disk so that the pack may be dismounted.

Diagnostics
       The system call succeeds unless:

       [ENOTDIR]      A component of the path prefix is not a directory.

       [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an entire pathname exceeded 1023 characters.

       [ENOENT]       The named device does not exist.

       [EACCES]       Search permission is denied for a component of the path prefix.

       [ELOOP]	      Too many symbolic links were encountered in translating the pathname.

       [EPERM]	      The caller is not the super-user.

       [ENOTBLK]      The special is not a block device.

       [EBUSY]	      The device specified by special has already been made available for swapping.

       [EINVAL]       The device configured by special was not configured into the system as a swap device.

       [ENXIO]	      The  major  device number of special is out of range.  (This indicates that no device driver exists for the associated hard-
		      ware.)

       [EIO]	      An I/O error occurred while opening the swap device.

       [EFAULT]       The special points outside the process's allocated address space.

See Also
       config(8), swapon(8)

																	 swapon(2)
Man Page

15 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

Paging and Swapping

Hi Guys: Would like to know how to check system swapping and paging and some theory on how they function. I am an oracle dba and my environment is 8171 on AIX 433. We have a 1GB of RAM on the box and I am educating myself to see how much more SGA can be accommodated on the box and what are the... (2 Replies)
Discussion started by: ST2000
2 Replies

2. UNIX for Dummies Questions & Answers

how to get swapping info

Hi How can I determine if swapping is occuring on a server. Thanks, Leo (2 Replies)
Discussion started by: leo
2 Replies

3. UNIX for Dummies Questions & Answers

how to see special characters in a file using vi

Hi, I have a file which has special characters. I can't see them when I "vi" the file. But I am sure there are some special un seen characters. How can I see them? Please help. Thx (6 Replies)
Discussion started by: jingi1234
6 Replies

4. UNIX for Dummies Questions & Answers

Replace Special characters in a file

Hi, I have a data like this in a file, 402003279034002000100147626030003300010000000000002000029000000 ær^M^\MÍW^H I need to replace those special char to some other char like # or $ Is there any ways to do it... I tried commands tr,sed and many but it was not able to replace because... (1 Reply)
Discussion started by: solai
1 Replies

5. UNIX for Advanced & Expert Users

virtual memory management, swapping paging

can anybody explain me the concepts virtual memory mangement, swapping and paging? although i roughly know what they are , i need more solid distinction between them, and also i want to figure out the relations between them? do you have any well-defined definitons for this concepts? (2 Replies)
Discussion started by: gfhgfnhhn
2 Replies

6. UNIX for Dummies Questions & Answers

Special Characters in directory name

Hi all, I've got a couple of directorys with special chars in the name: # ls -q personnel?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D?[D unilive_?[B?[H?[L?[F?[L?[L?[Lpwd I do not know how to get into these... (6 Replies)
Discussion started by: tez
6 Replies

7. AIX

paging space out high

Hello, we have a problem with lpar with AIX 5.3, the issue is that has high level paging space with: _sqlsrv2 and its incremented continously (1 Reply)
Discussion started by: lo-lp-kl
1 Replies

8. UNIX and Linux Applications

get rid of special characters

Hi Friends, we have recently installed RHEL4.4 and when i give the commd ls -l > tt it prints the file name with some special charactes like ^[[00m1 in the begining of the file name and at the end of the file name. I wanted to use the file names of removing it before taking the backup and... (4 Replies)
Discussion started by: vakharia Mahesh
4 Replies

9. UNIX for Dummies Questions & Answers

How to Remove Special Characters

Dear Members, We have a file which contains some special characters. I need to replace these special character by a new line character(\n). The Special character is \x85. I am not sure what this character means and how we can remove it. Any inputs are greatly appreciated. Thanks... (5 Replies)
Discussion started by: sandeep_1105
5 Replies

10. HP-UX

How to remove swap file sys without reboot?

hi every body i am trying to remove logical volume i configured as a swap device but when i removed by smh i ran " swapinfo" it keeps the device and didn't feel that device removed also i "lvremove /dev/vg01/swapvol" also swapinfo not feel i want it feel that i reduced the swap without reboot... (4 Replies)
Discussion started by: maxim42
4 Replies

11. Shell Programming and Scripting

swapping the values of variable!

Hi All, newbie here, i'm just wondering how can i swap the two values of variables without using the third variable. Please advise, Thanks, (5 Replies)
Discussion started by: nikki1200
5 Replies

12. UNIX for Advanced & Expert Users

Please advise good source of info about swapping

Hi Everyone, I have some misunderstanding about swapping. Is it true that swap a) required always (I mean I cannot set size 0 bytes) and b) some pages are saved on disk in idle time even free memory is enough ? Could you please advise some good reading about it? (10 Replies)
Discussion started by: sant
10 Replies

13. Shell Programming and Scripting

Finding Special Character in Vi

Hi, I have special characters in a file in unix which has many xml messages that comes from Messaging Queue. The loading process to the database failed due to special characters. Initially I could not able to detect it when I copy/paste in Windows editor as each line has more than 1000... (11 Replies)
Discussion started by: bobbygsk
11 Replies

14. Shell Programming and Scripting

^M special character in Filename

Hi All, Special character ? is added in between filename. Am not able to figure our why this is happening. In my Development environment special characters are not present. This issue is happening in the higher environment. It would be helpful if somebody can tell what are the possible... (3 Replies)
Discussion started by: weknowd
3 Replies

15. Solaris

Monitoring Paging and Swapping

Hi all, This might sound silly but i am trying to determine if i have sufficient memory or not. My definition of sufficient memory = no swapping + no paging to physical swap file. I know i can use vmstat to monitor swapping and paging and using the SR column as well. But wouldn't it be... (28 Replies)
Discussion started by: javanoob
28 Replies