Userspace write to UBI partitions

Ricard Wanderlof ricard.wanderlof at axis.com
Tue Feb 7 11:36:25 EST 2012


On Tue, 7 Feb 2012, Shmulik Ladkani wrote:

> On Tue, 7 Feb 2012 16:20:58 +0100 (CET) Ricard Wanderlof <ricard.wanderlof at axis.com> wrote:
>>
>> Is it possible to do a userspace write to a UBI volume as if it were plain
>> flash memory, i.e. should I be able to do "cat somefile > /dev/ubi0_0" ? I
>> get a 'Write Error: Operation not permitted' when I do this (Linux 2.6.35)
>> but I'm pretty sure that I've used UBI volumes that way in the past, may
>> have been with older kernels then.
>
> Is your volume dynamic or static?

I tried both, but given the nature of the data we want to keep in the 
volume it should really be dynamic.

> If dynamic, have you tried setting the UBI_VOL_PROP_DIRECT_WRITE
> property by issuing a UBI_IOCSETVOLPROP volume ioctl?
> (formerly named UBI_PROP_DIRECT_WRITE and UBI_IOCSETPROP)

Thanks for the pointer, I've never noticed this ioctl before.

I'll try this out. In the meantime, there doesn't seem to be an ioctl for 
erasing blocks?

/Ricard
-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the linux-mtd mailing list