btrfs packages when using ext4

I have Leap15/KDE installed on my laptop and I use for / and for /home the formatting ext4. Nevertheless when upgrading there are again and again btrfs packages downloaded and installed, today for example the following: btrfsprogs-4.15-lp150.2.3.1.x86_64, btrfsprogs-udev-rules-4.15-lp150.2.3.1.noarch and libbtrfs0-4.15-lp150.2.3.1.x86_64. Since I don’t have BTRFS I think I don’t need these packages. Previously I noticed with the command “systemd-analyze blame” that there were some processes enabled and used up a bit of my boot time (which is quite high anyway on this older computer). I have disabled them all now.

 systemctl list-unit-files | grep btrfs
btrfsmaintenance-refresh.path                               disabled       
btrfs-balance.service                                       static         
btrfs-defrag.service                                        static         
btrfs-scrub.service                                         static         
btrfs-trim.service                                          static         
btrfsmaintenance-refresh.service                            disabled       
btrfs-balance.timer                                         disabled       
btrfs-defrag.timer                                          disabled       
btrfs-scrub.timer                                           disabled       
btrfs-trim.timer                                            disabled  

Now my question is I want to uninstall all those packages with btrfs that I don’t need. Is that possible and what would be the best way to do this?
Cheers Uli

Ok - to clarify my question - when I try to delete the packages with btrfs in the name I get the message when trying to delete the libbtrfs package that I have to delete other packages which depend on it - something with Yast-snapper or so and 3 other packages. I don’t want to end up with an unusable system and I don’t know what each of these packages do. Obviously no-one of those who have read this has done this before - so unless I get some answers from someone I will just try and do it. If it comes to the worst I have to reinstall.

I planned my openSUSE Leap installations ext4-only from the get-go, starting with overriding YaST’s partitioning recommendations during my first Leap installation: no btrfs, one ext4 and one swap partition, that’s it.
I then searched for »btrfs« in YaST’s Software Management module, but I was able to delete — and then set to »taboo« — only btrfsprogs:

rig:~ ▶ zypper ll | grep -i btrfs
31  | btrfsprogs                       | package | (any)

Two RPMs still seem to be necessary in order to satisfy the dependencies of YaST and several filesystem utilities on my main rig:

rig:~ ▶ rpm -qa | grep -i btrfs
libbtrfs0-4.15-lp150.2.3.1.x86_64
btrfsprogs-udev-rules-4.15-lp150.2.3.1.noarch

Another thing to do away with are the btrfs-related systemd services and timers — I masked/disabled all of them:

rig:~/Documents/rig/lp150 ▶ systemctl list-unit-files --all | grep -i btrfs
btrfs-balance.service                                            masked         
btrfs-defrag.service                                             masked         
btrfs-scrub.service                                              masked         
btrfs-trim.service                                               masked         
btrfsmaintenance-refresh.service                                 masked         
btrfs-balance.timer                                              masked         
btrfs-defrag.timer                                               masked         
btrfs-scrub.timer                                                masked         
rig:~ ▶ systemctl list-timers --all
NEXT                          LEFT     LAST                          PASSED       UNIT                         ACTIVATES
Sun 2019-04-28 00:00:00 CEST  15h left Sat 2019-04-27 07:01:59 CEST  1h 53min ago logrotate.timer              logrotate.service
Sun 2019-04-28 07:17:04 CEST  22h left Sat 2019-04-27 07:17:04 CEST  1h 38min ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
n/a                           n/a      n/a                           n/a          backup-rpmdb.timer          
**n/a                           n/a      n/a                           n/a          btrfs-balance.timer         **
**n/a                           n/a      n/a                           n/a          btrfs-scrub.timer           **
n/a                           n/a      n/a                           n/a          check-battery.timer         
n/a                           n/a      n/a                           n/a          fstrim.timer  

Finally, I’m using a custom initrd (Initial RamDisk, loaded by GRUB and used by the kernel for the first stages of booting into the system). I generate mine on the command line as root:

dracut --hostonly --force --no-compress

… using the following rules in my own dracut sub-config file:

**rig:~ # **cat /etc/dracut.conf.d/01-rig-m.conf 
hostonly="yes"
compress="cat"

omit_dracutmodules+="network kernel-network-modules ifcfg img-lib cifs fcoe fcoe-uefi rdma multipath iscsi qemu lvm mdraid dm dmraid cdrom pollcdrom plymouth **btrfs** wacom convertfs wicked ipv6 mtp-probe"

omit_drivers+="usb-storage uas ums-* snd soundcore snd-* hid-wiimote wacom hv_vmbus rmi_core dm-mod iscsi_if iscsi_tcp dm_multipath parport pcmcia jsm"

**WARNING: **Do not copy the rules above without first checking whether of not your system might need one of those modules for booting! Because I happen to boot ext4-only from a local SSD (and not, say, over IPv6 connections into a clustered/distributed/virtual/logical volume), I can afford to omit a lot of default SuSE/dracut stuff. Your mileage may vary (YMMV). Maybe you like the slick, graphical boot Plymouth provides, or you need wicked or NetworkManager for WLAN/DHCP connectivity (I don’t, I use systemd-networkd with one router-reserved static IPv4 address). And who, really, needs sound in their initrd’s for booting?
:wink:
What all this effort provides me with is:

  • peace of mind
  • ridiculously fast booting (fastest boot was 1.211s according to systemd-analyze, average times are about 1.3s)
  • a growing knowledge about Linux and Leap, systemd, dracut, wicked/plymouth/samba (and how to avoid those)
  • a robust, deterministic, compact Linux installation with a minimal surface of attack (e.g., no listening connections except for web browsers and — rarely — ssh)
  • simple, decades-old, well-tested backup strategies (mostly incremental+differential) which don’t rely on arguably flaky btrfs snapshots

