识别 SD 卡:将 SD 读卡器再次插入 PC 机 USB 端口,此时 Windows 会安装相关驱动程序, 识别后读卡器上指示灯会亮起; uBuntu 窗口中则可以识别新插入的 SD 卡,标志是在桌面左上角显示识别出盘的图标,如下图。 uBuntu 系统自动识别并挂载识别到的 SD 卡分区,如需要查看挂载点可在这个图标上单击鼠标右键,并在弹出式菜单上选择 “ 属性 ” ;【 2.0 GB 介质 属性】单击打开 Volume 卡片,可看到此分区的文件系统属于 vfat ,挂载点为 /media/disk 。
进入终端,按如下操作
root@realtimedsp-desktop:~# fdisk /dev/sdb
Command (m for help): p
Disk /dev/sdb: 2021 MB, 2021654528 bytes
63 heads, 62 sectors/track, 1010 cylinders
Units = cylinders of 3906 * 512 = 1999872 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 1 1010 1972499 83 Linux
Command (m for help): d
Selected partition 1
Command (m for help): p
Disk /dev/sdb: 2021 MB, 2021654528 bytes
63 heads, 62 sectors/track, 1010 cylinders
Units = cylinders of 3906 * 512 = 1999872 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1010, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1010, default 1010): +50M
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))
Command (m for help): a
Partition number (1-4): 1
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (28-1010, default 28): //默认回车就好
Using default value 28
Last cylinder, +cylinders or +size{K,M,G} (28-1010, default 1010): //默认回车就好
Using default value 1010
Command (m for help): p
Disk /dev/sdb: 2021 MB, 2021654528 bytes
63 heads, 62 sectors/track, 1010 cylinders
Units = cylinders of 3906 * 512 = 1999872 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 27 52700 c W95 FAT32 (LBA)
/dev/sdb2 28 1010 1919799 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
root@realtimedsp-desktop:~#
注意在执行最后一条指令 。即Command (m for help): w时 要卸载sd卡。
此时连接虚拟机的sd卡设备,会弹出f32 和 ext3
在终端下 输入
root@realtimedsp-desktop:~# mount
/dev/sda1 on / type ext3 (rw,relatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
securityfs on /sys/kernel/security type securityfs (rw)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
/dev/sdb1 on /media/FAT32 type vfat (rw,nosuid,nodev,uhelper=hal,shortname=mixed,uid=0,utf8,umask=077,flush)
/dev/sdb2 on /media/EXT3 type ext3 (rw,nosuid,nodev,uhelper=hal) //这是我们创建的sd卡分设备
root@realtimedsp-desktop:~# umount /dev/sdb1 先卸载
root@realtimedsp-desktop:~# mkfs.msdos -F32 /dev/sdb1 -nFAT32 然后格式化
mkfs.msdos 3.0.1 (23 Nov 2008)
root@realtimedsp-desktop:~# umount /dev/sdb2 先卸载
root@realtimedsp-desktop:~# mkfs.ext3 /dev/sdb2 -LEXT3 然后格式化
mke2fs 1.41.4 (27-Jan-2009)
Filesystem label=EXT3
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
120000 inodes, 479949 blocks
23997 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=494927872
15 block groups
32768 blocks per group, 32768 fragments per group
8000 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
root@realtimedsp-desktop:~#
重新挂载我们的sd卡后,然后将我们的文件系统拷入ext3盘中即可。
Arm启动参数设置
U-Boot > setenv bootargs 'console=ttyS2,115200n8 noinitrd rw ip=192.168.0.3
root=/dev/mmcblk0p2 mem=64M'