Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What FS for a SD-Card is the best?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
SarahS93
l33t
l33t


Joined: 21 Nov 2013
Posts: 693

PostPosted: Fri Jan 26, 2018 7:09 pm    Post subject: What FS for a SD-Card is the best? Reply with quote

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?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Fri Jan 26, 2018 7:21 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54216
Location: 56N 3W

PostPosted: Fri Jan 26, 2018 8:14 pm    Post subject: Reply with quote

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?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
SarahS93
l33t
l33t


Joined: 21 Nov 2013
Posts: 693

PostPosted: Fri Jan 26, 2018 8:34 pm    Post subject: Reply with quote

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
Code:
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?
Back to top
View user's profile Send private message
saboya
Guru
Guru


Joined: 28 Nov 2006
Posts: 552
Location: Brazil

PostPosted: Fri Jan 26, 2018 9:33 pm    Post subject: Reply with quote

F2FS maybe?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54216
Location: 56N 3W

PostPosted: Fri Jan 26, 2018 9:45 pm    Post subject: Reply with quote

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.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
SarahS93
l33t
l33t


Joined: 21 Nov 2013
Posts: 693

PostPosted: Fri Jan 26, 2018 10:18 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54216
Location: 56N 3W

PostPosted: Fri Jan 26, 2018 10:39 pm    Post subject: Reply with quote

SarahS93,

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

You need a filesystem from the kernel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
SarahS93
l33t
l33t


Joined: 21 Nov 2013
Posts: 693

PostPosted: Sat Jan 27, 2018 10:52 am    Post subject: Reply with quote

With F2FS, i have no stops in my downloads and read files for the checksum, it works good.
Back to top
View user's profile Send private message
Goverp
Veteran
Veteran


Joined: 07 Mar 2007
Posts: 1995

PostPosted: Sat Jan 27, 2018 4:05 pm    Post subject: Reply with quote

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.
_________________
Greybeard
Back to top
View user's profile Send private message
beandog
Bodhisattva
Bodhisattva


Joined: 04 May 2003
Posts: 2072
Location: /usa/utah

PostPosted: Tue Feb 06, 2018 11:37 pm    Post subject: Reply with quote

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.
_________________
If it ain't broke, tweak it. dvds | blurays | blog | wiki
Back to top
View user's profile Send private message
beandog
Bodhisattva
Bodhisattva


Joined: 04 May 2003
Posts: 2072
Location: /usa/utah

PostPosted: Tue Feb 06, 2018 11:38 pm    Post subject: Reply with quote

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.
_________________
If it ain't broke, tweak it. dvds | blurays | blog | wiki
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Wed Feb 07, 2018 1:36 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Wed Feb 07, 2018 1:45 am    Post subject: Reply with quote

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.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum