Raspberry Pi&CentOS 7でntfs-3gを使う

Raspberry Piでわざわざ面倒なことをするシリーズ。
今回はntfs-3gを使用してNTFSをRaspberry Piにマウントしてみたいと思います。

Screenshot of www.tuxera.com

Open Source: NTFS-3G

依存パッケージはgccとglibc-develですが、ほとんどの場合入っているでしょう。
まずは、wgetでntfs-3gのソースをダウンロードし解凍します。

# wget https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2016.2.22.tgz
# tar zxvf ntfs-3g_ntfsprogs-2016.2.22.tgz

ntfs-3g_ntfsprogs-2016.2.22フォルダに移動し
configureでMakefileを作成します。(結構時間がかかります。)

# cd ntfs-3g_ntfsprogs-2016.2.22
# ./configure

makeでコンパイルします。(同、結構時間がかかります。)

# make

root権限でmake installを実行します。(同、結構時間がかかります。)

# make install

NTFSのストレージをUSBポートに差し込み、デバイスを認識しているか確認します。
デバイスが表示されない場合は、dmesgにデバイスの認識に関するログが出ています。

# fdisk -l

Disk /dev/sdc: 30.8 GB, 30752000000 bytes, 60062500 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000000

 Device Boot Start End Blocks Id System
/dev/sdc1 32 60062499 30031234 7 HPFS/NTFS/exFAT

今回は、/dev/sdcで認識されているようですので、これをマウントします。

# mount -t ntfs /dev/sdc1 /mnt

なお、読み込み専用でマウントしたい場合は、-rオプションをつけます。

# mount -r -t ntfs /dev/sdc1 /mnt

NTFSストレージのトップディレクトリにあるファイル一覧を出してみます。

# ls /mnt
NTFS-USB.txt System Volume Information

正常に認識されています。
Raspberry PiはWindowsのデータ救出用端末としても使えそうです。

You may also like...