From owner-freebsd-questions@FreeBSD.ORG Tue Feb 17 03:23:20 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 31BEC16A4CE; Tue, 17 Feb 2004 03:23:20 -0800 (PST) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06C2543D1D; Tue, 17 Feb 2004 03:23:20 -0800 (PST) (envelope-from tim@robbins.dropbear.id.au) Received: from robbins.dropbear.id.au (203.134.134.40) by smtp01.syd.iprimus.net.au (7.0.024) id 402BA92700187ABC; Tue, 17 Feb 2004 22:23:18 +1100 Received: by robbins.dropbear.id.au (Postfix, from userid 1000) id E9E8D41C4; Tue, 17 Feb 2004 22:22:51 +1100 (EST) Date: Tue, 17 Feb 2004 22:22:51 +1100 From: Tim Robbins To: Kris Kennaway Message-ID: <20040217112251.GA25431@cat.robbins.dropbear.id.au> References: <20040217103909.N73217@yabba.500mhz.net> <20040217100822.GA13286@xor.obsecurity.org> <20040217110937.Y73217@yabba.500mhz.net> <20040217102121.GA13632@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040217102121.GA13632@xor.obsecurity.org> User-Agent: Mutt/1.4.1i cc: Stefan Krantz cc: freebsd-questions@FreeBSD.org cc: bde@FreeBSD.org Subject: Re: Anyway to extract a large file from EXT2FS filesystem? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 11:23:20 -0000 On Tue, Feb 17, 2004 at 02:21:21AM -0800, Kris Kennaway wrote: > 5BOn Tue, Feb 17, 2004 at 11:16:50AM +0100, Stefan Krantz wrote: > > > > On Tue, 17 Feb 2004, Kris Kennaway wrote: > > > > > On Tue, Feb 17, 2004 at 10:49:47AM +0100, Stefan Krantz wrote: > > > > > > > > Hi! > > > > > > > > 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? > > > > > > It shouldn't be appearing truncated. Are you certain that this size > > > is incorrect, and the file has a different size when viewed from > > > another OS? > > > > Yes. Yesterday I tested the archive with "tar tvf" (11gb) in > > Linux and it tested OK. In FBSD it says "unexpected EOF". > > > > If I could i would just boot linux and split the file. But I can nolonger > > boot linux =/ (migrated to fbsd 5.2 ;). > > I'm CC'ing tjr and bde, who might have some idea about the problem. 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;