title: Write on a mtd block device
body: <p>I'm trying to write on a NAND flash memory using MTD block device but I don't understand everything.</p>
  
  <p>As I read <a href="http://etutorials.org/Linux+systems/embedded+linux+systems/Chapter+7.+Storage+Device+Manipulation/7.1+MTD-Supported+Devices/" rel="noreferrer">here</a></p>
  
  <ul>
  <li><code>mtdblockN</code> is the read only block device N</li>
  <li><code>mtdN</code> is the read/write char device N</li>
  <li><code>mtdNro</code> is the read only char device N</li>
  </ul>
  
  <p>But I'd like to directly write bytes to the partition using a simple <code>write</code> in C and I don't understand how it works (I read somewhre that I first must erase the sectors I want to write on). </p>
  
  <p>Which device should I use and how to write on this device?</p>