From owner-freebsd-questions@FreeBSD.ORG Thu Nov 11 20:16:34 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7A13106564A for ; Thu, 11 Nov 2010 20:16:34 +0000 (UTC) (envelope-from amvandemore@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6B4788FC17 for ; Thu, 11 Nov 2010 20:16:34 +0000 (UTC) Received: by fxm19 with SMTP id 19so1682713fxm.13 for ; Thu, 11 Nov 2010 12:16:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=0iGdJYDe0ZderFDqsXCo0Nfi4BqiFG3a9hcZ0EvTW1Q=; b=rZ8shPTDlWhuUtKUT1dRQYpsQULacKPG5w+a6KFkQXCoV/vtPDqJ4jdI74D8pjRNf5 gsY3BPMkXheMCX47ZZ6yGfNybG1EDsTX46L2v3FVQwfSov2xlpje4/XhzzYn+Dj2kCOK 6aLA7Q8UzYIk8rzPNb/1TN1is0pciwONkxzS8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=eCZSTHDva/ZuBZ7t9ap++tfcNLDDVc5HqxQf+/Y9kfyrXfWnaFAMB4/D5A/s/8GNQm 3iGolF0fVsJBkEiFOweOdXGa9lb0BwcWtaksqSoXR5LkYFh1eiAIT5E1ya3q17PfwO3N DQVSUhLxJH1gw+i3OoQvxeiW21GQoyYe2vWW0= MIME-Version: 1.0 Received: by 10.223.127.16 with SMTP id e16mr604222fas.101.1289506593356; Thu, 11 Nov 2010 12:16:33 -0800 (PST) Received: by 10.223.121.138 with HTTP; Thu, 11 Nov 2010 12:16:33 -0800 (PST) In-Reply-To: <20101111200252.GA1350@tiny.Sisis.de> References: <20101111200252.GA1350@tiny.Sisis.de> Date: Thu, 11 Nov 2010 14:16:33 -0600 Message-ID: From: Adam Vande More To: Matthias Apitz Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: how to overwrite the content of a file X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 20:16:34 -0000 On Thu, Nov 11, 2010 at 2:02 PM, Matthias Apitz wrote: > What is the best method to overwrite the blocks of a given file with > bytes of 0x00, i.e. not to O_TRUNC away the blocks to the freelist of the > file system, but overwrite the old blocks? > > I've checked > > $ dd if=/dev/zero of=file count=4 > > but dd(1) opens the file with O_RDWR|O_CREAT|O_TRUNC which for sure will > give away the old blocks and adquire new blocks. Any idea? > Well there is "rm -P" although I'm not sure that accomplished exactly what you are looking for. -- Adam Vande More