this post was submitted on 23 Aug 2023
12 points (100.0% liked)

Linux Questions

1149 readers
25 users here now

Linux questions Rules (in addition of the Lemmy.zip rules)

Tips for giving and receiving help

Any rule violations will result in disciplinary actions

founded 1 year ago
MODERATORS
 

I bought a HP Stream 11 laptop with an N4120 / 4 GB Ram and 64 eMMC / sd card reader for traveling and one of the main selling points for me was the sd card reader to extend the internal storage easily.

Using Debian 12 / Kernel 6.1 I installed everything but /boot and the EFI partition on a reasonably sized (512 GB) sd card. By default I use nowadays Btrfs with transparent compression and noatime as my root filesystem, so this is what I used on the sd card, too.

I pulled an update for a git repository, around 100 MB in binary files (don't ask) to the laptop, and basically the update was received and afterwards for several minutes there was no progress. When I checked what was going on with htop I saw several Btrfs housekeeping processes working on the sd card and by that time I simply shut down the laptop. (My fault, I didn't record which processes exactly.) RAM was okay (no swapping). The sd card also had much more than 10% free space for Btrfs. Additionally, the git pull did not update any files, so copy on write was not triggered.

After this experience I reinstalled Debian on the sd card, but his time with ext4/noatime. I pulled the exact same git repository, with 400 MB of new binary data, and git pull finished w/o trouble in less than a minute.

I am tech aware enough to set the 'C' attribute for virtual machines on Btrfs and run Btrfs on all my physical and virtual machines for several years now.

My deployment is 100% automated via Ansible, so I am sure the only change was Btrfs -> ext4.

I try to understand, why Btrfs performed so much worse than ext4 for me on exactly the same hardware and for the same workloads. Any explanations or pointers to places to find answers are very much appreciated!

top 6 comments
sorted by: hot top controversial new old
[–] possiblylinux127 3 points 1 year ago (2 children)

That's honestly kind of weird. Btrfs for me gives better results.

What kind of house keeping processes are you describing? I need more information.

[–] wolf 2 points 1 year ago

As I said - I run Btrfs on multiple devices for years and am very happy with the results.

Sadly, I wasn't smart enough in the moment to record the Btrfs processes which I saw via htop/ps ax and it would take too much time to replicate the setup with Btrfs for another test.

I was hoping to find someone who knows enough of Btrfs and sd cards to come up with a plausible explanation or a very informed guess.

[–] wolf 2 points 1 year ago

Could you elaborate where and how you had better results for Btrfs? Did you refer to Btrfs on sd cards? Did you experience better results in regard to performance from Btrfs on sd cards compared to ext4 or exfat?

[–] Efwis 3 points 1 year ago (1 children)

It might of had a snapshot being created. If you have snapper or similar running, it will make the snapshot of the system prior actual install. This could be, not saying it is, what the issue is.

Also I have personally found that SD cards can actually be inhibited by USB controllers that the computer is using. I have a older computer with 1 USB 3,0 slot and the rest are 2.0. Which, incidentally, uses the 2.0 controller as it is based on the 2.0 USB technology.

[–] wolf 2 points 1 year ago

I am pretty sure snapshots were not involved. I run 'vanilla' Debian 12 and just choose Btrfs instead of ext4 for /. AFAIK nothing is set up to create snapshots. Still, thank you very much for this idea, could have been a valid point.

[–] [email protected] 1 points 1 year ago

I personally wouldn't use either on an SD card, just use exFAT, it's supported by literally everything and it's good enough