lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 25 Jul 2011 21:36:36 +0300
From:	Amir Goldstein <amir73il@...il.com>
To:	"Ted Ts'o" <tytso@....edu>
Cc:	Round Robinjp <roundrobinjp@...oo.co.jp>,
	linux-ext4@...r.kernel.org
Subject: Re: flashing large eMMC partitions with ext4

On Mon, Jul 25, 2011 at 9:10 PM, Ted Ts'o <tytso@....edu> wrote:
> On Sat, Jul 23, 2011 at 12:49:28AM +0900, Round Robinjp wrote:
>> Hi
>>
>> 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?
>
> OK, so it's not obvious what problem you are trying to ask here.
>
> It sounds like Andreas was trying to help you solve the problem of
> minimizing the number of blocks written by mke2fs.
>
> 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?
>

I am going to make a 3rd guess and we will see who was closest ;-)
My guess is that Round wan't a "short" image, just like he wrote.
vfat image can simply be truncated, because all initial blocks are at the
beginning of the partition.

One could truncate the result of an ext4 image to quite less than 4G,
for example, if flex_bg is set to 32, all bitmaps are at the block group 0.
copies of the super block can be discarded, since one has the copy in
the image file.

The only important piece of information, not in the beginning of the partition
is the super block of the journal, which is usually in the middle of the fs,
so one needs do some tricks to allocate the journal from group 0.
Is there a mke2fs option to do that?

All-in-all, I think it should be easy to prepare a 4G image that could
be truncated
to one group (128M).

Amir.

> The way to do that is to use a program like zerofree.c (google it, or
> see attached) to make sure the non-used blocks are zero-filled, and
> then use a program like make-sparse.c (see the e2fsprogs sources, in
> the contrib directory) to only write the non-zero blocks to the flash
> device.
>
> Regards,
>
>                                                - Ted
>
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