Announcement

Collapse
No announcement yet.

What is @swap subvolume?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] What is @swap subvolume?

    After re-installing 24.04, I noticed that I have a new subvolume called @swap, along with @ and @home. What is this subvolume? What does it do? And why can't I delete it? It doesn't seem to affect anything as far as I can see, but I'm curious.

    #2
    Look at your /etc/fstab
    It is your swap, but set as a subvolume as opposed to a separate partition or file.

    Comment


      #3
      Btrfs now uses a dedicated "@swap" subvolume to isolate the swap space from other data on the filesystem, allowing for cleaner snapshots and preventing issues when performing operations like snapshotting or resizing the filesystem, as including the swapfile within a snapshot could lead to inconsistencies or data corruption; essentially, it provides a more organized and manageable way to handle swap data within the Btrfs hierarchy.​
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        The main reason a BTRFS swapfile has to have it's own subvolume is because any subvolume with a swapfile in it cannot be snapshotted at all. Thus, if you have the swapfile in your root or home subvolumes, you could not take a snapshot of them.

        Please Read Me

        Comment


          #5
          In testing 24.04 installs I found the calamares installer on btrfs always created a swap file in @swap, whether it's needed or not (it's not needed in the case where there's a swap partition). Calamares would also crash if the file already existed, and if compression was on the parent subvolume.

          If your /etc/fstab does not mention it, you can delete it. If it does, you could comment out that mention and delete it.

          But if you don't mind the space being able to turn on a swap file when you have crashes due to out of memory conditions, to get a running system until the cause is sorted, might be useful, but I would expect those circumstances to be quite rare these days.
          Regards, John Little

          Comment


            #6
            Thanks for the enlightenment. Since it doesn't do any harm, I'll just let it be.

            Comment

            Working...
            X