Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 04-01-2006, 05:29 AM   #1
Registered: Nov 2004
Location: Mumbai
Posts: 80

Rep: Reputation: 15
Swap file - identification

Dear People

How the see the list of Swap spaces in Linux.

Normal we can identify through mount command or fdisk command. but in solaris " swap -l ", this will show all swap device / swap files.

How about in linux. any command for identify the devices / files.

Kindly address this.

Old 04-01-2006, 05:49 AM   #2
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
You could check the output of dmesg. For example:
# dmesg |grep swap
Adding 594396k swap on /dev/sda3.  Priority:-1 extents:1 across:594396k
Adding 594396k swap on /dev/sdb3.  Priority:-2 extents:1 across:594396k
The command free might be of some help also.
Old 04-01-2006, 01:59 PM   #3
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
On Slackware, the swapon command uses the -s option:
$ /sbin/swapon -s
Filename                                Type            Size    Used    Priority
/dev/hda10                              partition       987956  194220  -1
Or, you can just check the /proc info:
$ cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/hda10                              partition       987956  194220  -1
Old 04-01-2006, 05:29 PM   #4
LQ Guru
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
If procfs is mounted at /proc, type cat /proc/swaps.

In any distribution, typing swapon -s will give you the list of swaps. This command is not proprietary for Slackware.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
what is a swap file...? zameer_india Linux - Newbie 8 01-09-2005 10:35 PM
swap file linuxhippy Linux - General 4 10-11-2004 04:07 PM
Swap file not being used...why? ganja_guru Linux - General 6 12-08-2003 03:41 AM
Swap file sparkplug55 Linux - Newbie 2 08-11-2003 09:09 AM
Swap File ? jbhoo Linux - Software 1 04-24-2002 04:59 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:47 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration