Is swap a partition, but not a file system?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















Is swap a partition, but not a file system? Is that the reason why df doesn't show it?



Is there a command which can list all the partitions (whether they hold file systems or not)?



Thanks.



$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 788M 1.5M 786M 1% /run
/dev/sda3 260G 17G 231G 7% /
tmpfs 3.9G 403M 3.5G 11% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda4 550G 323G 200G 62% /home
tmpfs 788M 56K 788M 1% /run/user/1000
tmpfs 788M 4.0K 788M 1% /run/user/1001

$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sda2 partition 15625212 12653864 -2









share|improve this question
























  • Yes. sfdisk -d /whatever/file/or/device.

    – mosvy
    Feb 17 at 15:50












  • Also, you can use Gparted, a gret application pre-installed in meny Debian distributions.

    – Z E Nir
    Feb 17 at 15:55







  • 1





    @mosvy that is a good answer. It is short, but such is the nature of this question. Please copy to an answer, so we can ✓ you.

    – ctrl-alt-delor
    Feb 17 at 15:57






  • 1





    @ctrl-alt-delor I don't think this question hasn't been answered before.

    – mosvy
    Feb 17 at 15:59






  • 1





    lsblk: unix.stackexchange.com/q/157154/80886

    – jimmij
    Feb 17 at 16:20















0















Is swap a partition, but not a file system? Is that the reason why df doesn't show it?



Is there a command which can list all the partitions (whether they hold file systems or not)?



Thanks.



$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 788M 1.5M 786M 1% /run
/dev/sda3 260G 17G 231G 7% /
tmpfs 3.9G 403M 3.5G 11% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda4 550G 323G 200G 62% /home
tmpfs 788M 56K 788M 1% /run/user/1000
tmpfs 788M 4.0K 788M 1% /run/user/1001

$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sda2 partition 15625212 12653864 -2









share|improve this question
























  • Yes. sfdisk -d /whatever/file/or/device.

    – mosvy
    Feb 17 at 15:50












  • Also, you can use Gparted, a gret application pre-installed in meny Debian distributions.

    – Z E Nir
    Feb 17 at 15:55







  • 1





    @mosvy that is a good answer. It is short, but such is the nature of this question. Please copy to an answer, so we can ✓ you.

    – ctrl-alt-delor
    Feb 17 at 15:57






  • 1





    @ctrl-alt-delor I don't think this question hasn't been answered before.

    – mosvy
    Feb 17 at 15:59






  • 1





    lsblk: unix.stackexchange.com/q/157154/80886

    – jimmij
    Feb 17 at 16:20













0












0








0








Is swap a partition, but not a file system? Is that the reason why df doesn't show it?



Is there a command which can list all the partitions (whether they hold file systems or not)?



Thanks.



$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 788M 1.5M 786M 1% /run
/dev/sda3 260G 17G 231G 7% /
tmpfs 3.9G 403M 3.5G 11% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda4 550G 323G 200G 62% /home
tmpfs 788M 56K 788M 1% /run/user/1000
tmpfs 788M 4.0K 788M 1% /run/user/1001

$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sda2 partition 15625212 12653864 -2









share|improve this question
















Is swap a partition, but not a file system? Is that the reason why df doesn't show it?



Is there a command which can list all the partitions (whether they hold file systems or not)?



Thanks.



$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 788M 1.5M 786M 1% /run
/dev/sda3 260G 17G 231G 7% /
tmpfs 3.9G 403M 3.5G 11% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda4 550G 323G 200G 62% /home
tmpfs 788M 56K 788M 1% /run/user/1000
tmpfs 788M 4.0K 788M 1% /run/user/1001

$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sda2 partition 15625212 12653864 -2






ubuntu swap






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 17 at 15:55









ctrl-alt-delor

11.9k42260




11.9k42260










asked Feb 17 at 15:49









TimTim

27.7k78264483




