Btrfs question

Hi,

I installed Leap 42.2 and everything went well with Plasma5 and xfce.
For the first time I use Btrfs on my root partition. My question is if it is safe to
remove the subvolume so I can make my machine boot more faster. As you can
see the mounting of the Btrfs subvolumes takes a bit of a time booting.

588ms var-lib-mariadb.mount
           581ms boot-grub2-x86_64\x2defi.mount
           579ms var-lib-libvirt-images.mount
           576ms var-lib-mysql.mount
           575ms var-lib-mailman.mount
           574ms usr-local.mount
           570ms var-tmp.mount
           569ms var-cache.mount
           566ms opt.mount
           565ms tmp.mount
           564ms var-lib-machines.mount
           560ms var-lib-named.mount
           554ms srv.mount
           550ms var-spool.mount
           549ms var-lib-pgsql.mount
           547ms var-log.mount
           541ms var-opt.mount
           536ms var-crash.mount
           460ms apparmor.service

I had a look in yast2 expert partitoner and in Btrfs there is a way to edit/remove subvolume
under Subvolume Handling.

I disabled snapshot before starting the Leap 42.2 installation because my ssd has a small capacity, if this is relevant.

Thanks in advance,
conram

Hi
No, remember it boots in parallel, so cumulative times may be misleading, the critical-chain is the important one and also the generic output.


systemd-analyze
systemd-analyze critical-chain

What do the above show?

I get rid of plymouth (10 pkgs) and lock them from updates and then run mkinitrd to remove it, I also set NM_ONLINE_TIMEOUT=“0” as well in /etc/sysconfig/network/config as I use NetworkManager, if wicked it has no affect.

It’s definitely not safe with snapshots enabled, as a rollback may cause dataloss (databases e.g. would be rolled back too). Not a problem if you disabled snapshots anyway of course.
And certain things (like databases again) do not perform well with btrfs’s standard options, so the subvolumes change them (CoW in particular).

I don’t think your system will boot any faster if you removed the subvolumes though.

As you can
see the mounting of the Btrfs subvolumes takes a bit of a time booting.

No. That’s the point of time during the boot when they get mounted.

And the interval between the first one and the last one is 50 ms (milli-seconds), i.e. 1/20th of a second.
Even if you’d save this time (it’s not like the system is waiting for that, things are done in parallel anyway), you likely wouldn’t notice. :wink:

I’d say, don’t bother.

Thanks malcolm & wolfi.

Here are the output of command malcolm was asking.

systemd-analyze
Startup finished in 4.170s (firmware) + 1.986s (loader) + 2.222s (kernel) + 863ms (initrd) + 2.288s (userspace) = 11.532s
systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @2.227s
└─display-manager.service @1.542s +684ms
  └─time-sync.target @1.541s
    └─ntpd.service @1.465s +75ms
      └─network.target @1.445s
        └─wpa_supplicant.service @1.511s +35ms
          └─basic.target @1.204s
            └─sockets.target @1.204s
              └─iscsid.socket @1.204s
                └─sysinit.target @1.204s
                  └─systemd-update-utmp.service @1.199s +4ms
                    └─systemd-tmpfiles-setup.service @1.193s +5ms
                      └─systemd-journal-flush.service @1.097s +74ms
                        └─var-log.mount @480ms +558ms
                          └─dev-disk-by\x2duuid-67737088\x2de9f2\x2d4a44\x2da6c5\x2d2a5e9cab9c45.device @399ms

This machine used to boot in less than 10 seconds with Leap 42.1

Thanks,
conram

Hi
Yes, but there is more info now… 42.1 only had kernel, initrd and userspace, firmware and loader are now added, so that could be influencing your result to a small extent… This a single boot system?

Yes for now.
It has 2-SSD drive and 1-HD
The other SSD is already partitioned for future linux /, /home and /boot/efi
The HD is for swap and storage accessible to both SSD.
Any thoughts?

Thanks,
conram

Hi
Put the swap on the SSD and wind swappiness down in /etc/sysctl.conf;


# Disable swap
vm.swappiness = 1
vm.vfs_cache_pressure = 50

I run on all my systems with 4 or 8GB and it’s never used… My quad boot system is two ssd’s with swap on the second one at the end of the disk.

The HDD may be a small delay when mounting…

If you don’t need/want plymouth remove that… Not sure if there are any others that will reduce the overall time.

Hi,
Malcolm thanks for the help, I tried all and seems booting time is pretty much the same.
Maybe I just have to live with it and it’s not a major problem at all.

Going back to my first post regarding the subvolumes;
Here is a quote from wolfi’s reply

It’s definitely not safe with snapshots enabled, as a rollback may cause dataloss (databases e.g. would be rolled back too). Not a problem if you disabled snapshots anyway of course.
And certain things (like databases again) do not perform well with btrfs’s standard options, so the subvolumes change them (CoW in particular).

for which it contradicts in some way from your earlier post

No, remember it boots in parallel

What I mean is as I understand from his reply, I “maybe” can remove the subvolume when snapshot is disabled.

Hi
Booting the system and btrfs handling are two different beasts, sure you can do that disable snapshots and remove subvolumes but sort of defeating the purpose of using btrfs in the first place?

Of the bootup time 4 odd sections by the system, tweak the BIOS? For grub almost 2 seconds, if single boot, go into YaST bootloader, turn off os-prober, hide menu and and set time to zero. On my MachBook I do this, then when want to boot osX, just press the option (boot options) button to select the disk rather than efi.

Yes, that’s what I would say as well. 11 seconds instead of 8 seconds boot time doesn’t really sound like a major problem.

My system takes over 2 minutes to boot… :wink:

Going back to my first post regarding the subvolumes;
Here is a quote from wolfi’s reply

for which it contradicts in some way from your earlier post

There’s no contradiction at all, those are two completely unrelated statements.

What I mean is as I understand from his reply, I “maybe” can remove the subvolume when snapshot is disabled.

You maybe could, but as I said, better don’t.
Also, you may only gain a few milli-seconds according to your output, and maybe not even that as booting is done in parallel (as malcolmlewis wrote, and I did as well in my first reply).

If you really want to save boot time, I’d suggest trying to switch to a more simple/different displaymanager (sddm can take relatively long to start, especially with Plasma’s breeze theme) and/or desktop… :wink:
The displaymanager is actually the part that takes the longest time to start in your critical-chain output.

Very well said, thanks again.
Yes, why did I used Btrfs when I am disabling it’s precious feature:(.
I will just leave those subvolumes un-touched.:wink:

Please consider this thread solved.

Thanks,
conram

Hi wolfi,
Thanks to you for helping in this thread.
I would like to mention also the big improvement in sddm as I noticed here.
It is on par with lightdm almost in booting my machine and it is prettier.:slight_smile:

Well, actually there haven’t really been big improvements in sddm itself, especially not compared to 42.1 which basically shipped with the same version.
But Plasma’s breeze theme for sddm has been completely reworked and improved in 5.8… :wink:

Though the upstream one is a bit too monochrome for my taste (and I don’t like that particular shade of blue either):
https://www.kde.org/announcements/plasma-5.8/plasma-5.8-boot.png

In openSUSE there’s a wallpaper set by default though, which makes it look much better IMHO.

Hi
I’ve used the rollback feature a few times on Tumbleweed… :wink: The only thing is to tweak /etc/snapper/configs/root if required and at times (if the output from snapper list) is big to manually run the cron jobs to clean up and balance btrfs…