|
SD卡
当SD卡用作USB存储设备测试时,你可以按照类似的方法。可以列出连接的存储设备: - # fdisk -l
- Disk /dev/mmcblk0: 7948 MB, 7948206080 bytes
- 81 heads, 10 sectors/track, 19165 cylinders, total 15523840 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 identifier: 0x00000000
-
- Device Boot Start End Blocks Id System
- /dev/mmcblk0p1 10 15523649 7761820 83 Linux
复制代码
准备SD卡文件系统 这些步骤描述了OpenRex板在新的SD卡建立一个文件系统。下载文件系统。请确保使用最新的文件。将所有的文件复制到主机(我们使用的是Ubuntu 9.04),可以在这里准备SD卡。 检查SD卡是否成功插入。 - # dmesg | tail
- [813850.046729] sd 7:0:0:0: [sdb] Write Protect is off
- [813850.046732] sd 7:0:0:0: [sdb] Mode Sense: 03 00 00 00
- [813850.046733] sd 7:0:0:0: [sdb] Assuming drive cache: write through
- [813850.054749] sd 7:0:0:0: [sdb] 15523840 512-byte hardware sectors: (7.94 GB/7.40 GiB)
- [813850.061263] sd 7:0:0:0: [sdb] Write Protect is off
- [813850.061265] sd 7:0:0:0: [sdb] Mode Sense: 03 00 00 00
- [813850.061267] sd 7:0:0:0: [sdb] Assuming drive cache: write through
- [813850.061272] sdb: sdb1
- [813850.072395] sd 7:0:0:0: [sdb] Attached SCSI removable disk
- [813850.072443] sd 7:0:0:0: Attached scsi generic sg2 type 0
复制代码确保已经挂载SD卡。现在运行分区管理工具(本例中SD卡映射为/dev/sdb),并且建立一个新分区。 - # fdisk /dev/sdb
-
- The number of cylinders for this disk is set to 19165.
- There is nothing wrong with that, but this is larger than 1024,
- and could in certain setups cause problems with:
- 1) software that runs at boot time (e.g., old versions of LILO)
- 2) booting and partitioning software from other OSs
- (e.g., DOS FDISK, OS/2 FDISK)
-
- Command (m for help): p
-
- Disk /dev/sdb: 7948 MB, 7948206080 bytes
- 81 heads, 10 sectors/track, 19165 cylinders
- Units = cylinders of 810 * 512 = 414720 bytes
- Disk identifier: 0x00000000
-
- Device Boot Start End Blocks Id System
- /dev/sdb1 1 19165 7761820 83 Linux
-
- Command (m for help): d
- Selected partition 1
-
- Command (m for help): n
- Command action
- e extended
- p primary partition (1-4)
- p
- Partition number (1-4): 1
- First cylinder (1-19165, default 1):
- Using default value 1
- Last cylinder, +cylinders or +size{K,M,G} (1-19165, default 19165):
- Using default value 19165
-
- Command (m for help): w
- The partition table has been altered!
-
- Calling ioctl() to re-read partition table.
- Syncing disks.
复制代码格式化该分区。 - # mkfs.ext3 /dev/sdb1
- mke2fs 1.41.4 (27-Jan-2009)
- Filesystem label=
- OS type: Linux
- Block size=4096 (log=2)
- Fragment size=4096 (log=2)
- 485760 inodes, 1940455 blocks
- 97022 blocks (5.00%) reserved for the super user
- First data block=0
- Maximum filesystem blocks=1988100096
- 60 block groups
- 32768 blocks per group, 32768 fragments per group
- 8096 inodes per group
- Superblock backups stored on blocks:
- 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
-
- Writing inode tables: done
- Creating journal (32768 blocks): done
- Writing superblocks and filesystem accounting information: done
-
- This filesystem will be automatically checked every 39 mounts or
- 180 days, whichever comes first. Use tune2fs -c or -i to override.
复制代码现在SD卡已经准备好复制文件。挂载SD卡。 - mount /dev/sdb1 /media/sdcard
- cd /media/sdcard
复制代码解压文件系统。 - tar -pxvzf /home/fedevel/imx6rex-xubuntu-13-04-production-04-AUG-2014.tar
复制代码将内核复制到SD卡中。 - cp -prv /home/fedevel/openrex/uImage .
复制代码卸载USB设备,同时SD卡准备好工作了。 可以去掉SD卡并且在OpenRex板上测试。
在u-boot中列出SD卡文件 可以使用以下命令在u-boot中检查SD卡的内容。 |