一、首先保证USB控制器的移植完成
插入移动硬盘后会出现下面的log,并且arm不会lock up
[ 40.433417]usb 1-1.2: new high-speed USB device number 5 using s5p-ehci
[ 40.524126]usb 1-1.2: New USB device found, idVendor=13fd, idProduct=0840
[ 40.524186]usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 40.524249]usb 1-1.2: Product: External
[ 40.524285]usb 1-1.2: Manufacturer: Generic
[ 40.524323]usb 1-1.2: SerialNumber: 533252514A39424238303135
[ 40.536814]scsi0 : usb-storage 1-1.2:1.0
[ 41.539006]scsi 0:0:0:0: Direct-Access Generic External 1.14 PQ: 0 ANSI: 4
[ 41.545447]sd 0:0:0:0: [sda] 1953525167 512-byte logical blocks: (1.00 TB/931 GiB)
[ 41.546195]sd 0:0:0:0: [sda] Write Protect is off
[ 41.546944]sd 0:0:0:0: [sda] No Caching mode page present
[ 41.546994]sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 41.554307]sd 0:0:0:0: [sda] No Caching mode page present
[ 41.554358]sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 41.561315]sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 41.725437] sda: sda1 sda2
[ 41.748110]sd 0:0:0:0: [sda] No Caching mode page present
[ 41.748161]sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 41.748216]sd 0:0:0:0: [sda] Attached SCSI disk
我使用的是三星1T的笔记本硬盘改装的移动硬盘,分区比较多
[210_Liujia]#ls /dev/sd*
/dev/sda /dev/sda10 /dev/sda12 /dev/sda3 /dev/sda6 /dev/sda8
/dev/sda1 /dev/sda11 /dev/sda2 /dev/sda5 /dev/sda7 /dev/sda9
二、使用ntfs-3g,这个应用可以读写ntfs分区,我曾经在电脑安装ubuntu中,可以编译在ntfs分区中的android代码
1、下载ntfs-3g_ntfsprogs-2013.1.13.tgz(百度随便找的)
2、tar -xf ntfs-3g_ntfsprogs-2013.1.13.tgz
cd ntfs-3g_ntfsprogs-2013.1.13
3、./configure --host=arm-linux CC=arm-linux-gcc -prefix=$PWD/install
然后make
make install
没想到在$PWD/install没有找到所需要的ntfs-3g。
使用whereis ntfs-3g在/bin/ntfs-3g找到了。
把ntfs-3g拷贝到开发板的根文件系统/usr/bin/中
把/lib/libntfs-3g.so.84拷贝到开发板的根文件系统/usr/lib/中
三、插入移动硬盘,使用命令
ntfs-3g /dev/sda1 /udisk
进入udisk可以看到磁盘下的内容