weixin_39873325
weixin_39873325
2020-12-29 16:14

Swapfile on btrfs should be on different subvolume like @swap instead of @

The reason is when there is swapfile on btrfs in /swapfile It will create problem when you create snapshot of @

To avoid this

Create swapfile in /swap/swapfile

Instead of /swapfile

And also create a subvolume By default like how is created

该提问来源于开源项目:calamares/calamares

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

10条回答

  • weixin_39785723 weixin_39785723 4月前

    No creating like we do is broken and conflicts with the FS layout options, that has to be dropped and not more of the same broken stuff added.

    The solution for that is a GUI option(s), for FS options in general.

    点赞 评论 复制链接分享
  • weixin_39834090 weixin_39834090 4月前

    There's very little consistency in how we handle btrfs, so something like this really needs someone to stand up and care for btrfs from start to finish (I think start is the partitioning module, but it might be creating-filesystems-in-the-partitions) and finish is whenever it turns out that there don't need to be tweaks for btrfs anymore). A similar conversation would probably need to be had about ZFS, with the same kind of partitioning-and-subvolumes ideas.

    I don't particularly care about a UI -- it'd be good to have one, but if a distro can configure "do it this way" in a sensible way, that's fine as well. The partition layout might be a good place to do so, or .. well, the mount module is applying some custom not-configurable layout anyway so perhaps the place to do random wrangling of btrfs (and, for that matter, creating the swapfile).

    点赞 评论 复制链接分享
  • weixin_39785723 weixin_39785723 4月前

    I agree someone needs to take care.

    However the same is true for LUKS, LVM ( completely broken right now ), kernel-boot-options and what not.

    Options in configurations files are fine however I disagree about the need of GUI option(s), especially for FS choices. Users, right now need to edit configuration files on the live ISO to be able to even change the default FS, let alone options of any sort.

    Distributions could still allow/disallow things can be used in the UI, the same we do with swap as an example.

    But while we are at BTRFS & configuration options the forced thing needs to change, either by exporting some var when the FS layout is used and then skip creation when the var is present or an option in some config file or even both, see https://github.com/calamares/calamares/issues/1222 as an example why is broken right now.

    点赞 评论 复制链接分享
  • weixin_39873325 weixin_39873325 4月前

    Currently i modified mount module To create @ - / - /home - /root - /srv - /var/cache - /var/log - /var/tmp

    Subvolumes by default for Garuda linux.

    点赞 评论 复制链接分享
  • weixin_39832643 weixin_39832643 4月前

    Swapfile needs it's own subvolume on btrfs. There is already UI for this in the swapfile toggle. I would also do more complete subvolume layout like did. Good thing is that I finally got the necessary hardware and can start working on this again. I think it is sufficient to have the option at configuration file level to start with. UI can come later after that.

    点赞 评论 复制链接分享
  • weixin_39834090 weixin_39834090 4月前

    Some kind of general btrfs subvolume structure / configuration that is consumed in the mount module -- it might be defined there, or perhaps in the partitioning module, I don't have strong feelings there, but it should be put into GS -- and also consumed in the fstab.

    点赞 评论 复制链接分享
  • weixin_39834090 weixin_39834090 4月前

    can you PR your implementation? I'd be particularly interested in a not-hardcoded version that specifies a btrfs layout in some way in the config file. Then we could work towards getting the underlying technical bits done (btrfs layout, dealing with all the places where it needs some attention -- like we've now learned home and swapfile and some others) before we consider any UI work.

    点赞 评论 复制链接分享
  • weixin_39873325 weixin_39873325 4月前

    Currently it is hardcoded. I would also prefer a non hardcoded but i honestly dont know how to.

    Is it okay to pr hardcoded version?

    I think creating swapfile in /var/cache/swapfile would be good. As it will eliminate the need of seperate subvolume for swapfile

    点赞 评论 复制链接分享
  • weixin_39832643 weixin_39832643 4月前

    I started working on the same issue earlier, and am now finally getting back to it. If you wish, we can also collaborate in this?

    https://github.com/calamares/calamares/pull/1375

    I think putting swapfile to is a good idea.

    点赞 评论 复制链接分享
  • weixin_39873325 weixin_39873325 4月前

    https://gitlab.com/garuda-linux/tools/iso-profiles/-/tree/master/shared/garuda/live-overlay/usr/lib/calamares/modules

    Here are the modified modules

    点赞 评论 复制链接分享

相关推荐