BTRFS utilities on Ext4 file system

I noticed that there are btrfs utilities installed and running on my leap 15.3 system when I have ext4 filesystem for / and home partitions.

As they were installed by OpenSUSE install disk, I am wondering whether the btrfs utilities have any function on ext4 and can they be deleted without causing any problems?

I am also planning to delete snapper. I use mlocate as a filesystem log/search process.

Let me know if there is a reason to retain btrfs (maintenance/progs) packages and let them run. Also, is there any reason to retain snapper?

thanks, tom kosvic

Hi
AFAIK you should be fine removing the files, eg snapper;


 zypper rm grub2-snapper-plugin libsnapper5 snapper snapper-zypp-plugin yast2-snapper

The following 5 packages are going to be REMOVED:
  grub2-snapper-plugin libsnapper5 snapper snapper-zypp-plugin yast2-snapper

5 packages to remove.
After the operation, 2.7 MiB will be freed.

All for 2.7MiB… :wink: or does it really matter?

I too am an ext4 person and have gotten rid of the systemd btrfs stuff.

I did an “rm -rf /etc/systemd/system/btr*” to get rid of the btrfs stuff that tries to run even though I have no btrfs file systems.

Did that every update since 43.x to 15.0. It seem to get reinstalled when the zypper dup to upgrade to the next release occurs.

Hi
I’m surprised in your use case you haven’t considered autoyast or kiwi to create your own install media… :wink:

For system services just stop, disable and mask? Or stop and zypper rm and lock… I don’t use lang files so they all get removed and locked, likewise for plymouth…


rpm -qa *-lang --qf "%{name}
" | xargs zypper rm -u
zypper rm libply* plymouth*
zypper al *-lang libply* plymouth*
mkinitrd

As far as I know, they are only needed if you mount some “btrfs” disks.

Also 7MB of memory!

root     13160  0.0  0.1 141924  6972 ?        S    06:00   0:00 /usr/sbin/snapperd

Oddly enough, on an EXT4 system snapperd runs by default for… well, no reason. It doesn’t seem to have any logic whether btrfs is in use on any drives, it simply runs by default.

If yo don’t need a package remove it. Always specify ‘–clean-deps’. Just in case you inadvertently hit return also add ‘–dry-run’:

**3400G:~ #** zypper remove --dry-run --clean-deps btrfsmaintenance snapper 
Reading installed packages... 
Resolving package dependencies... 

The following 14 packages are going to be REMOVED:
  btrfsmaintenance dracut-transactional-update grub2-snapper-plugin inotify-tools libbtrfs0 libinotifytools0 libsnapper5 libtukit0 rebootmgr snapper snapper-zypp-plugin transactional-update tukit yast2-snapper 

14 packages to remove. 
After the operation, 3.6 MiB will be freed. 
**Continue? [y/n/v/...? shows all options] (y): **
**3400G:~ #**

If what you get is what you want remove ‘–dry-run’ and run again.

Systemd runs all units loaded:

**3400G:~ #** systemctl list-units '*snapper*' '*btrfs*'                    
  UNIT                          LOAD   ACTIVE SUB     DESCRIPTION                                   
  btrfsmaintenance-refresh.path loaded active waiting Watch /etc/sysconfig/btrfsmaintenance         
  btrfs-balance.timer           loaded active waiting Balance block groups on a btrfs filesystem     
  btrfs-defrag.timer            loaded active waiting Defragment file data and/or directory metadata 
  btrfs-scrub.timer             loaded active waiting Scrub btrfs filesystem, verify block checksums 
  btrfs-trim.timer              loaded active waiting Discard unused blocks on a mounted filesystem  
  snapper-cleanup.timer         loaded active waiting Daily Cleanup of Snapper Snapshots             
  snapper-timeline.timer        loaded active waiting Timeline of Snapper Snapshots                  

LOAD   = Reflects whether the unit definition was properly loaded. 
ACTIVE = The high-level unit activation state, i.e. generalization of SUB. 
SUB    = The low-level unit activation state, values depend on unit type. 

