All of lore.kernel.org
 help / color / mirror / Atom feed
* mkfs.btrfs vs fstrim on an SD Card (not SSD)
@ 2014-08-22  0:11 Chris Murphy
  2014-08-22  3:19 ` Chris Murphy
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Murphy @ 2014-08-22  0:11 UTC (permalink / raw)
  To: Btrfs BTRFS

Short version:
When I mkfs.btrfs either an SD Card or an SSD, I get a response back to the effect the whole device specified is trimmed. However, when I use fstrim on an SD Card, I get an error that trim isn't supported. So I'm wondering if anyone knows the difference between how fstrim is trimming, and how mkfs.btrfs is trimming. 

Long version:
It does seem like the mkfs.btrfs one has worked because using dd to read an LBA with known information returns zeros after mkfs.

And then I found the SD Card association has their own formatting tool for Windows and OS X, with the warning "Using generic formatting utilities may result in less than optimal performance for your memory cards."
https://www.sdcard.org/downloads/formatter_4/

So I downloaded the Physical Layer Simplified Specification Version 4.10 spec, and on page 38 it describes an erase command.

4.3.5 Erase
It is desirable to erase many write blocks simultaneously in order to enhance the data throughput. Identification of these write blocks is accomplished with the ERASE_WR_BLK_START (CMD32), ERASE_WR_BLK_END (CMD33) commands.
The host should adhere to the following command sequence: ERASE_WR_BLK_START, ERASE_WR_BLK_END and ERASE (CMD38).

So I'm going to guess that mkfs.btrfs is leveraging something that ends up using these SD Card specific commands on SD Cards, but mkfs.btfs itself isn't aware of this distinction. Whereas fstrim is maybe using something else?

Chris Murphy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-22 13:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-22  0:11 mkfs.btrfs vs fstrim on an SD Card (not SSD) Chris Murphy
2014-08-22  3:19 ` Chris Murphy
2014-08-22 13:04   ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.