From owner-freebsd-current Mon Dec 6 11:13: 2 1999 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id CC97715568; Mon, 6 Dec 1999 11:12:39 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id KAA70858; Mon, 6 Dec 1999 10:00:51 -0800 (PST) (envelope-from dillon) Date: Mon, 6 Dec 1999 10:00:51 -0800 (PST) From: Matthew Dillon Message-Id: <199912061800.KAA70858@apollo.backplane.com> To: Matthew Jacob Cc: "David O'Brien" , Bruce Evans , current@FreeBSD.ORG Subject: Re: oh, btw... References: Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :> How do we fix this problem? I keeps from from :> ``dd if=/dev/da1 of=/dev/da2'' ?? I was very peeved at having to put the :> disks on a Solaris box to do such a normal Unix task. : : :this will fix your dd : :Index: dd.c :=================================================================== :RCS file: /home/ncvs/src/bin/dd/dd.c,v :retrieving revision 1.27 :diff -u -r1.27 dd.c :--- dd.c 1999/10/03 18:49:51 1.27 :+++ dd.c 1999/12/05 23:17:16 :@@ -216,6 +216,16 @@ : if (ioctl(io->fd, FIODTYPE, &type) == -1) { : err(1, "%s", io->name); : } else { :+if (type & D_DISK) { :+static int one = 1; :+#ifndef DIOCWLABEL :+#define DIOCWLABEL _IOW('d', 109, int) :+#endif :+fprintf(stderr, "is a disk\n"); :+if (ioctl(io->fd, DIOCWLABEL, &one) < 0) { :+perror("DIOCWLABEL"); :+} :+} : if (type & D_TAPE) : io->flags |= ISTAPE; : else if (type & (D_DISK | D_MEM)) : Woa, timeout! dd if=/dev/da1 of=/dev/da2 had better work - the label area should not be in any way write protected when you use the non-partition device. If you were to use /dev/da2c, *then* it would be reasonable to write-protect the label area. But if you use /dev/da2 it is not. We should not go around hacking dd when the problem is in the kernel. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message