General question about mounting mtdblock device

Artem Bityutskiy dedekind1 at gmail.com
Tue Jul 1 07:27:22 PDT 2014


On Mon, 2014-06-23 at 14:57 +0000, Riyaz R, Syed Ismail wrote:
> Is it safe to do a flash_eraseall and nandwrite a jffs2 image on a mtdblock that is not unmounted cleanly, then mount to a new mount point.
> i.e,
> 1)mount -t jffs2 /dev/mtdblock2 /mnt/1/
> 2)flash_eraseall -j /dev/mtd2
> 3)nandwrite -p /dev/mtdblock2 jffs2_image
> 4)mount -t jffs2 /dev/mtdblock2 /mnt/1/

Changing the contents of the flash while it is mounted is not safe and
will to I/O errors.

> The mount point is different.

The difference is at the VFS level, JFFS2 will basically "see" one flash
device mounted.

>  This is just a workaround to account for *if* umount doesn't work.
> 
> Will the 2nd mount result in nand corruption, since both are accessing
> same nand space. Specifically, will reboot in such a scenario cause
> problems, since both will try to sync and unmounts at the time.

You can create as many mount points as you want, VFS will take care of
that.

But when the media is mounted, you should not change it directly.

-- 
Best Regards,
Artem Bityutskiy




More information about the linux-mtd mailing list