Happy learning and optimizing. Cheers!

I can understand why I have btrfs packages installed by default even when I do not use btrfs. Likewise I have packages for XFS and Reiserfs which I also do not use. Deciding what to put in a default installation is of course allways arbitrary. Apparently the choice is to have those on board by default (and I assume including the kernel modules that belong to those fs types) to make it easy for those that decide to create a file system of such a a type somewhere during the time they run that version of openSUSE. When that wasn’t done, others would complain (I want to make an XFS file sytem, but I can not find the mkfs for it!)

And yes, yesterday I did a YaST Online Update and saw those btrfs packages pass by. You have to decide to either accept this like you probably except the presence of many more software on your system that you do not use (but when, for some reason, you try to start them, you will be happy that it simply works and that you do not have to find out which package a certain program belongs to and then install that package), or do what you do now, spending time on checking which dependencies are also not used on your system or can be broken without negative impact.

I would say, just leave it. It is only a few MB of diskspace and a some downloding/installing on the rare cases there is a patch for it.

Very interesting customizing suggestions. Thanks.

Thank you, unix111 and hcvv for your replies. unix111 your approach is interesting, however I don’t understand enough about some of those packages. I could e.g. get rid of cifs since in my network I use only nfs (no windows machine) however I need IPv6 since for our small business I buy some items from China and often the IPv4 connections don’t get you far. So I did the following - I deleted the 4 files with btrfs and because libbtrfs was required for some snapper packages I deleted those 4 snapper packages too. Reboot was without problems and now I get the following:

uli@linux-tl1r:~> zypper ll | grep -i btrfs
uli@linux-tl1r:~> systemctl list-unit-files | grep btrfs
uli@linux-tl1r:~> systemctl list-timers --all
NEXT                          LEFT      LAST                          PASSED     UNIT                         ACTIVA>
Sun 2019-04-28 11:25:32 NZST  9min left n/a                           n/a        systemd-tmpfiles-clean.timer system>
Mon 2019-04-29 00:00:00 NZST  12h left  Thu 2019-04-25 15:41:12 NZST  2 days ago fstrim.timer                 fstrim>
Mon 2019-04-29 00:00:00 NZST  12h left  Sun 2019-04-28 11:03:32 NZST  12min ago  logrotate.timer              logrot>
Mon 2019-04-29 00:24:49 NZST  13h left  Sun 2019-04-28 11:03:32 NZST  12min ago  check-battery.timer          check->
Mon 2019-04-29 01:18:42 NZST  14h left  Sun 2019-04-28 11:03:32 NZST  12min ago  backup-rpmdb.timer           backup>
Mon 2019-04-29 01:26:55 NZST  14h left  Sun 2019-04-28 11:03:32 NZST  12min ago  backup-sysconfig.timer       backup>

6 timers listed.

For the rest I just take hcvv’s advice to “just leave it” for now.
Thanks again and cheers
Uli

As long as can recall during install regularly have created SWAP files, puzzled by some recent memory freeze ups discovered SWAP is not being used.

paulparker@linux-dkbo:~> free              total        used        free      shared  buff/cache   available
Mem:        7901476     4902364      175504       61864     2823608     2626172
Swap:      16777212           0    16777212
paulparker@linux-dkbo:~>

Check of journalclt showed regularly “Activating swap /dev/disk/by-uuid/”

Check of fstab showed “-1” for swap partition:


paulparker@linux-dkbo:~> sudo swapon -sFilename                Type        Size    Used    Priority
/dev/sda2                                  partition    16777212    0    -1
paulparker@linux-dkbo:~>

man SWAPON(8) NOTES showing:

NOTES
You should not use swapon on a file with holes. This can be seen in the system log as

          swapon: swapfile has holes.
   The swap file implementation in the kernel expects to be able to write to the file directly, without the assistance of the filesystem.  This is a problem on pre-
   allocated files (e.g.  fallocate(1)) on filesystems like XFS or ext4, and on copy-on-write filesystems like btrfs.
   It is recommended to use dd(1) and /dev/zero to avoid holes on XFS and ext4.
   swapon may not work correctly when using a swap file with some versions of btrfs.  This is due to btrfs being a copy-on-write filesystem: the file  location  may
   not be static and corruption can result.  Btrfs actively disallows the use of swap files on its filesystems by refusing to map the file.
   One  possible workaround is to map the swap file to a loopback device.  This will allow the filesystem to determine the mapping properly but may come with a per-
   formance impact.
   Swap over NFS may not work.
   swapon automatically detects and rewrites a swap space signature with old software suspend data (e.g S1SUSPEND, S2SUSPEND, ...). The problem is that if we  don't
   do it, then we get data corruption the next time an attempt at unsuspending is made.

Extra RAM may be needed.

.

That shows that you have swap configured. It’s just that the way you are using your computer, it is not needed.

Here’s what I current get:


% free
              total        used        free      shared  buff/cache   available
Mem:        8030656     4604944     1019468      245280     2406244     2925500
Swap:      20971516     1253076    19718440

My swap usage looked similar to yours, until I installed KVM and started running some virtual machines. Now swap is actually being used.