Add e4migrate
PATCH 1/1 Add e4migrate
This patch adds new command e4migrate. This can be used to convert ext3 file system to ext4 file system. Once we have the e4defrag we may want to merge the migrate with defrag. This will enables us to do a defrag immediately after migrate resulting in better disk layout. This will also enables us to defrag ext3 inodes
--- misc/Makefile.in | 17 ++++++++++++-- misc/e4migrate.8.in | 28 +++++++++++++++++++++++++ misc/e4migrate.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 3 deletions(-)
misc/Makefile.in +14 -3
@@ -18,11 +18,12 @@ INSTALL = @INSTALL@ @UUIDD_CMT@UUIDD_MAN= uuidd.8 SPROGS= mke2fs badblocks tune2fs dumpe2fs blkid logsave \ - $(E2IMAGE_PROG) @FSCK_PROG@ e2undo + $(E2IMAGE_PROG) @FSCK_PROG@ e2undo e4migrate USPROGS= mklost+found filefrag $(UUIDD_PROG) SMANPAGES= tune2fs.8 mklost+found.8 mke2fs.8 dumpe2fs.8 badblocks.8 \ e2label.8 findfs.8 blkid.8 $(E2IMAGE_MAN) \ - logsave.8 filefrag.8 e2undo.8 $(UUIDD_MAN) @FSCK_MAN@ + logsave.8 filefrag.8 e2undo.8 e4migrate.8 \ + $(UUIDD_MAN) @FSCK_MAN@ FMANPAGES= mke2fs.conf.5 UPROGS= chattr lsattr uuidgen
@@ -44,6 +45,7 @@ FSCK_OBJS= fsck.o base_device.o ismounted.o BLKID_OBJS= blkid.o FILEFRAG_OBJS= filefrag.o E2UNDO_OBJS= e2undo.o +E4MIGRATE_OBJS = e4migrate.o XTRA_CFLAGS= -I$(srcdir)/../e2fsck -I.
@@ -53,7 +55,7 @@ SRCS= $(srcdir)/tune2fs.c $(srcdir)/mklost+found.c $(srcdir)/mke2fs.c \ $(srcdir)/uuidgen.c $(srcdir)/blkid.c $(srcdir)/logsave.c \ $(srcdir)/filefrag.c $(srcdir)/base_device.c \ $(srcdir)/ismounted.c $(srcdir)/../e2fsck/profile.c \ - $(srcdir)/e2undo.c + $(srcdir)/e2undo.c $(srcdir)/e4migrate.c LIBS= $(LIBEXT2FS) $(LIBCOM_ERR) DEPLIBS= $(LIBEXT2FS) $(LIBCOM_ERR)
@@ -124,6 +126,10 @@ e2undo: $(E2UNDO_OBJS) $(DEPLIBS) @echo " LD $@" @$(CC) $(ALL_LDFLAGS) -o e2undo $(E2UNDO_OBJS) $(LIBS) $(LIBINTL) +e4migrate: $(E4MIGRATE_OBJS) + @echo " LD $@" + @$(CC) $(ALL_LDFLAGS) -o e4migrate $(E4MIGRATE_OBJS) $(LIBINTL) + base_device: base_device.c @echo " LD $@" @$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(srcdir)/base_device.c \
@@ -213,6 +219,10 @@ e2undo.8: $(DEP_SUBSTITUTE) $(srcdir)/e2undo.8.in @echo " SUBST $@" @$(SUBSTITUTE_UPTIME) $(srcdir)/e2undo.8.in e2undo.8 +e4migrate.8: $(DEP_SUBSTITUTE) $(srcdir)/e4migrate.8.in + @echo " SUBST $@" + @$(SUBSTITUTE_UPTIME) $(srcdir)/e4migrate.8.in e4migrate.8 + findfs.8: $(DEP_SUBSTITUTE) $(srcdir)/findfs.8.in @echo " SUBST $@" @$(SUBSTITUTE_UPTIME) $(srcdir)/findfs.8.in findfs.8
@@ -505,3 +515,4 @@ ismounted.o: $(srcdir)/ismounted.c $(top_srcdir)/lib/et/com_err.h profile.o: $(srcdir)/../e2fsck/profile.c $(top_srcdir)/lib/et/com_err.h \ $(srcdir)/../e2fsck/profile.h prof_err.h e2undo.o: $(srcdir)/e2undo.c $(top_srcdir)/lib/ext2fs/tdb.h +e4migrate.o: $(srcdir)/e4migrate.c
misc/e4migrate.8.in new file +28 -0
@@ -0,0 +1,28 @@ +.\" -*- nroff -*- +.\" Copyright 2008 by Aneesh Kumar K.V. All Rights Reserved. +.\" This file may be copied under the terms of the GNU Public License. +.\" +.TH E4MIGRATE 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" +.SH NAME +e4migrate \- Migrate an ext3 inode to ext4 inode format +.SH SYNOPSIS +.B e4migrate +.I filename +.SH DESCRIPTION +.B e4migrate +will migrate +.I filename +in ext3 inode format to ext4 inode format +This can be +used to migrate an ext3 file system to ext4 file system +.SH AUTHOR +.B e4migrate +was written by Aneesh Kumar K.V. ([email protected]) +.SH AVAILABILITY +.B e2undo +is part of the e2fsprogs package and is available from +http://e2fsprogs.sourceforge.net. +.SH SEE ALSO +.BR mke2fs (8), +.BR tune2fs (8) +
misc/e4migrate.c new file +57 -0
57 lines not on this page · raw message
Signature · 1 line
tg: (b55d739..) an/e4migrate (depends on: master)
Review
Quoted 3 lines · Aneesh Kumar
(quoted diff) +3
-0+e4migrate \- Migrate an ext3 inode to ext4 inode format +.B e4migrate will migrate filename in ext3 inode format to ext4 inode format +This can be used to migrate an ext3 file system to ext4 file system
Can you please explain a bit more about what is done here? Is it changing block mapped inodes to extent mapped? Resising the inodes/GDT? Changing other things like growing large inode space for ns timestamps/version?
We have an option to e2fsck (like -D for rehash directory, but instead "-E expand_extra_isize") to resize the "extra_isize" of an existing inode to ensure that enough space is in the filesystem for i_version_hi, if it isn't already. This is in our patch "e2fsprogs-expand-extra-isize.patch" in the Lustre patchset.
I think it makes more sense to have options for existing tools, rather than having 10 new different tools, but maybe Ted has other opinions.
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.