Bug 131086 - [ext2fs] [patch] mkfs.ext2 creates rotten partition
Summary: [ext2fs] [patch] mkfs.ext2 creates rotten partition
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-28 18:50 UTC by Elmar Stellnberger
Modified: 2009-10-30 19:59 UTC (History)
0 users

See Also:


Attachments
mkfslog.txt (954 bytes, text/plain)
2009-04-07 20:12 UTC, aditya sarawgi
no flags Details
dump.txt (9.24 KB, text/plain; charset=US-ASCII)
2009-04-07 20:12 UTC, aditya sarawgi
no flags Details
ext2fs.diff.txt (2.09 KB, text/plain; charset=US-ASCII)
2009-04-07 20:12 UTC, aditya sarawgi
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elmar Stellnberger 2009-01-28 18:50:01 UTC
Fresh created ext2 partition can not be accessed correctly.
Most likely a bug of e2fsprogs-1.41.0 since the ext2fs driver can access
other ext2 partitions without any problem.

How-To-Repeat: > mkfs.ext2 /dev/ad6s6
mke2fs 1.41.0 (10-Jul-2008)
Filesystem label=
OS type: FreeBSD
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2444624 inodes, 9765504 blocks
488275 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
299 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

root:/> mount -t ext2fs /dev/ad6s6 /mnt/tmp/
root:/> cp -a /home/elm/.thunderbird /mnt/tmp/
cp: /mnt/tmp: Bad file descriptor
root:/> ls /mnt/tmp
ls: /mnt/tmp: Bad file descriptor
root:/> mount
..
/dev/ad6s6 on /mnt/tmp (ext2fs, local)
root:/> cd /mnt/tmp
bash: cd: /mnt/tmp: Not a directory
root:/> umount /mnt/tmp
root:/> fsck.ext2 /dev/ad6s6
e2fsck 1.41.0 (10-Jul-2008)
/dev/ad6s6: clean, 11/2444624 files, 165693/9765504 blocks
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-01-29 07:41:44 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 aditya sarawgi 2009-04-07 20:12:07 UTC
I have reproduced this bug and there is no problem with mkfs.ext2.
mkfs.ext2 has been updated to create partitions having default inode
size of 256 bytes which is not supported by ext2fs 7.1-RELEASE (it
supports only 128 bytes). This problem is similar to kern/124621,
       kern/125536 and kern/128173.

I'm attaching my mkfs.ext2 logs, dump of the file system and a patch
that has been committed to  8.0-CURRENT to fix this problem.

-- 
Cheers,
Aditya Sarawgi
Comment 3 aditya sarawgi 2009-04-07 20:33:16 UTC
Sorry for all the mess. gmail is screwing up the attachments.


Filesystem label=
OS type: FreeBSD
Block size=4096 (log=2)
Fragment size=4096 (log=2)
245280 inodes, 979960 blocks
48998 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1006632960
30 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          c1658ff3-288c-469f-ba6d-dcd29e70e5d1
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      ext_attr resize_inode dir_index filetype
sparse_super large_file
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       FreeBSD
Inode count:              245280
Block count:              979960
Reserved block count:     48998
Free blocks:              962636
Free inodes:              245269
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      239
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8176
Inode blocks per group:   511
Filesystem created:       Tue Apr  7 23:14:02 2009
Last mount time:          n/a
Last write time:          Tue Apr  7 23:14:52 2009
Mount count:              0
Maximum mount count:      22
Last checked:             Tue Apr  7 23:14:02 2009
Check interval:           15552000 (6 months)
Next check after:         Sun Oct  4 23:14:02 2009
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group wheel)
First inode:              11
Inode size:	          256
Required extra isize:     28
Desired extra isize:      28
Default directory hash:   half_md4
Directory Hash Seed:      1dfec28a-c0a2-472f-821d-55445e0b8130

and here's the patch http://pflog.net/~floyd/ext2fs.diff
-- 
Cheers,
Aditya Sarawgi
Comment 4 Jaakko Heinonen freebsd_committer freebsd_triage 2009-10-30 19:55:35 UTC
State Changed
From-To: open->closed

Duplicate of ports/131556. The change has been committed to sysutils/e2fsprogs port.