Changing default root file system to btrfs
james.tunnicliffe at linaro.org
Fri Aug 5 11:08:34 UTC 2011
On 4 August 2011 15:37, David Gilbert <david.gilbert at linaro.org> wrote:
> On 4 August 2011 15:28, James Tunnicliffe <james.tunnicliffe at linaro.org> wrote:
>> On 4 August 2011 14:56, David Gilbert <david.gilbert at linaro.org> wrote:
>>> On 4 August 2011 14:52, James Tunnicliffe <james.tunnicliffe at linaro.org> wrote:
>>>> I have seen poor performance when DDing to a card, which I assume is
>>>> because dd is not writing large aligned chunks. If we can dd the first
>>>> meg or so of data onto the card, then write in 4MB chunks that are all
>>>> 4MB aligned that should be quick (at least, if my reading of my
>>>> flashbench results is correct).
>>> What options to dd are you using? dd if=file of=/dev/thewholedevice bs=4096k
>>> should write 4MB chunks out
>> My understanding is they are 4MB chunks, but not aligned to 4MB boundaries.
> What exactly is your dd line?
I haven't used dd in a while for this, so I don't have a dd line as
such. I did just try the line you gave and it ran at the highest speed
that flashbench showed that my SD card could provide, so thanks for
that! Not sure what I did differently last time... no matter, this
will speed up testing a lot.
I am slightly concerned having searched around about using ext* on
flash - it sounds like ext2 and ext3 at least may be good at wearing
out SD cards. Using dd is good for avoiding the file attribute and
journal updates that would happen during the initial copy of the root
file system to an SD card, so if I am using ext3 it will be my
preferred way of getting a card ready. Unfortunately a lot of what I
have read should have  attached to it.
One post that at least seemed logical was:
"In the Fedora linux list, we had a long thread about ext3 on Sd
cards. Consensus was that it is bad to do this because it will use up
the finite number of writes on the card. They recommend VFAT because
it does not make as many separate writes when files are accessed. ext2
is expensive because it tracks so many attributes,especially atime..
ext3 is more costly because of journaling."
I have done a bit of benchmarking, which involves copying the files
that are in the root file system of a Nano image plus a few larger
files over to the same SD card formatted with different file systems:
ext4 no journal: 1m17.868s
My guess is that not only does a fast copy keep me happy, it also
keeps my SD card happy (faster probably indicates fewer read, modify,
write cycles = lasts longer). It looks like we should change our
default file system to ext4 so we default to a file system that we can
all be confident in and those of us who want to can use btrfs.
Disabling the journal may help with SD card longevity, but it doesn't
seem to make much difference to speed in this case.
I just tested two a nano images using ext4 and they didn't find the
root file system. So, we are at least gated on that bug.
More information about the linaro-dev