This is a discussion on How to erase a mtdblock before writing to it? - Embedded ; Hi, My flash has a block, say FileSystem2 (mtdblock5). If current running root fs is on FileSystem1, and I want to write a new filesystem image to FileSystem2 for next bootup, how can I erase the fs2 block (mtdblock5) before ...
Hi,
My flash has a block, say FileSystem2 (mtdblock5).
If current running root fs is on FileSystem1,
and I want to write a new filesystem image to
FileSystem2 for next bootup, how can I erase the fs2
block (mtdblock5) before I write into it?
My question is, for example, if mtdblock5 has size of 4MB,
but the new filesystem image is only 2MB. How should I treat
with the rest 4-2=2MB unused block in mtdblock5? Should I
write the rest bytes to a specific char (0xff?)? Or how
can I do the erase through the kernel API?
Thanks,
Sarick