Problem restoring ext3 with ext_attr? (CentOS 5) *SOLVED*

Post here if you found a bug or something really not expected in the program
Post Reply
Berix
Posts: 14
Joined: Thu Nov 15, 2012 6:44 pm

Problem restoring ext3 with ext_attr? (CentOS 5) *SOLVED*

Post by Berix » Thu Nov 15, 2012 7:05 pm

So, I'm attempting to restore a logical volume that I backed up (on the same machine) and am getting an unexpected error when attempting to restore it to another logical volume.

Code: Select all

# fsarchiver restfs rootvg-root_lv.fsa id=0,dest=/dev/rootvg/restore_lv
fs_ext2.c#279,extfs_mkfs(): command [mke2fs /dev/rootvg/restore_lv  -q  -r 1  -b 4096  -I 128  -O has_journal,ext_attr,resize_inode,dir_index,filetype,^journal_dev,^meta_bg,sparse_super ] failed with return status=1
oper_restore.c#1272,extractar_filesystem_extract(): cannot format the filesystem ext3 on partition /dev/rootvg/restore_lv
Here's what happens when I ask for a little more information using -vvv:

Code: Select all

# fsarchiver -vvv restfs rootvg-root_lv.fsa id=0,dest=/dev/rootvg/restore_lv
Detected fileformat=2 in archive /media/unraid/backup/lt/rootvg-root_lv.fsa
Current fsarchiver version: 0.6.15.0
Minimum fsarchiver version for that archive: 0.6.4.0
============= extracting filesystem 0 =============
Current fsarchiver version: 0.6.15.0
Minimum fsarchiver version for that filesystem: 0.6.4.0
filesystem=[ext3]
fsbytestotal=[9.67 GB]
fsbytesused=[967.77 MB]
getpathtoprog(mke2fs)=[/sbin/mke2fs]
executing [mke2fs -V]...
command [mke2fs -V] returned 0
getpathtoprog(mke2fs)=[/sbin/mke2fs]
executing [mke2fs -V]...
command [mke2fs -V] returned 0
the filesystem type determined by the original filesystem features is [ext3]
the filesystem type to create considering the command options is [ext3]
--> feature [has_journal]=YES
--> feature [ext_attr]=YES
--> feature [resize_inode]=YES
--> feature [dir_index]=YES
--> feature [filetype]=YES
--> feature [journal_dev]=NO
--> feature [meta_bg]=NO
--> feature [sparse_super]=YES
features: mkfs_options+=[-O has_journal,ext_attr,resize_inode,dir_index,filetype,^journal_dev,^meta_bg,sparse_super]
mke2fs version detected: 1.39.0
mke2fs version required: 1.39.0
exec: mke2fs -V
getpathtoprog(mke2fs)=[/sbin/mke2fs]
executing [mke2fs /dev/rootvg/restore_lv  -q  -r 1  -b 4096  -I 128  -O has_journal,ext_attr,resize_inode,dir_index,filetype,^journal_dev,^meta_bg,sparse_super ]...
command [mke2fs /dev/rootvg/restore_lv  -q  -r 1  -b 4096  -I 128  -O has_journal,ext_attr,resize_inode,dir_index,filetype,^journal_dev,^meta_bg,sparse_super ] returned 1
fs_ext2.c#279,extfs_mkfs(): command [mke2fs /dev/rootvg/restore_lv  -q  -r 1  -b 4096  -I 128  -O has_journal,ext_attr,resize_inode,dir_index,filetype,^journal_dev,^meta_bg,sparse_super ] failed with return status=1
oper_restore.c#1272,extractar_filesystem_extract(): cannot format the filesystem ext3 on partition /dev/rootvg/restore_lv
oper_restore.c#1516,oper_restore(): extract_filesystem(0) failed
It seems to be having an issue with the ext_attr filesystem feature, because when I attempt to execute the command manually, while omitting this feature, it builds the filesystem fine:

Code: Select all

# mke2fs /dev/rootvg/restore_lv  -q  -r 1  -b 4096  -I 128  -O has_journal,ext_attr,resize_inode,dir_index,filetype,^journal_dev,^meta_bg,sparse_super
Invalid filesystem option set: has_journal,ext_attr,resize_inode,dir_index,filetype,^journal_dev,^meta_bg,sparse_super

Code: Select all

