2

I've got a Raspberry Pi 4 used as a home automation server and I would like to add a USB flash memory stick as yet another drive. Question is: what filesystem would be the best choice for such a stick? Some more info:

  • Files are mostly 100Mb - 400Mb, written once, read infrequently (not streaming)
  • Data is not critical and is backed up frequently, so an eventual catastrophic failure is not a problem. However I'd like to avoid failures due to unclean shutdown or an occasional power failure.
  • Speed is important (I am currently using this drive as an encrypted ext4 in a LUKS container and it is slow, to say the least).
  • The drive is 256Gb (claims to be USB 3.0 compliant)

So far, these are the candidates:

  • VFAT - de-facto standard for flash drives but unclear how well it can handle power failures
  • ext4 - has journaling but probably sub-optimal because of that for such media.
  • ext2 - not sure how optimal it might be for flash drive media.

Any thoughts or recommendations?

5
  • 2
    If that USB stick is only ever going to be used on Linux then the only choice is EXT4.
    – Dougie
    Sep 20, 2020 at 20:00
  • 1
    Check out f2fs as well - note: you can turn journaling off on ext4 ... e.g. sudo tune2fs -O ^has_journal /dev/sda1 or, when creating mkfs.ext4 -O ^has_journal /dev/sda1 Sep 21, 2020 at 0:03
  • Thanks for the f2fs tip - I was not aware of it and it seems to be exactly what I was looking for! Sep 21, 2020 at 2:17
  • I would recommend zfs because it will checksum the data and not just metadata. So any corruption in files will get noticed while ext4 will happily serve corrupted files. And then your nightly backup will back them up and eventually overwrite the last clean copy of it. Sep 27, 2020 at 15:42
  • zfs is only good if there is a mirror, meaning to store 1TB, you have to have 2x1TB drives. And i am not sure if it will not break if both drives disconnect at same time (happened to me numerous times USB somehow break and disconnected).
    – 16851556
    Apr 4, 2021 at 21:34

1 Answer 1

1

Filesystems won't effect speed any where near as much as LUKS.

zfs/btrfs/lvm+xfs/mdadm+ext4 will all hit N drive speed.

Other SOCs in the same price range have much better encryption performance:

aes-xts 512b benchmarks:

MiB/s,   Product
   9.7,  RPI 1
  18.8,  HiFive Unmatched (U740)
  22.5,  RPI 3
  42.2,  Odroid C2
  60.0,  USB2 ===
  66.1,  RPI 4
  76.2,  Odroid XU4
 221.2,  UP1
 240.3,  Orange Pi PC2, NanoPi NEO2 (AllWinner H5)
 267.0,  espressobin
 370.5,  ROCK64 (RK3328)
 570.6,  Odroid C4 (S905X3)
 625.0,  USB3 ===
 655.6,  Odroid N1, ROCKPRO64, etc (RK3399)
 666.1,  UP2 (N4200)
 704.2,  Odroid H2 (J4105)
 707.1,  Odroid N2 (S922X)
 826.1,  rackspace (E5-2670)
 985.1,  EC2 (AMD EPYC 7571)
1366.7,  EC2 (E5-2676)
1393.7,  old i5 (2500S)
2710.3,  Ryzen 1800X
2994.5,  i7-1165G7

https://forum.odroid.com/viewtopic.php?f=149&t=30103

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.