1. 把U盘插入开发板,开发板命令行提示如下
# usb 1-2: new high-speed USB device number 2 using atmel-ehci
usb 1-2: New USB device found, idVendor=090c, idProduct=1000, bcdDevice=11.00
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-2: Product: USB Flash Disk
usb 1-2: Manufacturer: General
usb 1-2: SerialNumber: 0333416030047957
usb-storage 1-2:1.0: USB Mass Storage device detected
usb-storage 1-2:1.0: Quirks match for vid 090c pid 1000: 400
scsi host0: usb-storage 1-2:1.0
scsi 0:0:0:0: Direct-Access General USB Flash Disk 1100 PQ: 0 ANSI: 6
sd 0:0:0:0: [sda] 31481856 512-byte logical blocks: (16.1 GB/15.0 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 0:0:0:0: [sda] Attached SCSI removable disk
2.确认U盘文件系统
# fdisk -l
Disk /dev/ram0: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram1: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram2: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram3: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mmcblk0: 14.84 GiB, 15931539456 bytes, 31116288 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
Disklabel type: dos
Disk identifier: 0xaad64a9b
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 34815 32768 16M c W95 FAT32 (LBA)
/dev/mmcblk0p2 34816 1083391 1048576 512M 83 Linux
Disk /dev/sda: 15.01 GiB, 16118710272 bytes, 31481856 sectors
Disk model: USB Flash Disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x73736572
Device Boot Start End Sectors Size Id Type
/dev/sda1 1920221984 3736432267 1816210284 866G 72 unknown
/dev/sda2 1936028192 3889681299 1953653108 931.6G 6c unknown
/dev/sda3 0 0 0 0B 0 Empty
/dev/sda4 27722122 27722568 447 223.5K 0 Empty
Partition table entries are not in disk order.
3. 查看当前开发板支持的文件系统
# cat /proc/filesystems
nodev sysfs
nodev tmpfs
nodev bdev
nodev proc
nodev cgroup
nodev cgroup2
nodev devtmpfs
nodev configfs
nodev debugfs
nodev sockfs
nodev pipefs
nodev ramfs
nodev rpc_pipefs
nodev devpts
ext3
ext2
ext4
vfat
nodev nfs
nodev ubifs
4. U盘格式化为fat32
5. make linux-menuconfig设置支持fat格式,编译内核,然后烧写sdcard.img到sd卡
6. 重新插入U盘到开发板,查看当前挂载
# fdisk -l
Disk /dev/ram0: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram1: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram2: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram3: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mmcblk0: 14.84 GiB, 15931539456 bytes, 31116288 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
Disklabel type: dos
Disk identifier: 0x8cdc9d96
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 34815 32768 16M c W95 FAT32 (LBA)
/dev/mmcblk0p2 34816 1083391 1048576 512M 83 Linux
Disk /dev/sda: 7.47 GiB, 8021606400 bytes, 15667200 sectors
Disk model:
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xae856d9d
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 614400 15052799 14438400 6.9G c W95 FAT32 (LBA)
/dev/sda2 15052800 15663102 610303 298M 16 Hidden FAT16
# ls /dev/
block mtd3ro tty14 tty49
bus mtd4 tty15 tty5
char mtd4ro tty16 tty50
console mtd5 tty17 tty51
cpu_dma_latency mtd5ro tty18 tty52
disk mtd6 tty19 tty53
fd mtd6ro tty2 tty54
full null tty20 tty55
gpiochip0 ptmx tty21 tty56
gpiochip1 pts tty22 tty57
gpiochip2 ptyp0 tty23 tty58
gpiochip3 ptyp1 tty24 tty59
hwrng ptyp2 tty25 tty6
i2c-0 ptyp3 tty26 tty60
iio:device0 ram0 tty27 tty61
input ram1 tty28 tty62
kmsg ram2 tty29 tty63
log ram3 tty3 tty7
loop-control random tty30 tty8
loop0 rfkill tty31 tty9
loop1 rtc tty32 ttyS0
loop2 rtc0 tty33 ttyS2
loop3 rtc1 tty34 ttyp0
loop4 sda tty35 ttyp1
loop5 sda1 tty36 ttyp2
loop6 sda2 tty37 ttyp3
loop7 shm tty38 ubi_ctrl
mem snd tty39 urandom
mmcblk0 stderr tty4 vcs
mmcblk0p1 stdin tty40 vcs1
mmcblk0p2 stdout tty41 vcsa
mtd0 tty tty42 vcsa1
mtd0ro tty0 tty43 vcsu
mtd1 tty1 tty44 vcsu1
mtd1ro tty10 tty45 vhci
mtd2 tty11 tty46 watchdog
mtd2ro tty12 tty47 watchdog0
mtd3 tty13 tty48 zero
7. 挂载U盘,可以查看到U盘里的文件
# mount /dev/sda1 /mnt
# ls /mnt
System Volume Information rgb-led