From owner-freebsd-questions@FreeBSD.ORG Sun Mar 3 22:59:34 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B3B0F647 for ; Sun, 3 Mar 2013 22:59:34 +0000 (UTC) (envelope-from andrewpack54@yahoo.com) Received: from nm36-vm6.bullet.mail.gq1.yahoo.com (nm36-vm6.bullet.mail.gq1.yahoo.com [98.136.216.221]) by mx1.freebsd.org (Postfix) with ESMTP id 60558D8A for ; Sun, 3 Mar 2013 22:59:34 +0000 (UTC) Received: from [98.137.12.59] by nm36.bullet.mail.gq1.yahoo.com with NNFMP; 03 Mar 2013 22:56:42 -0000 Received: from [98.137.12.241] by tm4.bullet.mail.gq1.yahoo.com with NNFMP; 03 Mar 2013 22:56:42 -0000 Received: from [127.0.0.1] by omp1049.mail.gq1.yahoo.com with NNFMP; 03 Mar 2013 22:56:42 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 814251.73199.bm@omp1049.mail.gq1.yahoo.com Received: (qmail 75845 invoked by uid 60001); 3 Mar 2013 22:56:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1362351402; bh=QJU8CJHuPYQPHPt5E1gJSuEgVY0ZjudtZ+ncPLx+/ik=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=OtviehR028ch27XVF3d+nhw6uped+XO2T9JJhTsC10QTxpdeLy7BTa5rEvUsMSjp63ednXby3LqhamY6lZCykU+Em6QoTCBkL5moZwPXb0IX3rPHDt1VMUpoYSGBmAYd6rppfgzcTK6T/0NsNYe8igwVEoaCYzcK6x1qFads58E= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=av6blJDye8504SCaAXtyW5uW+i6cLkbJRse9lOshjoR/ARrbsglJPExI1HZZxnoicoYd3PEF+rkZ4F4Okwof61Ed0BgUYBbZStLgtx1cwuHwG289p+4agkxwKW/bU3kLpVTc48dTtYydU9MAz11ISvxzVy22yFD5TSbECbKIWEg=; X-YMail-OSG: U7CzvuAVM1mGYRe2FPq9n6VgiTODvWhO6cwfWmeOrXY2PF_ DKS5M67g0sTSi.a2iGqjM6vHbUdorGP1j3yuNkLSMgFAq_29QmgDPH_b4PQs Q9ixjC7nQTFANmS2w7oYW9lb4YUFqwqw6L2CfJJvEtxOgUjl7W6k2IglB298 GnfnqY.EHMQZX33i2seawgKXHC_vopd_Q.C2i68tRNXSWfsCJK8PRNIHY88f CdQDgHLLYnLW.kMEWd1vdtwmfR23bqUH7iNa6CWWuw4O2EMGyfHdh59jahRX fsWAcCroLj3ePiLwm.kCItVJCyaryCBJ1QM5PSRiqxr6bQiOA.rIXuSVP4CP Etae1MO7XRo5k9Sz2KncZBuiL9skRObEqhOL7wFtXFsiYbINq2_SqwNjKE_S Lbl6r5izXR_QPSsxPWbmgzP6eN6PY3cNpx6j5jdXB_S0pmsd3YQIlpjm8AhI lLF7WsOkAFnHIlhZMUNVo5x7et5vx9pMCHVwuQik_ Received: from [174.21.140.152] by web164001.mail.gq1.yahoo.com via HTTP; Sun, 03 Mar 2013 14:56:42 PST X-Rocket-MIMEInfo: 001.001, RG9lcyBhbnlvbmUgaGF2ZSBhbnkgZXhwZXJpZW5jZSBydW5uaW5nIEZyZWVCU0Qgb24gdGhpcyBwbGF0Zm9ybT8gVW5sZXNzIEknbSBtaXN0YWtlbiwgSSBjb3VsZCd0IGZpbmQgaXQgbGlzdGVkIHVuZGVyIHRoZSBuZXcgcmVsZWFzZSBjb21wYXRpYmlsaXR5IGxpc3QuwqABMAEBAQE- X-Mailer: YahooMailWebService/0.8.135.514 Message-ID: <1362351402.61999.YahooMailNeo@web164001.mail.gq1.yahoo.com> Date: Sun, 3 Mar 2013 14:56:42 -0800 (PST) From: Andrew Pack Subject: VIA PV530 To: "freebsd-questions@freebsd.org" MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Andrew Pack List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 22:59:34 -0000 Does anyone have any experience running FreeBSD on this platform? Unless I'= m mistaken, I could't find it listed under the new release compatibility li= st.=A0 From owner-freebsd-questions@FreeBSD.ORG Mon Mar 4 00:36:06 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 29370233 for ; Mon, 4 Mar 2013 00:36:06 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id CB4F7E4 for ; Mon, 4 Mar 2013 00:36:05 +0000 (UTC) Received: from r56.edvax.de (port-92-195-109-47.dynamic.qsc.de [92.195.109.47]) by mx01.qsc.de (Postfix) with ESMTP id D7F233CDE4 for ; Mon, 4 Mar 2013 01:36:03 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id r240a8jP076942 for ; Mon, 4 Mar 2013 01:36:08 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Mon, 4 Mar 2013 01:36:08 +0100 From: Polytropon To: FreeBSD Questions Subject: Grepping though a disk Message-Id: <20130304013608.7981e8a9.freebsd@edvax.de> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 00:36:06 -0000 Due to a fsck file system repair I lost the content of a file I consider important, but it hasn't been backed up yet. The file name is still present, but no blocks are associated (file size is zero). I hope the data blocks (which are now probably marked "unused") are still intact, so I thought I'd search for them because I can remember specific text that should have been in that file. As I don't need any fancy stuff like a progress bar, I decided to write a simple command, and I quickly got something up and running which I _assume_ will do what I need. This is the command I've been running interactively in bash: $ N=0; while true; do echo "${N}"; dd if=/dev/ad6 of=/dev/stdout bs=10240 count=1 skip=${N} 2>/dev/null | grep ""; if [ $? -eq 0 ]; then break; fi; N=`expr ${N} + 1`; done To make it look a bit better and illustrate the simple logic behind my idea: N=0 while true; do echo "${N}" dd if=/dev/ad6 of=/dev/stdout bs=10240 count=1 skip=${N} \ 2>/dev/null | grep "" if [ $? -eq 0 ]; then break fi N=`expr ${N} + 1` done Here refers to the text. It's only a small, but very distinctive portion. I'm searching in blocks of 10 kB so it's easier to continue in case something has been found. I plan to output the resulting "block" (it's not a real disk block, I know, it's simply a unit of 10 kB disk space) and maybe the previous and next one (in case the file, the _real_ block containing the data, has been split across more than one of those units. I will then clean the "garbage" (maybe from other files) because I can easily determine the beginning and the end of the file. Needless to say, it's a _text_ file. I understand that grep operates on text files, but it will also happily return 0 if the text to search for will appear in a binary file, and possibly return the whole file as a search result (in case there are no newlines in it). My questions: 1. Is this the proper way of stupidly searching a disk? 2. Is the block size (bs= parameter to dd) good, or should I use a different value for better performance? 3. Is there a program known that already implements the functionality I need in terms of data recovery? Results so far: The disk in question is a 1 TB SATA disk. The command has been running for more than 12 hours now and returned one false-positive result, so basically it seems to work, but maybe I can do better? I can always continue search by adding 1 to ${N}, set it as start value, and re-run the command. Any suggestion is welcome! -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...