Re: [Yaffs] YAFFS fs images not working the way I expect

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: David Wuertele
CC: yaffs
Subject: Re: [Yaffs] YAFFS fs images not working the way I expect
Hi

I think this is falling down on the "dd" commands.

AFAIK, "dd" will be ignoring the OOB stuff which is required by YAFFS.

Go look in the mtd tools, I think there are some nand specific tools like
damddump or some such that will also extract the OOB info.

-- Charles

On Thursday 21 October 2004 11:23, you wrote:
> I'm trying to dump an image of a YAFFS partition so that I can reload
> it later. Things are not working the way I expect. Here is an
> example of where I'm unable to copy an image onto a partition and
> mount it. Any clues for sale?
>
> 1. create a new YAFFS filesystem on mtd partition 2 using a
>    pregenerated yaffs.dat file, mount it, and verify that the etc and
>    home directories are listed as expected:

>
>   # cd /path/to/mounted/CF/card
>   # /sbin/mkyaffs /dev/mtd/2 /yaffs.dat
>   # /bin/mount -n /dev/mtdblock/2 /mnt/flash0 -t yaffs
>   # ls /mnt/flash0
>   etc         home        lost+found
>   #

>
> 2. unmount that and dump it to a file:
>
> # umount /mnt/flash0
> # /sbin/mkyaffs /dev/mtd/2 /yaffs.dat
> argc 3 sh 0 optcnt 1
> Erasing and programming NAND
> Erasing block at 0x080
> Erasing block at 0x0810000
> <snipping much Erasage...>
> Erasing block at 0x08354000
> OK
> # dd if=/dev/mtd/2 of=mtd2.img bs=16384
> 214+0 records in
> 214+0 records out
> #
>
> 3. copy zeros onto the partition and verify that we can't mount it
>    anymore

>
> # dd if=/dev/zero of=/dev/mtd/2 bs=16384 count=214
> 214+0 records in
> 214+0 records out
> # mount -n /dev/mtdblock/2 /tmp/yaffs -t yaffs
> yaffs: dev is 7938 name is "1f:02"
> mount: Mounting /dev/mtdblock/2 on /tmp/yaffs failed: Not a directory
> #
>
> 4. copy the backup image onto the partition, try (and fail) to mount
>    it, and wonder what I'm doing wrong:

>
> # dd if=mtd2.img of=/dev/mtd/2 bs=16384
> 214+0 records in
> 214+0 records out
> # /bin/mount -n /dev/mtdblock/2 /mnt/flash0 -t yaffs
> yaffs: dev is 7938 name is "1f:02"
> mount: Mounting /dev/mtdblock/2 on /tmp/yaffs failed: Not a directory
> #
>
>
> _______________________________________________
> yaffs mailing list
>
> http://stoneboat.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs