'ubi clone' from Live NAND.
Gupta, Pekon
pekon at ti.com
Thu Mar 7 07:11:59 EST 2013
> If 'rootfs.ubi' is the 'ubinize' image, then I can mount and see the
> file system on my PC. However, if the 'rootfs.ubi' is a 'dump' of the
> NAND flash, I fail with the following 'dmesg',
[pekon]
I have tried this, using following steps, and it works well
(1) nanddump -b -s 0x0 -l <size_of_source_partition> -f <image_dump.bin> <source_partition>
(2) flash_erase <target_partition> 0 0
(3) nandwrite -n -r <target_partition> <image_dump.bin>
where,
source_partition= partition on source device from which NAND binary would be dumped. (/dev/mtdX)
target_partition= partition on another device which NAND dumped image would be flashed (/dev/mtdY)
You need to keep few things in mind..
(1) sizeof(target_partion) > sizeof(source_partition), So as to take care of bad-blocks present on target device.
(2) '-n' option in nandwrite tells NAND driver not to calculate ECC while programming nand, as its is already part of 'raw' binary image
(3) You need to 'nanddump' complete source_partition (and not just image-size), because of following reasons
(a) Image data may be shifted to other offsets due to presence of bad-blocks
(b) If you are using 'autoresize' option, then UBIFS Volume may expand itself to cover entire free space first mount.
[Refer http://www.linux-mtd.infradead.org/doc/ubi.html#L_autoresize]
with regards, pekon
More information about the linux-mtd
mailing list