# mke2fs /dev/rootvg/restore_lv  -q  -r 1  -b 4096  -I 128  -O has_journal,resize_inode,dir_index,filetype,^journal_dev,^meta_bg,sparse_super
#
Does anyone have any idea what might be the issue? It seems like maybe the e2fsprogs on my system might not understand this feature? Even though the existing filesystems have this feature enabled... Very confusing. I can restore from SystemRescueCD without any issues. It's only when I try to do a restore in the same OS that I get the problem.
Last edited by Berix on Fri Nov 16, 2012 3:19 pm, edited 1 time in total.

Berix
Posts: 14
Joined: Thu Nov 15, 2012 6:44 pm

Re: Problem restoring ext3 partition with ext_attr? (CentOS

Post by Berix » Fri Nov 16, 2012 2:01 am

Well, I did a bit more testing and playing around, and it seems like maybe this is a problem with the e2fsprogs package in CentOS 5.

The version is e2fsprogs-1.39-34.el5_8.1.

I downloaded the most recent source (e2fsprogs-1.42.5) and compiled it. Then I executed the mke2fs command from above (with the ext_attr feature) and it formatted correctly.

Kind of unfortunate since the 1.39-34 is the latest version available via RPMs for CentOS 5 and that's what we have on all of our customers' systems.

I suppose I could try to remove that feature from the source filesystem before I do the backup, but those efforts have so far been futile...

Berix
Posts: 14
Joined: Thu Nov 15, 2012 6:44 pm

Re: Problem restoring ext3 partition with ext_attr? (CentOS

Post by Berix » Fri Nov 16, 2012 3:18 pm

** RESOLVED **

Well here's the deal. It seems to be an issue with the version of e2fsprogs on my system. At version 1.40.5, they added ext_attr to the list of features that can be specified when creating a filesystem. At earlier versions, it will reject this feature as unrecognized on the command line, but would still turn the option on by default anyway. When I leave the option out on my mke2fs command, it still gets added to the new filesystem.

Knowing this, I made a change to the fsarchiver source file src/fs_ext2.c on line 57 to change the version that is required for the ext_attr feature to 1.40.5. Here is the patch file if anyone is interested. I'm not too sure if this should be merged into the standard FSArchiver source, but here it is:

Code: Select all

diff -urN fsarchiver-0.6.15/src/fs_ext2.c fsarchiver-0.6.15-new/src/fs_ext2.c
--- fsarchiver-0.6.15/src/fs_ext2.c     2012-06-02 08:52:56.000000000 -0500
+++ fsarchiver-0.6.15-new/src/fs_ext2.c 2012-11-16 07:50:23.000000000 -0600
@@ -54,7 +54,7 @@
 struct s_features mkfeatures[] = // cf e2fsprogs-1.42.3/lib/e2p/feature.c
 {
     {"has_journal",  FSA_EXT3_FEATURE_COMPAT_HAS_JOURNAL,     E2P_FEATURE_COMPAT,      EXTFSTYPE_EXT3, PROGVER(1,39,0)},
-    {"ext_attr",     FSA_EXT2_FEATURE_COMPAT_EXT_ATTR,        E2P_FEATURE_COMPAT,      EXTFSTYPE_EXT2, PROGVER(1,39,0)},
+    {"ext_attr",     FSA_EXT2_FEATURE_COMPAT_EXT_ATTR,        E2P_FEATURE_COMPAT,      EXTFSTYPE_EXT2, PROGVER(1,40,5)},
     {"resize_inode", FSA_EXT2_FEATURE_COMPAT_RESIZE_INODE,    E2P_FEATURE_COMPAT,      EXTFSTYPE_EXT2, PROGVER(1,39,0)},
     {"dir_index",    FSA_EXT2_FEATURE_COMPAT_DIR_INDEX,       E2P_FEATURE_COMPAT,      EXTFSTYPE_EXT2, PROGVER(1,33,0)},
     {"filetype",     FSA_EXT2_FEATURE_INCOMPAT_FILETYPE,      E2P_FEATURE_INCOMPAT,    EXTFSTYPE_EXT2, PROGVER(1,16,0)},

admin
Site Admin
Posts: 550
Joined: Sat Feb 21, 2004 12:12 pm

Re: Problem restoring ext3 with ext_attr? (CentOS 5) *SOLVED

Post by admin » Wed Feb 06, 2013 9:48 pm

I confirm the solution is correct as another RHEL5/CentOS5 has been affected.
The fix has been merged in git and will be part of fsarchiver-0.6.16 soon

Code: Select all

commit 1827dde32e23f668c8866ef691757992103f5494
Fixed mke2fs requirement for the "ext_attr" feature (affects RHLE5/CentOS5)

Post Reply