* Question about ubiformat @ 2014-08-08 0:06 Daniel Bowen 2014-08-08 6:19 ` Brian Norris 0 siblings, 1 reply; 6+ messages in thread From: Daniel Bowen @ 2014-08-08 0:06 UTC (permalink / raw) To: linux-mtd 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 Thanks! -Daniel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about ubiformat 2014-08-08 0:06 Question about ubiformat Daniel Bowen @ 2014-08-08 6:19 ` Brian Norris 2014-08-08 15:10 ` Daniel Bowen 0 siblings, 1 reply; 6+ messages in thread From: Brian Norris @ 2014-08-08 6:19 UTC (permalink / raw) To: Daniel Bowen; +Cc: linux-mtd 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Question about ubiformat 2014-08-08 6:19 ` Brian Norris @ 2014-08-08 15:10 ` Daniel Bowen 2014-08-08 16:27 ` Brian Norris 0 siblings, 1 reply; 6+ messages in thread From: Daniel Bowen @ 2014-08-08 15:10 UTC (permalink / raw) To: 'Brian Norris'; +Cc: linux-mtd 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@gmail.com] Sent: Friday, August 08, 2014 12:20 AM To: Daniel Bowen Cc: linux-mtd@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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about ubiformat 2014-08-08 15:10 ` Daniel Bowen @ 2014-08-08 16:27 ` Brian Norris 2014-08-08 16:34 ` Artem Bityutskiy 0 siblings, 1 reply; 6+ messages in thread From: Brian Norris @ 2014-08-08 16:27 UTC (permalink / raw) To: Daniel Bowen; +Cc: linux-mtd On Fri, Aug 08, 2014 at 09:10:44AM -0600, Daniel Bowen wrote: > 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? It erases every block, writes the image to the first 300, and programs EC headers to the last 200. The source for ubiformat is actually pretty simple and easy to read. Check it out yourself! http://git.infradead.org/mtd-utils.git Brian ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about ubiformat 2014-08-08 16:27 ` Brian Norris @ 2014-08-08 16:34 ` Artem Bityutskiy 2014-08-08 16:55 ` Daniel Bowen 0 siblings, 1 reply; 6+ messages in thread From: Artem Bityutskiy @ 2014-08-08 16:34 UTC (permalink / raw) To: Brian Norris; +Cc: linux-mtd, Daniel Bowen On Fri, 2014-08-08 at 09:27 -0700, Brian Norris wrote: > It erases every block, writes the image to the first 300, and programs > EC headers to the last 200. Yes, confirmed. -- Best Regards, Artem Bityutskiy ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Question about ubiformat 2014-08-08 16:34 ` Artem Bityutskiy @ 2014-08-08 16:55 ` Daniel Bowen 0 siblings, 0 replies; 6+ messages in thread From: Daniel Bowen @ 2014-08-08 16:55 UTC (permalink / raw) To: dedekind1, 'Brian Norris'; +Cc: linux-mtd > > It erases every block, writes the image to the first 300, and programs > > EC headers to the last 200. > > Yes, confirmed. Perfect - thanks so much to both of you! -Daniel ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-08-08 16:55 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-08-08 0:06 Question about ubiformat Daniel Bowen 2014-08-08 6:19 ` Brian Norris 2014-08-08 15:10 ` Daniel Bowen 2014-08-08 16:27 ` Brian Norris 2014-08-08 16:34 ` Artem Bityutskiy 2014-08-08 16:55 ` Daniel Bowen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).