On 2011-07-25, at 7:39 PM, Yongqiang Yang wrote: > On Mon, Jul 25, 2011 at 9:10 PM, Ted Ts'o <tytso@xxxxxxx> wrote: >> On Sat, Jul 23, 2011 at 12:49:28AM +0900, Round Robinjp wrote: >>> I have a question regarding making ext4 image for >>> large eMMC partition. >>> >>> We have a 4G partition in our embedded device >>> in which we want to use ext4 filesystem. >>> But for that we have to create a 4G image. >>> flashing this 4G image to the eMMC takes a long >>> time. Is there any way to reduce this time? >>> >>> For vfat, you can truncate the image leaving only >>> non zero-filled blocks which makes the image very >>> short and the time for flashing is reduced. >>> Is something similar to that possible for ext4? >> >> I'm guessing the problem is you've already created a file system image >> which is 4G, and for which a large number of the blocks are not used, >> and you're trying to optimize the amount of time it takes to flash the >> image. Is that right? > > Now the fs is clean, so we can delete journal. After the image is > flashed to the eMMC, we can add journal again. I think tune2fs can > add and delete journal. Am I rgiht? Yes, "tune2fs -O ^has_journal {dev}" will remove the journal (if clean). That will save 32MB of space in your image. Then, use "resize2fs -M {dev}" to shrink the image as small as possible, and then after restoring the image, run "resize2fs {dev}" to grow the image to fill the device again and "tune2fs -j {dev}" will add it again with the default size. Cheers, Andreas -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html