通过以下命令查看分区:
# cat /proc/partitions major minor #blocks name 31 0 256 mtdblock0 31 1 1280 mtdblock1 31 2 2496 mtdblock2 31 3 4160 mtdblock3 240 0 256 romblock0 240 1 1280 romblock1 240 2 2496 romblock2 240 3 4160 romblock3 # cat /proc/mtd dev: size erasesize name mtd0: 00040000 00010000 "boot" mtd1: 00140000 00010000 "kernel" mtd2: 00270000 00010000 "rootfs" mtd3: 00410000 00010000 "user"
可以看到,mtdblockx对应mtdx,name是通过启动参数传进去的
setenv bootargs 'mem=32M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=squashfs mtdparts=hi_sfc:256K(boot),1280K(kernel),2496K(rootfs),4160K(user)'
因为flash一共8M,所以剩余4160K给user。
mtd的name就是根据这里来的,可以换做其他名称。
系统起来以后,通过这个命令 挂载user分区到home,jffs2必须是内核支持的
# mount -t jffs2 /dev/mtdblock3 /home
刚开始找不到user分区,查找半天才找到原因:是user 大小搞成4190K了,flash是8M的,超过了最大值
这个是识别出user的:
SPI FLASH start_up_mode is 3 Bytes
Spi(cs1):
Block:64KB
Chip:8MB
Name:"W25Q64FV"
spi size: 8MB
chip num: 1
4 cmdlinepart partitions found on MTD device hi_sfc
Creating 4 MTD partitions on "hi_sfc":
0x000000000000-0x000000040000 : "boot"
0x000000040000-0x000000180000 : "kernel"
0x000000180000-0x0000003f0000 : "rootfs"
0x0000003f0000-0x000000800000 : "user"
Fixed MDIO Bus: probed
这个没有识别user
Block:64KB
Chip:8MB
Name:"W25Q64FV"
spi size: 8MB
chip num: 1
mtd: hi_sfc: partitioning exceeds flash size, truncating
3 cmdlinepart partitions found on MTD device hi_sfc
Creating 3 MTD partitions on "hi_sfc":
0x000000000000-0x000000040000 : "boot"
0x000000040000-0x000000180000 : "kernel"
0x000000180000-0x0000003f0000 : "rootfs"
Fixed MDIO Bus: probed
himii: probed
以下转载自 http://blog.chinaunix.net/uid-23835539-id-401937.html
linux的mount支持的文件系统:
adfs, affs, autofs, cifs, coda, coherent,
cramfs, debugfs, devpts, efs, ext, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos,
ncpfs, nfs, nfs4, ntfs, proc, qnx4, ramfs, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs,
umsdos, usbfs, vfat, xenix, xfs, xiafs.