2

I have just created a swap file and now I want to check the location on this swap file.

How can I check on which partition my swap file is residing?

0

1 Answer 1

4

There are probably several ways to do this, but the simplest ones are:

sh@uruk:~$ cat /proc/swaps 
Filename                Type        Size    Used    Priority
/dev/nvme0n1p3          partition   2097148 456     -2
sh@uruk:~$ swapon -s
Filename                Type        Size    Used    Priority
/dev/nvme0n1p3          partition   2097148 456     -2
3
  • i just type this command but its not showing "/dev/** rather just say /swapfile May 28, 2021 at 11:22
  • cd / && ls -l swapfile May 28, 2021 at 11:29
  • So it's a swap file, not like on my machine a swap partition, it's named "swapfile", and it's in the root directory of your root filesystem. To see what partition it's on, use df /.
    – HuHa
    May 28, 2021 at 12:12

Not the answer you're looking for? Browse other questions tagged .