Subject: Re: add /dev/one ?
To: None <netbsd-users@netbsd.org>
From: Steven M. Bellovin <smb@research.att.com>
List: netbsd-users
Date: 05/08/2002 09:56:10
In message <873cx2ahdh.fsf@panther.aladdin.de>, Christian Groessler writes:
>On 05/08/2002 09:10:28 AM EST Todd Gruhns Acct wrote:
>>
>>OK, so why have we NOT GOT a /dev/one so we can do the same thing?
>
>You don't need a /dev/one. Try
>
>cat /dev/zero | tr \\0 \\377 | dd bs=1000k > /dev/sdXa
>

You don't even need cat:

	tr '\0' '\377' </dev/zero | dd ...

There's a moral here:  the kernel is for primitive operations that are 
very much harder or very much less efficient to do any other way.
This is an infrequent operation; the "overhead" of tr will be 
negligible compared to the disk I/O.


		--Steve Bellovin, http://www.research.att.com/~smb
		Full text of "Firewalls" book now at http://www.wilyhacker.com