Re: Adding file swap on btrfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



FWIW there are some fixes and enhancements coming in btrfs-progs 6.1, now in koji for Rawhide, including making it easier to get info about hibernation file offset in a swapfile.

I haven't messed with the new subcommand, but I personally prefer putting swapfiles in their own subvolume so that I can still snapshot the root subvolume. Snapshotting a subvolume containing a swapfile will render the swapfile invalid for use (or maybe the snapshot fails, not sure, haven't tried recently).

The way I do this is mount the top-level of the file system (just do a normal mount without any options), and inside you'll see what appears to be two directories: root and home. Those are the subvolumes the installer creates by default. Create a new subvolume in here and add it to fstab such that:

UUID=$fsuuid /var/swap               btrfs   noatime,subvol=swap 0 0

I use chattr +C on this swap subvolume, that way any new files created inside will inherit. This is something the new subcommand will do for you.

An additional entry in fstab:
/var/swap/swapfile1 none swap defaults 0 0

You can certainly make a nested /var/swap thereby avoiding the need to create the earlier fstab entry. But note that snapshots still don't have this nested subvolume in them, so if you do a rollback it also won't have the nested swap subvolume or file - thus you boot probably hangs because the fstab is looking for this swapfile to activate and never finds it. So I just do it the way I describe, that way I can more or less forget about it. But an alternative to that, if you really prefer nested, is s/defaults/nofail/ for the swapfile entry and now a missing swap won't cause boot to fail *but* you also may one day forget all this and come to realize that there's no swap activated because you once did a rollback way back when... :D


--
Chris Murphy
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux