From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Bartell Subject: Re: Restoring BTRFS partition Date: Tue, 20 Apr 2010 20:32:15 -0400 Message-ID: <20100421003045.GA10361@flcl.lan> References: <20100420155538.GB3634@laptop.oracle.com> <20100420165049.GA6352@flcl.lan> <20100420203017.GA4532@lelouch.nomadic.ncsu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Wengang Wang , linux-btrfs@vger.kernel.org To: Alli Quaknaa Return-path: In-Reply-To: List-ID: On Tue, Apr 20, 2010 at 10:25:34PM +0000, Alli Quaknaa wrote: > I think I have found the real superblock you are talking about, but > I'm afraid I may have written something in the first 64MiB. Is there a > chance btrfsck will recover it? btrfsck is currently very limited; it only detects a limited number of problems, and it can't fix anything. Btrfs focuses on handling problems when they are discovered while using the FS; generally, it should handle corruption relatively gracefully. However, if anything really crucial was overwritten and the FS can't be mounted, there aren't any tools to repair it. > Also, I think there's gotta be a better way to manipulate those huge > files then dd and hexedit for examination - I'd like to take the raw > file, open it in some hex editor and be able to cut of some of it's > beginning - I can't seem to be able to do it with hexedit. Is there a > tool you'd recomment? For viewing, you can use less, head, and tail with hexdump: tail -c +$((0x10000+1)) /dev/sda1|hexdump -C|less will view the disk starting at the superblock. For editing, dd is probably best, though you could use a hex editor like Okteta. I've also heard of Radare, supposedly a very advanced command-line tool. Keep in mind that any tool that deletes the first part of a huge file will be forced to rewrite the entire file.