2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【2023年8月版】macOS で f3 によるSDカードの容量偽装チェック【f3write/f3read】

Last updated at Posted at 2023-08-24

はじめに

よし、SDカードとどいたぞ。

まずは、容量の偽装チェックかな。

macOS でSDカードの偽装チェクは f3 やな。

Ubuntu での記事は以下を参照
【2023年06月版】Ubuntu22.04 で f3 によるデバイスの Read/Write パフォーマンス計測【容量偽装チェック】

f3 とは

F3は"Fight Flash Fraud"または"Fight Fake Flash"の略。
フラッシュメモリ(USBフラッシュドライブやSDカードなど)の性能と容量をテストするためのオープンソースソフトウェア。
F3は、元々Linuxで動作するツールとして開発されたが、現在ではWindowsやmacOSなど他のプラットフォームでも利用可能。

F3は偽造されたフラッシュメモリを検出するために使われる。
市場には、特に安価な製品の中に、容量を偽って表示しているフラッシュメモリが存在する。
例えば、USBドライブが32GBの容量があると表示していても、実際にはそれよりはるかに少ない容量しか利用できない場合がある。
F3は、このような偽装されたフラッシュメモリを検出するために開発された。

F3には主に二つのコマンド、f3writeとf3readが含まれている。

f3write: テスト対象のフラッシュメモリに特定のパターンのデータを書き込む。このデータは後で検証のために使用される。
f3read: f3writeによって書き込まれたデータを読み出し、そのデータが正しく保存されているかを検証する。読み出したデータが書き込まれたときのデータと一致しなければ、そのフラッシュメモリには何らかの問題があると判断できる。

これらのコマンドを使用することで、フラッシュメモリの真の容量とパフォーマンスを確認することができる。

インストール

$ brew install f3

使い方

f3write で書き込みして、f3read で読み込んで書き込み内容を検証する

書き込み

マウントしているドライブを指定する

% f3write /Volumes/Untitled  
F3 write 8.0
Copyright (C) 2010 Digirati Internet LTDA.
This is free software; see the source for copying conditions.

Free space: 117.73 GB
Creating file 1.h2w ... OK!                                   
Creating file 2.h2w ... OK!                           
Creating file 3.h2w ... OK!                         
Creating file 4.h2w ... OK!                         
Creating file 5.h2w ... OK!                         
Creating file 6.h2w ... OK!                         
Creating file 7.h2w ... OK! 
  :
  :
Creating file 116.h2w ... OK!                         
Creating file 117.h2w ... OK!                        
Creating file 118.h2w ... OK!                        
Free space: 0.00 Byte
Average writing speed: 36.42 MB/s

読み込み

マウントしているドライブを指定する

% f3read /Volumes/Untitled
F3 read 8.0
Copyright (C) 2010 Digirati Internet LTDA.
This is free software; see the source for copying conditions.

                  SECTORS      ok/corrupted/changed/overwritten
Validating file 1.h2w ... 2097152/        0/      0/      0
Validating file 2.h2w ... 2097152/        0/      0/      0
Validating file 3.h2w ... 2097152/        0/      0/      0
Validating file 4.h2w ... 2097152/        0/      0/      0
Validating file 5.h2w ... 2097152/        0/      0/      0
Validating file 6.h2w ... 2097152/        0/      0/      0
Validating file 7.h2w ... 2097152/        0/      0/      0
  :
  :
Validating file 116.h2w ... 2097152/        0/      0/      0
Validating file 117.h2w ... 2097152/        0/      0/      0
Validating file 118.h2w ... 1537408/        0/      0/      0

  Data OK: 117.73 GB (246904192 sectors)
Data LOST: 0.00 Byte (0 sectors)
	       Corrupted: 0.00 Byte (0 sectors)
	Slightly changed: 0.00 Byte (0 sectors)
	     Overwritten: 0.00 Byte (0 sectors)
Average reading speed: 88.06 MB/s

まとめ

ワンライナーなら

f3write /Volumes/Untitled && f3read /Volumes/Untitled

さいごに

かんたんでしたね

参考資料

f3 - Fight Flash Fraud
f3 - Compile stable software on Apple Mac

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?