[SOLVED] How do I know the swap in up and running?
Slackware - InstallationThis forum is for the discussion of installation issues with Slackware.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi: 'cat /proc/swaps' lists 0 bytes and all permissions removed except read permissions. Character on column 1 of the listing is a '-' (hiphen). Ah, the swap is a regular file.
The file itself is listed (ls) as the other one except it has write permissions for root.
EDIT: I already know. If swapoff does not complain, then it exists and in on.
EDIT: dmesg does not mention the swap. Neither do I find the word in /etc/messages, except for when it was a disk partition!
Trying to put some order: 'swapon -s' does not list anything. So, the swap, /SWAP_DO_NOT_TOUCH/SWAPFILE, has not been activated during reboot. But neither there have been anyerror messages during boot, swap related. OK.
I'll try 'swap' or 'none' instead of the file name for the second field. The man page for fstab, when speaking of the second field, only refers to special devices, not files.
So we can assume that you know that most people use a full partition of type 82 (swap) when creating a swap area. And that you specifically want to use a file in a file system for swap.
... and you've already found the swapon -s command in answer to the title of this thread.
Last edited by TracyTiger; 03-15-2014 at 02:03 AM.
in /etc/fstab. The first field is the name of the file, as when we use partitions, we put say /dev/sda4 (the device name). I was using the UUID, following a suggestion in the fstab man page. A thing that as I don't use removable drives as a rule, I have not the least necessity of.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Yes, when you're referring to a swap (or any other) partition in fstab it's often a good idea to use UUIDs as it prevents problems if the drives are initialised in a different order (which seems to be very common when using a few similar drives) but when referring to a swap file then the filesystem has to be mounted anyhow so you can just use the path on the filesystem. In my case I use the following in fstab for swap:
Ahaaa, the fstab does not mention swap files at all, and instead of refering to swap space, which is a general enough word, when it has to refer to the swap it does it as swap partition. This seems to reflect a policy of rejection of the use of files for swap space. Many people think a swap file is accessed as a regular file normally is and ignore the fact that the kernel just uses the space allocated for the file, bypassing caching and filesystem overhead, which would be ridiculous. It just keeps a map of the physical sectors, which are consecutive in the disk if one does things well. However some other man page even gives the concrete example of the use of dd as a means of allocating the space, mentioning the swap file explicitly. Only for large systems the use of a disk or disk partition makes sense. Not certainly for a home computer, despite the indignation of purists. Of course, it's always giving the kernel extra work and goes against the concept of simplicity.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.