From owner-freebsd-bugs@FreeBSD.ORG Thu Dec 27 17:30:05 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5590E16A468 for ; Thu, 27 Dec 2007 17:30:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2406C13C45D for ; Thu, 27 Dec 2007 17:30:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBRHU4NX016410 for ; Thu, 27 Dec 2007 17:30:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBRHU4xd016407; Thu, 27 Dec 2007 17:30:04 GMT (envelope-from gnats) Resent-Date: Thu, 27 Dec 2007 17:30:04 GMT Resent-Message-Id: <200712271730.lBRHU4xd016407@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Sean Bruno Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D94C16A419 for ; Thu, 27 Dec 2007 17:27:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 4334C13C442 for ; Thu, 27 Dec 2007 17:27:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id lBRHR06p071714 for ; Thu, 27 Dec 2007 17:27:00 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id lBRHR0hA071713; Thu, 27 Dec 2007 17:27:00 GMT (envelope-from nobody) Message-Id: <200712271727.lBRHR0hA071713@www.freebsd.org> Date: Thu, 27 Dec 2007 17:27:00 GMT From: Sean Bruno To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/119068: dd yields a bogus error when input file is to small for output device X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2007 17:30:05 -0000 >Number: 119068 >Category: misc >Synopsis: dd yields a bogus error when input file is to small for output device >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Dec 27 17:30:04 UTC 2007 >Closed-Date: >Last-Modified: >Originator: Sean Bruno >Release: RELENG_6 >Organization: Miralink Inc >Environment: FreeBSD desdemona.office.miralink.com 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386 >Description: When using dd with an input file smaller than the block size of an output device, the error generated doesn't give the end user any clue as to why the dd failed. For example, create a text file with a size of 256 bytes and attempt to dd that file to a drive which has 512 byte blocks: desdemona # ls -la test.txt -rw-r--r-- 1 root wheel 256 Dec 28 01:47 test.txt dd if=test.txt of=/dev/ad5 dd: /dev/ad5: Invalid argument The error should give some kind of indication that the input file is too small to use with the ouput device. eg: dd: /dev/ad5: Input file is smaller than block size of ouput. >How-To-Repeat: Create a text file that is smaller than 1 512 byte block, eg use "jot -c 128 0 > testfile" Attempt to dd that testfile to a SATA or IDE drive which has 512 byte blocks: dd if=testfile of=/dev/adX >Fix: Use a file that is large than the block size of the drive. >Release-Note: >Audit-Trail: >Unformatted: