UBI_READWRITE constraint when opening volumes to rename

Andrew Murray amurray at embedded-bits.co.uk
Tue Oct 7 07:31:11 PDT 2014


Hello,

I'd like to be able to safely rename a UBI volume that contains a
mounted UBIFS volume.

This allows for firmware upgrade via the following steps:

- ubimkvol rootfs_new
- ubiupdatevol rootfs_new
- ubirename rootfs rootfs_old rootfs_new rootfs
- reboot
- ubirmvol rootfs_old

Such an approach makes upgrade of a root filesystem simple as there is
no need to unmount the root filesystem. I believe this question has
been asked before on this mailing list
(http://lists.infradead.org/pipermail/linux-mtd/2012-February/039743.html).

This process isn't possible at the moment as 'rename_volumes' opens
the UBI volume with UBI_READWRITE. Unfortunately UBIFS always opens
UBI with UBI_READWRITE regardless to if the user mounts as read-only.
If 'rename_volumes' is changed to UBI_READONLY then the above process
works.

I understand that this patch
https://patchwork.ozlabs.org/patch/339711/ recently changed the first
open restraint in 'rename_volumes' from UBI_EXCLUSIVE to
UBI_READWRITE. I'd like to understand if there are any risks in
changing it to UBI_READONLY?

Thanks,

Andrew Murray



More information about the linux-mtd mailing list