1、 在WINDOWS下FAT32格式化整个SD卡;
2、 切换到虚拟机下,在UBUNTU9。04的环境下,系统能识别出SD卡,其中/dev/sdc即为SD卡存储设备;glose@glose-desktop:/media$ cat /proc/partitions
major minor #blocks name
8 0 20971520 sda
8 1 20049088 sda1
8 2 1 sda2
8 5 915673 sda5
8 32 1997312 sdb
使用df -h,可以看出其挂载点为/media/disk;
/dev/sdb 2.0G 4.0K 2.0G 1% /media/disk
3、copy bootloader镜像
glose@glose-desktop:/tftpboot$ ls
u-boot-bbg.bin u-boot-bbg-no-padding.bin uImage
glose@glose-desktop:/tftpboot$ sudo dd if=./u-boot-bbg.bin of=/dev/sdb bs=512 && sync && sync
记录了 274+1 的读入
记录了 274+1 的写出
140660字节(141 kB)已复制,0.000910636 秒,154 MB/秒
4、copy内核镜像
glose@glose-desktop:/tftpboot$ sudo dd if=./uImage of=/dev/sdb bs=512 seek=2048 && sync && sync
记录了 4429+1 的读入
记录了 4429+1 的写出
2267676字节(2.3 MB)已复制,0.0549108 秒,41.3 MB/秒
5、copy根文件系统
glose@glose-desktop:/tftpboot$ sudo fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x390ef65e.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): u
Changing display/entry units to sectors
Command (m for help): p
Disk /dev/sdb: 2045 MB, 2045247488 bytes
63 heads, 62 sectors/track, 1022 cylinders, total 3994624 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x390ef65e
Device Boot Start End Blocks Id System
Command (m for help): d
No partition is defined yet!
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First sector (62-3994623, default 62): 8192
Last sector, +sectors or +size{K,M,G} (8192-3994623, default 3994623):
Using default value 3994623
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
glose@glose-desktop:/tftpboot$
注意重新启动系统。sudo reboot
glose@glose-desktop:~$ sudo mkfs.ext3 /dev/sdb1
[sudo] password for glose:
mke2fs 1.41.4 (27-Jan-2009)
/dev/sdb1 is mounted; will not make a filesystem here!
得先把其umonut
glose@glose-desktop:~$ sudo umount /media/disk/
glose@glose-desktop:~$ sudo 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)
124672 inodes, 498304 blocks
24915 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=511705088
16 block groups
32768 blocks per group, 32768 fragments per group
7792 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: