From: Andreas Dilger <adilger@sun.com>
To: Xiang Wang <xiangw@google.com>
Cc: linux-ext4@vger.kernel.org, ext4-team <ext4-team@google.com>
Subject: Re: Options for migrating existing files on ext2 partitions to ext4
Date: Thu, 12 Feb 2009 02:23:34 -0500 [thread overview]
Message-ID: <20090212072334.GB3199@webber.adilger.int> (raw)
In-Reply-To: <d5ca277e0902111218l1b568724l2557315d2945637a@mail.gmail.com>
On Feb 11, 2009 12:18 -0800, Xiang Wang wrote:
> Since we are thinking of switching into using the ext4 file systems on
> some of our machines with purely ext2 partitions, we face the problem
> of how to migrate all those existing files on ext2 partitions. Seems
> like there are two major directions to go:
>
> 1) do a backup, umount, mke2fs into ext4, and restore
> In this approach, we may actually take advantage of the layout changes
> so as to benefit from some features of ext4.
>
> 2) umount, tune2fs to add the 'extent' feature, mount back using type
> ext4,
Note that you can really stop at this point - new files will be created
with extents, old ones will be left alone.
> migrate the existing files(directories) one by one through the
> ioctl EXT4_IOC_MIGRATE
Note that you don't really need to do this. If the filesystem is
offline to users you can just do "cp file file.tmp; mv file.tmp file"
and it will do the same thing, with exception of getting a new inode
number and requiring that files are not being modified at the time.
> Motivated by the ext4 ioctl interface for migration, we are also
> looking into this in-place approach. But we are mostly concerned with
> the fact that if the existing files are highly fragmented, will we
> still get benefit from the extents? Or will we even get hurt by
> turning the files into being extents-based?
The mballoc allocator is pretty good in conjunction with delalloc, so
I expect you would get mostly defragmented files as you migrate. This
would depend on having some decent amount of free space in the filesystem
so that it is likely that there is enough contiguous free space for some
number of the >= average size files.
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
next prev parent reply other threads:[~2009-02-12 7:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-11 20:18 Options for migrating existing files on ext2 partitions to ext4 Xiang Wang
2009-02-12 7:23 ` Andreas Dilger [this message]
2009-02-12 7:57 ` Aneesh Kumar K.V
2009-02-12 8:01 ` Michael Rubin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090212072334.GB3199@webber.adilger.int \
--to=adilger@sun.com \
--cc=ext4-team@google.com \
--cc=linux-ext4@vger.kernel.org \
--cc=xiangw@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox