Question about ubiformat

Daniel Bowen dbowen at logitech.com
Fri Aug 8 08:10:44 PDT 2014


Great, thanks for the response!  So, if the mtd partition were say 500 erase
blocks large, and the image was 300 erase blocks large, would "ubiformat
/dev/mtd4 -f /mnt/source/ubi.img" 
1. only touch the first 300 blocks of the partition, and leave the other 200
unmodified?  Or 
2. would it write the image into the first 300 blocks, and erase the
remaining 200 blocks?

Thanks!
-Daniel

-----Original Message-----
From: Brian Norris [mailto:computersforpeace at gmail.com] 
Sent: Friday, August 08, 2014 12:20 AM
To: Daniel Bowen
Cc: linux-mtd at lists.infradead.org
Subject: Re: Question about ubiformat

Hi Daniel,

On Thu, Aug 07, 2014 at 06:06:27PM -0600, Daniel Bowen wrote:
> Let's say that I've prepared an image using mkfs.ubifs and ubinize.  Is
> there any advantage, disadvantage or difference to doing ubiformat twice -
> once without specifying an image file, then running it a second time with
an
> image file?  In other words, is there a difference between these two
> sequences:
> 
> ubiformat /dev/mtd4
> ubiformat /dev/mtd4 -f /mnt/source/ubi.img
> 
> and
> 
> ubiformat /dev/mtd4 -f /mnt/source/ubi.img

ubiformat always saves erase counters, so running it twice should not be
extra-destructive. The primary effect is that you will put the whole
device through an extra erase cycle unnecessarily (slightly reducing the
flash's lifetime), because ubiformat.c's format() function loops through
all eraseblocks and erases them.

But I think either sequence should have the same functional result.

Brian




More information about the linux-mtd mailing list