Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Feb 2004 13:12:47 +1100
From:      Tim Robbins <tjr@freebsd.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Kris Kennaway <kris@obsecurity.org>
Subject:   Re: Anyway to extract a large file from EXT2FS filesystem?
Message-ID:  <20040218021247.GA28724@cat.robbins.dropbear.id.au>
In-Reply-To: <20040218112014.V19484@gamplex.bde.org>
References:  <20040217103909.N73217@yabba.500mhz.net> <20040217100822.GA13286@xor.obsecurity.org> <20040217110937.Y73217@yabba.500mhz.net> <20040217102121.GA13632@xor.obsecurity.org> <20040217112251.GA25431@cat.robbins.dropbear.id.au> <20040218112014.V19484@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 18, 2004 at 11:37:26AM +1100, Bruce Evans wrote:

> On Tue, 17 Feb 2004, Tim Robbins wrote:
> 
> > > 5BOn Tue, Feb 17, 2004 at 11:16:50AM +0100, Stefan Krantz wrote:
> > > > > > I would like to extract a large (11GB) tar file on an ext3 filesystem. But
> > > > > > it shows only to be about 3gb large:
> > > > > >
> > > > > > yabba# ls -la pictures.tar
> > > > > > -rw-r--r--  1 root  wheel  3317055488 Feb 15 19:03 pictures.tar
> > > > > >
> > > > > > Is there any possible way to extract the file?
> 
> > Try this patch and let me know how it goes. You'll have to specify
> > the file name of /sys/gnu/ext2fs/ext2_inode_cnv.c to patch(1) manually,
> > then either buildkernel or rebuild only ext2fs.ko. If the file shows
> > up with the correct size in a directory listing, make sure you can actually
> > read data past 4 GB.
> >
> > ==== //depot/user/tjr/freebsd-tjr/src/sys/gnu/ext2fs/ext2_inode_cnv.c#1 - /p4/tjr/src/sys/gnu/ext2fs/ext2_inode_cnv.c ====
> > @@ -77,6 +77,8 @@
> >  	*/
> >  	ip->i_mode = ei->i_links_count ? ei->i_mode : 0;
> >  	ip->i_size = ei->i_size;
> > +	if (S_ISREG(ip->i_mode))
> > +		ip->i_size |= ((u_int64_t)ei->i_size_high) << 32;
> >  	ip->i_atime = ei->i_atime;
> >  	ip->i_mtime = ei->i_mtime;
> >  	ip->i_ctime = ei->i_ctime;
> > @@ -112,6 +114,8 @@
> >  	 */
> >  	ei->i_dtime = ei->i_links_count ? 0 : ip->i_mtime;
> >  	ei->i_size = ip->i_size;
> > +	if (S_ISREG(ip->i_mode))
> > +		ei->i_size_high = ip->i_size >> 32;
> >  	ei->i_atime = ip->i_atime;
> >  	ei->i_mtime = ip->i_mtime;
> >  	ei->i_ctime = ip->i_ctime;
> >
> 
> The feature stuff needs to be handled for writing.

I discovered that a few minutes after posting the patch :-) I decided to
take the lazy way out for now and to return EFBIG if we would need to
upgrade the filesystem to EXT2_DYNAMIC_REV or set ..._RO_COMPAT_LARGE_FILE.
I think what's most important here is being able to read large files
from Linux ext2 filesystems, and I don't like the current ext2 code
enough to implement superblock updating etc.


Tim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040218021247.GA28724>