Skip to contentSkip to conversation

Looking for an alternative to ubimirror

DISCUSSION PJ 2 participants 4 messages May 27, 2016 Memory technology devices (MTD)

lore
Share & tools
lore

PJ

author
#0 lore raw

Hi,

Can anyone please recommend a procedure to copy one UBI volume to another?

I'd like to execute from the bash command line, if possible.

One upon a time I was able to use ubimirror, however that command appears to have been removed from mtd-utils.

- The source volume will be mounted R/O as it is the rootfs.
- The destination volume will be unrestricted (unmounted).
- Both the source and destination volumes are in the same device.

I checked the FAQ, the archive, and Google but I came up empty, so thanks.

Paul

#1 lore raw
Quoted 6 lines · PJ

Hi,

Can anyone please recommend a procedure to copy one UBI volume to another?

I'd like to execute from the bash command line, if possible.

Quoted 8 lines

One upon a time I was able to use ubimirror, however that command appears to have been removed from mtd-utils.

- The source volume will be mounted R/O as it is the rootfs.
- The destination volume will be unrestricted (unmounted).
- Both the source and destination volumes are in the same device.

I checked the FAQ, the archive, and Google but I came up empty, so thanks.

This happened some time ago:
commit 94a20240f9d6776619d7652013bb10131ddad1fc

Author: Artem Bityutskiy <[email protected]>
Date:   Tue Sep 28 10:47:06 2010 +0300

ubi-utils: remove old ubi-utils

The utilities are unmaintained for long time, and many of them do not even work, just compile, and no on complains about this. This suggests they are unused and we can now safely kill them.

Artem? :-)

Signature · 2 lines
Thanks,
//richard
#2 lore raw
In reply to PJ
Quoted 4 lines · PJ

Hi,

Can anyone please recommend a procedure to copy one UBI volume to another?

Quoted 8 lines

I'd like to execute from the bash command line, if possible.

One upon a time I was able to use ubimirror, however that command appears to have been removed from mtd-utils.

- The source volume will be mounted R/O as it is the rootfs.
- The destination volume will be unrestricted (unmounted).
- Both the source and destination volumes are in the same device.

Did you try dd if=/dev/ubiX_Y ... | ubiupdatevol ...?

Signature · 2 lines
Thanks,
//richard
author
#3 lore raw

Thanks Richard. It works for me.

An example for future reference. Copy /dev/ubi0_0 to /dev/ubi0_1:

The volume size (in bytes) is required when calling ubiupdatevol without an image file. It can be retrieved from ubinfo, something like this:
VOLSIZE=$(ubinfo /dev/ubi0_0 | grep -o '[0-9]\+ bytes' | grep -o '[0-9]\+')

In the ubiupdatevol a single dash ('-') is used in place of an image-file to trigger use of stdin. dd if=/dev/ubi0_0 | ubiupdatevol /dev/ubi0_1 - -s ${VOLSIZE}

Paul

-----Original Message-----
From: Richard Weinberger [mailto:[email protected]]
Sent: Friday, May 27, 2016 3:20 AM
To: PJ
Cc: [email protected]
Subject: Re: Looking for an alternative to ubimirror

Quoted 4 lines · PJ

Hi,

Can anyone please recommend a procedure to copy one UBI volume to another?

Quoted 8 lines

I'd like to execute from the bash command line, if possible.

One upon a time I was able to use ubimirror, however that command appears to have been removed from mtd-utils.

- The source volume will be mounted R/O as it is the rootfs.
- The destination volume will be unrestricted (unmounted).
- Both the source and destination volumes are in the same device.

Did you try dd if=/dev/ubiX_Y ... | ubiupdatevol ...?

--
Thanks,
//richard