27.7k78264483












  • Yes. sfdisk -d /whatever/file/or/device.

    – mosvy
    Feb 17 at 15:50












  • Also, you can use Gparted, a gret application pre-installed in meny Debian distributions.

    – Z E Nir
    Feb 17 at 15:55







  • 1





    @mosvy that is a good answer. It is short, but such is the nature of this question. Please copy to an answer, so we can ✓ you.

    – ctrl-alt-delor
    Feb 17 at 15:57






  • 1





    @ctrl-alt-delor I don't think this question hasn't been answered before.

    – mosvy
    Feb 17 at 15:59






  • 1





    lsblk: unix.stackexchange.com/q/157154/80886

    – jimmij
    Feb 17 at 16:20

















  • Yes. sfdisk -d /whatever/file/or/device.

    – mosvy
    Feb 17 at 15:50












  • Also, you can use Gparted, a gret application pre-installed in meny Debian distributions.

    – Z E Nir
    Feb 17 at 15:55







  • 1





    @mosvy that is a good answer. It is short, but such is the nature of this question. Please copy to an answer, so we can ✓ you.

    – ctrl-alt-delor
    Feb 17 at 15:57






  • 1





    @ctrl-alt-delor I don't think this question hasn't been answered before.

    – mosvy
    Feb 17 at 15:59






  • 1





    lsblk: unix.stackexchange.com/q/157154/80886

    – jimmij
    Feb 17 at 16:20
















Yes. sfdisk -d /whatever/file/or/device.

– mosvy
Feb 17 at 15:50






Yes. sfdisk -d /whatever/file/or/device.

– mosvy
Feb 17 at 15:50














Also, you can use Gparted, a gret application pre-installed in meny Debian distributions.

– Z E Nir
Feb 17 at 15:55






Also, you can use Gparted, a gret application pre-installed in meny Debian distributions.

– Z E Nir
Feb 17 at 15:55





1




1





@mosvy that is a good answer. It is short, but such is the nature of this question. Please copy to an answer, so we can ✓ you.

– ctrl-alt-delor
Feb 17 at 15:57





@mosvy that is a good answer. It is short, but such is the nature of this question. Please copy to an answer, so we can ✓ you.

– ctrl-alt-delor
Feb 17 at 15:57




1




1





@ctrl-alt-delor I don't think this question hasn't been answered before.

– mosvy
Feb 17 at 15:59





@ctrl-alt-delor I don't think this question hasn't been answered before.

– mosvy
Feb 17 at 15:59




1




1





lsblk: unix.stackexchange.com/q/157154/80886

– jimmij
Feb 17 at 16:20





lsblk: unix.stackexchange.com/q/157154/80886

– jimmij
Feb 17 at 16:20










2 Answers
2






active

oldest

votes


















3















Is swap a partition, but not a file system?




The common way to set up a swap space is indeed to use a partition (like your /dev/sda2). The swap space has some identifiers, so it can be identified as such, but it's not a file system: it doesn't contain files.



You could of course also put swap space on a file on some regular filesystem.



