# What FS for a SD-Card is the best?

## SarahS93

I have a SanDisk Extreme Pro 256 GB SDXC SD-Card (95 MB/s, Class 10, U3, V30) (95 MB/s read and 90 MB/s write)

My SD-Card Slot in my Lenovo x121e Notebook is connected by PCIE.

What is the best way to test how fast the SD-Card is?

With the preformatet exFat mounted with Fuse, i only have ~30MB/s writespeed.

Is that normal?

What FS must i use?

Is there any special that i have to do with fdisk?

----------

## Ant P.

SD cards are designed as cheaply as possible under the assumption that they'll only ever be used under win32, with the default filesystem drivers. The Linux exfat driver probably has very different access patterns. You may be better off using UDF.

----------

## NeddySeagoon

SarahS93,

FUSE filesystems are slow because of all the userspace/kernelspace context switches.

Its a design feature.

What data will you put on the SDCard?

For speed, journaled filesystem are best avoided but if you ever need a fsck after an unclean shutdown, it will take a long time as there is no journal to replay.

What other devices need to read/write the filesystem?

----------

## SarahS93

I will download and store files from the internet on it

I download with ~25MB/s. The download programm (JDownloader) download a file, read the file to create and compare the checksum of it.

I need 4 files with 2 connection per each file for the best download speed.

If i write on my small SSD, all is OK, but only the space is sometimes not enough.

So i decided to buy a SD-Card, because more space and easy to put out of my Notebook and into my desktop computer for transfer the files from the SD-Card-Reader to my Desktop HDD.

If i write and write to the SD-Card at the same time (more files, ~4..5 files) the download speed goes down for some moments.

So i must download to the SSD and transfer from there to the SD-Card (by useing exFat with Fuse)

I have do some test myself with differnt Filesystems

```
UDF

dd if=/dev/zero of=/mnt/sdcard/testdatei bs=1024 count=2097152

2097152+0 Datensätze ein

2097152+0 Datensätze aus

2147483648 bytes (2,1 GB, 2,0 GiB) copied, 62,2388 s, 34,5 MB/s

BTFS

dd if=/dev/zero of=/mnt/sdcard/testdatei bs=1024 count=2097152

2097152+0 Datensätze ein

2097152+0 Datensätze aus

2147483648 bytes (2,1 GB, 2,0 GiB) copied, 61,8437 s, 34,7 MBs

EXT4

dd if=/dev/zero of=/mnt/sdcard/testdatei bs=1024 count=2097152

2097152+0 Datensätze ein

2097152+0 Datensätze aus

2147483648 bytes (2,1 GB, 2,0 GiB) copied, 44,8759 s, 47,9 MB/s

EXT4

dd if=/dev/zero of=/mnt/sdcard/testdatei bs=1024 count=16777216

16777216+0 Datensätze ein

16777216+0 Datensätze aus

17179869184 bytes (17 GB, 16 GiB) copied, 450,885 s, 38,1 MB/s

EXT4

dd if=/dev/zero of=/mnt/sdcard/testdatei bs=1024 count=67108864

^C

40563889+0 Datensätze ein

40563889+0 Datensätze aus

41537422336 bytes (42 GB, 39 GiB) copied, 1114,16 s, 37,3 MB/s
```

The last one i break at 42GB

47,9 MB/s was only one time, i try it 2 times again, and never over 36 MB/s

So next i will try EXT4 with tweaks from this guide

https://developer.ridgerun.com/wiki/index.php/High_performance_SD_card_tuning_using_the_EXT4_file_system

I think about to buy a SD-Card they can write with 300 MB/s, so i think i can have ~100MB/s writespeed - is that so?

----------

## saboya

F2FS maybe?

----------

## NeddySeagoon

SarahS93,

You need to use bs=1M at least, with dd or most of the time goes into context switching.

SDcards also have a 4k physical block size, so writing 1k blacks is a bad thing.

There are several filesystems intended to get the best out of FLASH memory. Its worth trying some of these.

----------

## SarahS93

Why does SanDisk write on the SD-Card "95 MB/s read and 90MB/s write"? Are these true at Windows-Systems?

What do you think is the best write MB/s that i can get in Linux with these SD-Card?

I will try F2FS and post my results.

----------

## NeddySeagoon

SarahS93,

If you use a FUSE filesystem 30MB/sec is pretty good.

You need a filesystem from the kernel.

----------

## SarahS93

With F2FS, i have no stops in my downloads and read files for the checksum, it works good.

----------

## Goverp

FWIW I've been using F2FS on a Raspberry Pi running (on Arch Linux) (a) a CUPS print server (b) a Radicale CALDev server for very nearly a year now, running 24x7.  It's been rebooted a few times after applying service and suffered a few power cuts causing a restart.  No problems so far.

----------

## beandog

 *Ant P. wrote:*   

> SD cards are designed as cheaply as possible under the assumption that they'll only ever be used under win32, with the default filesystem drivers. The Linux exfat driver probably has very different access patterns. You may be better off using UDF.

 

UDF?! wat?

I'm not disparaging you, I've just never heard of the suggestion before and now I'm totally curious why.

----------

## beandog

For all my flash devices, I mount them with "sync" option, because I hate that "lulz we just copied 20 GBs in one second, and then unmount takes three months." *rage*

That's probably not safe, but that's never been my big concern anyway since I like to break things.

----------

## Ant P.

 *beandog wrote:*   

> UDF?! wat?
> 
> I'm not disparaging you, I've just never heard of the suggestion before and now I'm totally curious why.

 

A few reasons:

- On the surface it doesn't do much more than FAT, i.e. no UID/GID mismatch headaches when moving between machines

- It doesn't have any of FAT's pathname/filesize/charset/swpat problems

- A UDF partition made from a Linux box ought to work anywhere with a bit of persistence (Linux is usually lagging behind other desktop OSes in version support)

- Can be told to write in a flash-friendly way (though I'm not sure how well this works in practice)

The one downside is the mkudffs manpage is nigh impenetrable and geared toward optical media users. I'm pretty sure the default settings are for hard disk mode though.

----------

## pjp

Moved from Multimedia to Kernel & Hardware. Given the subject is primarily SD-Card related and not a sound or video issue, seems to fit better with Hardware.

----------

