[TAG] 2c tip: filtering in-place

Thomas Adam thomas_adam16 at yahoo.com
Mon Mar 22 11:45:14 MSK 2004


 --- Kapil Hari Paranjape <kapil at imsc.res.in> wrote: 
> Hi,

Hello, Kapil.
 
> Just a few additional remarks:
> 
> (a) perl, python and vi/ex do offer alternate solutions ...  but see
> below.
> 
> (b) I couldn't locate "buffer"---where do I find it?

Oddly enough, under Debian it is in the 'buffer' package.

> (c) Just to defend the "dd" solution a bit:
> 
>   When the "dd" command-line given in the earlier mail is terminated
>   (for any reason like a Control-C), it outputs the number of blocks
             ^^^^^^^^^^^^^^^^^^^^^^^
That would be a cool idea to do!
 
>   read/written. Thus, the intrepid user can restart the process by
>   modifying it with suitable "seek" and "skip" commands. Of course, this

See the "-S", "-s", and "-z" to buffer(1) :)

>   assumes that the filter operates on data sizes less than 4k
>   independently.
> 
> I became aware of this "dd" procedure while trying to (yes I'm crazy)
> encrypt one entire disk partition in-place. The problem with the other
> solutions is that they require a lot of memory to run.

Yeah, but then one would use a proper filesystem that encrypted data for
you.

> As far reading and writing to pipes is concerned, here is how I
> understand it---please correct me if I am wrong. The kernel has its
> own *internal* settings on how much data is buffered before a writing
> process is put at the back of the queue and the reading process is woken
> up. Thus killing any one process in the "dd" pipeline could only result
> in *less* data being written than was read---an error from which one can
> recover as described above.

That supports what I have read.

-- Thomas Adam

=====
"The Linux Weekend Mechanic" -- http://linuxgazette.net
"TAG Editor"                 -- http://linuxgazette.net

"<shrug> We'll just save up your sins, Thomas, and punish 
you for all of them at once when you get better. The 
experience will probably kill you. :)"

 -- Benjamin A. Okopnik (Linux Gazette Technical Editor)


	
	
		
___________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html




More information about the TAG mailing list