(I wouldn't say swap is a partition, but in can lie on a partition.)




Is that the reason why df doesn't show it?




That, and the fact that df only shows mounted filesystems (visible to the process).




Is there a command which can list all the partitions (whether they hold file systems or not)?




All disk partitioning tools; fdisk, sfdisk, GParted, what have you. They might or might not show what's inside the partitions though.
(/proc/partitions also contains a list, but not much details.)






share|improve this answer






























    3















    Is swap a partition, but not a file system?




    A swap File / Partition is just a big BLOB where the kernel stores Randomly Accessible Memory. Although RAM can contain files, it needs a RAM DISK conversion to do that.




    Is that the reason why df doesn't show it?




    Yes, from the man page:




    NAME

    df - report file system disk space usage







    Is there a command which can list all the partitions (whether they hold file systems or not)?




    parted --list





    share|improve this answer
























      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f501183%2fis-swap-a-partition-but-not-a-file-system%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3















      Is swap a partition, but not a file system?




      The common way to set up a swap space is indeed to use a partition (like your /dev/sda2). The swap space has some identifiers, so it can be identified as such, but it's not a file system: it doesn't contain files.



      You could of course also put swap space on a file on some regular filesystem.



      (I wouldn't say swap is a partition, but in can lie on a partition.)




      Is that the reason why df doesn't show it?




      That, and the fact that df only shows mounted filesystems (visible to the process).




      Is there a command which can list all the partitions (whether they hold file systems or not)?




      All disk partitioning tools; fdisk, sfdisk, GParted, what have you. They might or might not show what's inside the partitions though.
      (/proc/partitions also contains a list, but not much details.)






      share|improve this answer



























        3















        Is swap a partition, but not a file system?




        The common way to set up a swap space is indeed to use a partition (like your /dev/sda2). The swap space has some identifiers, so it can be identified as such, but it's not a file system: it doesn't contain files.



        You could of course also put swap space on a file on some regular filesystem.



        (I wouldn't say swap is a partition, but in can lie on a partition.)




        Is that the reason why df doesn't show it?




        That, and the fact that df only shows mounted filesystems (visible to the process).




        Is there a command which can list all the partitions (whether they hold file systems or not)?




        All disk partitioning tools; fdisk, sfdisk, GParted, what have you. They might or might not show what's inside the partitions though.
        (/proc/partitions also contains a list, but not much details.)






        share|improve this answer

























          3












          3








          3








          Is swap a partition, but not a file system?




          The common way to set up a swap space is indeed to use a partition (like your /dev/sda2). The swap space has some identifiers, so it can be identified as such, but it's not a file system: it doesn't contain files.



          You could of course also put swap space on a file on some regular filesystem.



          (I wouldn't say swap is a partition, but in can lie on a partition.)




          Is that the reason why df doesn't show it?




          That, and the fact that df only shows mounted filesystems (visible to the process).




          Is there a command which can list all the partitions (whether they hold file systems or not)?




          All disk partitioning tools; fdisk, sfdisk, GParted, what have you. They might or might not show what's inside the partitions though.
          (/proc/partitions also contains a list, but not much details.)






          share|improve this answer














          Is swap a partition, but not a file system?




          The common way to set up a swap space is indeed to use a partition (like your /dev/sda2). The swap space has some identifiers, so it can be identified as such, but it's not a file system: it doesn't contain files.



          You could of course also put swap space on a file on some regular filesystem.



          (I wouldn't say swap is a partition, but in can lie on a partition.)




          Is that the reason why df doesn't show it?




          That, and the fact that df only shows mounted filesystems (visible to the process).




          Is there a command which can list all the partitions (whether they hold file systems or not)?




          All disk partitioning tools; fdisk, sfdisk, GParted, what have you. They might or might not show what's inside the partitions though.
          (/proc/partitions also contains a list, but not much details.)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 17 at 16:16









          ilkkachuilkkachu

          61.1k1099175




          61.1k1099175























              3















              Is swap a partition, but not a file system?




              A swap File / Partition is just a big BLOB where the kernel stores Randomly Accessible Memory. Although RAM can contain files, it needs a RAM DISK conversion to do that.




              Is that the reason why df doesn't show it?




              Yes, from the man page:




              NAME

              df - report file system disk space usage







              Is there a command which can list all the partitions (whether they hold file systems or not)?




              parted --list





              share|improve this answer





























                3















                Is swap a partition, but not a file system?




                A swap File / Partition is just a big BLOB where the kernel stores Randomly Accessible Memory. Although RAM can contain files, it needs a RAM DISK conversion to do that.




                Is that the reason why df doesn't show it?




                Yes, from the man page:




                NAME

                df - report file system disk space usage







                Is there a command which can list all the partitions (whether they hold file systems or not)?




                parted --list





                share|improve this answer



























                  3












                  3








                  3








                  Is swap a partition, but not a file system?




                  A swap File / Partition is just a big BLOB where the kernel stores Randomly Accessible Memory. Although RAM can contain files, it needs a RAM DISK conversion to do that.




                  Is that the reason why df doesn't show it?




                  Yes, from the man page:




                  NAME

                  df - report file system disk space usage







                  Is there a command which can list all the partitions (whether they hold file systems or not)?




                  parted --list





                  share|improve this answer
















                  Is swap a partition, but not a file system?




                  A swap File / Partition is just a big BLOB where the kernel stores Randomly Accessible Memory. Although RAM can contain files, it needs a RAM DISK conversion to do that.




                  Is that the reason why df doesn't show it?




                  Yes, from the man page:




                  NAME

                  df - report file system disk space usage







                  Is there a command which can list all the partitions (whether they hold file systems or not)?




                  parted --list






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Feb 17 at 19:10

























                  answered Feb 17 at 16:46









                  FabbyFabby

                  3,99811330




                  3,99811330



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f501183%2fis-swap-a-partition-but-not-a-file-system%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown






                      Popular posts from this blog

                      Peggy Mitchell

                      Palaiologos

                      The Forum (Inglewood, California)