**7 loaded units listed.** Pass --all to see loaded but inactive units, too. 
To show all installed unit files use 'systemctl list-unit-files'. 
**3400G:~ #**

Units running may load more units:

**3400G:~ #** systemctl list-unit-files '*snapper*' '*btrfs*'    
UNIT FILE                        STATE    VENDOR PRESET
btrfsmaintenance-refresh.path    **enabled  enabled      **
btrfs-balance.service            static   -            
btrfs-defrag.service             static   -            
btrfs-scrub.service              static   -            
btrfs-trim.service               static   -            
btrfsmaintenance-refresh.service static   -            
snapper-boot.service             static   -            
snapper-cleanup.service          static   -            
snapper-timeline.service         static   -            
snapperd.service                 static   -            
btrfs-balance.timer              **enabled  enabled      **
btrfs-defrag.timer               **enabled  enabled      **
btrfs-scrub.timer                **enabled  enabled      **
btrfs-trim.timer                 **enabled  enabled      **
snapper-boot.timer               **disabled disabled     **
snapper-cleanup.timer            **enabled  enabled      **
snapper-timeline.timer           **enabled  enabled      **

17 unit files listed. 
**3400G:~ #**

Disable what you don’t need.


 > rpm --query --whatrequires *btrfsmaintenance*
no package requires btrfsmaintenance
 > rpm --query --whatrecommends *btrfsmaintenance*
*btrfsprogs*-4.19.1-lp152.6.3.1.x86_64
 > rpm --query --whatrecommends *btrfsprogs*
**patterns-base-minimal_base**-20171206-lp152.34.2.x86_64
 > 

Is it clear now?

  • Or, do we need to explain RPM package dependencies?

Looking at this topic, I also began to consider simply removing the Btrfs and Snapper packages but, I have a Laptop with a Btrfs system partition and, occasionally need to inspect disks with Btrfs partitions with this machine – therefore –


 > systemctl list-units '*snapper*' '*btrfs*'
0 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
 > systemctl list-unit-files '*snapper*' '*btrfs*'
UNIT FILE                        STATE 
btrfsmaintenance-refresh.path    masked
btrfs-balance.service            static
btrfs-defrag.service             static
btrfs-scrub.service              static
btrfs-trim.service               static
btrfsmaintenance-refresh.service masked
snapper-boot.service             static
snapper-cleanup.service          static
snapper-timeline.service         static
btrfs-balance.timer              masked
btrfs-defrag.timer               masked
btrfs-scrub.timer                masked
btrfs-trim.timer                 masked
snapper-boot.timer               masked
snapper-cleanup.timer            masked
snapper-timeline.timer           masked

16 unit files listed.
 > 

Therefore, assuming that, there’s enough system partition space and, assuming that, you occasionally have to access disks with Btrfs partitions –

  • Simply setup Systemd to deactivate the Btrfs system utilities.

If on the other hand, you’re really running on a minimal non-Btrfs system, you can delete all the Btrfs and Snapper packages but,

  • you’ll have to lock the packages to avoid them being re-installed by Patterns
    such as “Minimal Appliance Base” –

This is the minimal openSUSE runtime system. It is really a minimal system, you can login and a shell will be started, that’s all. It is intended as base for Appliances.

Upgrade or update without installing recommended packages:

**3400G:~ #** zypper dist-upgrade --no-recommends  
Loading repository data... 
Reading installed packages... 
Warning: You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command. 
Computing distribution upgrade... 
Nothing to do. 
**3400G:~ #**

That’ll probably break an awful number of packages …

  • IMNSHO, it’s better to blacklist packages by locking them …

[HR][/HR]The Oxford English Dictionary –

A list of people or things that are regarded as unacceptable or untrustworthy and should be excluded or avoided.

  • Origin: “Early 17th century

Nope. Recommended packages are strictly optional.

**Leap-15-3:~ #** zypper verify  
Loading repository data... 
Reading installed packages... 
Dependencies of all installed packages are satisfied. 
**Leap-15-3:~ #**