mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network?
@ 2004-06-02 12:04 Piszcz, Justin Michael
  2004-06-02 12:13 ` Christoph Hellwig
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Piszcz, Justin Michael @ 2004-06-02 12:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: Al Piszcz

root@jpiszcz:~# mkdir /p500/dev
root@jpiszcz:~# mount 192.168.0.253:/dev /p500/dev
root@jpiszcz:~# echo blah > /p500/dev/null
root@jpiszcz:~# ls -l /p500/dev/null
crw-rw-rw-  1 root sys 1, 3 Jul 17  1994 /p500/dev/null
root@jpiszcz:~# dd if=/dev/zero of=/p500/dev/null

6179737+0 records in
6179736+0 records out

Instead it treats it as a local block device?

Kernel 2.6.5.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network?
  2004-06-02 12:04 How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network? Piszcz, Justin Michael
@ 2004-06-02 12:13 ` Christoph Hellwig
  2004-06-02 12:19 ` Grzegorz Kulewski
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2004-06-02 12:13 UTC (permalink / raw)
  To: Piszcz, Justin Michael; +Cc: linux-kernel, Al Piszcz

On Wed, Jun 02, 2004 at 08:04:06AM -0400, Piszcz, Justin Michael wrote:
> root@jpiszcz:~# mkdir /p500/dev
> root@jpiszcz:~# mount 192.168.0.253:/dev /p500/dev
> root@jpiszcz:~# echo blah > /p500/dev/null
> root@jpiszcz:~# ls -l /p500/dev/null
> crw-rw-rw-  1 root sys 1, 3 Jul 17  1994 /p500/dev/null
> root@jpiszcz:~# dd if=/dev/zero of=/p500/dev/null
> 
> 6179737+0 records in
> 6179736+0 records out
> 
> Instead it treats it as a local block device?

character device actually.  Anyway, nfs never forwarded device files, the
protocol can't handle all the ioctl() variants anyway.

and how else would root on nfs work? :)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network?
  2004-06-02 12:04 How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network? Piszcz, Justin Michael
  2004-06-02 12:13 ` Christoph Hellwig
@ 2004-06-02 12:19 ` Grzegorz Kulewski
  2004-06-02 12:20 ` Måns Rullgård
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Grzegorz Kulewski @ 2004-06-02 12:19 UTC (permalink / raw)
  To: Piszcz, Justin Michael; +Cc: linux-kernel, Al Piszcz

Hi,

As far as I understand devices in Linux, device file is only some kind of 
note to the *local* kernel that operations on that file is to be 
redirected to the device. It is always resolved by the local kernel and 
redirected to the local device (if tere is driver that claims this 
major/minor number). Life would be to simple...


Grzegorz Kulewski


On Wed, 2 Jun 2004, Piszcz, Justin Michael wrote:

> root@jpiszcz:~# mkdir /p500/dev
> root@jpiszcz:~# mount 192.168.0.253:/dev /p500/dev
> root@jpiszcz:~# echo blah > /p500/dev/null
> root@jpiszcz:~# ls -l /p500/dev/null
> crw-rw-rw-  1 root sys 1, 3 Jul 17  1994 /p500/dev/null
> root@jpiszcz:~# dd if=/dev/zero of=/p500/dev/null
> 
> 6179737+0 records in
> 6179736+0 records out
> 
> Instead it treats it as a local block device?
> 
> Kernel 2.6.5.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network?
  2004-06-02 12:04 How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network? Piszcz, Justin Michael
  2004-06-02 12:13 ` Christoph Hellwig
  2004-06-02 12:19 ` Grzegorz Kulewski
@ 2004-06-02 12:20 ` Måns Rullgård
  2004-06-02 12:39 ` Richard B. Johnson
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Måns Rullgård @ 2004-06-02 12:20 UTC (permalink / raw)
  To: linux-kernel

"Piszcz, Justin Michael" <justin.piszcz@mitretek.org> writes:

> root@jpiszcz:~# mkdir /p500/dev
> root@jpiszcz:~# mount 192.168.0.253:/dev /p500/dev
> root@jpiszcz:~# echo blah > /p500/dev/null
> root@jpiszcz:~# ls -l /p500/dev/null
> crw-rw-rw-  1 root sys 1, 3 Jul 17  1994 /p500/dev/null
> root@jpiszcz:~# dd if=/dev/zero of=/p500/dev/null
>
> 6179737+0 records in
> 6179736+0 records out
>
> Instead it treats it as a local block device?
>
> Kernel 2.6.5.

That is how it's supposed to work.  Think about root on nfs.

-- 
Måns Rullgård
mru@kth.se


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network?
  2004-06-02 12:04 How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network? Piszcz, Justin Michael
                   ` (2 preceding siblings ...)
  2004-06-02 12:20 ` Måns Rullgård
@ 2004-06-02 12:39 ` Richard B. Johnson
  2004-06-02 20:37 ` Horst von Brand
  2004-06-02 20:46 ` Arthur Perry
  5 siblings, 0 replies; 8+ messages in thread
From: Richard B. Johnson @ 2004-06-02 12:39 UTC (permalink / raw)
  To: Piszcz, Justin Michael; +Cc: linux-kernel, Al Piszcz

On Wed, 2 Jun 2004, Piszcz, Justin Michael wrote:

> root@jpiszcz:~# mkdir /p500/dev
> root@jpiszcz:~# mount 192.168.0.253:/dev /p500/dev
> root@jpiszcz:~# echo blah > /p500/dev/null
> root@jpiszcz:~# ls -l /p500/dev/null
> crw-rw-rw-  1 root sys 1, 3 Jul 17  1994 /p500/dev/null
> root@jpiszcz:~# dd if=/dev/zero of=/p500/dev/null
>
> 6179737+0 records in
> 6179736+0 records out
>
> Instead it treats it as a local block device?
>
> Kernel 2.6.5.
>

First, /dev/null is a device file. Can you access a remote
device over nfs? ... like

		mount chaos:/dev/ttyS0  /mnt
		cat "foo" >/mnt

I think not. Yes it's the exact same thing; /dev/null is a
character device just like /dev/ttyS0, but a bit dumber.
The above used the network to make the essential equivalent
of a sym-link. The open of the device-file, the connection
of the major-minor numbers to the resulting file descriptor
occurred on your local system.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
            Note 96.31% of all statistics are fiction.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network?
  2004-06-02 12:04 How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network? Piszcz, Justin Michael
                   ` (3 preceding siblings ...)
  2004-06-02 12:39 ` Richard B. Johnson
@ 2004-06-02 20:37 ` Horst von Brand
  2004-06-02 20:46 ` Arthur Perry
  5 siblings, 0 replies; 8+ messages in thread
From: Horst von Brand @ 2004-06-02 20:37 UTC (permalink / raw)
  To: Piszcz, Justin Michael; +Cc: linux-kernel, Al Piszcz

"Piszcz, Justin Michael" <justin.piszcz@mitretek.org> said:

[...]

> Instead it treats it as a local block device?

Because only the _description_ (inode for device, etc) for /nfs/dev/null
are gotten over the net, the actual _device_ is local.
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network?
  2004-06-02 12:04 How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network? Piszcz, Justin Michael
                   ` (4 preceding siblings ...)
  2004-06-02 20:37 ` Horst von Brand
@ 2004-06-02 20:46 ` Arthur Perry
  5 siblings, 0 replies; 8+ messages in thread
From: Arthur Perry @ 2004-06-02 20:46 UTC (permalink / raw)
  To: Piszcz, Justin Michael; +Cc: linux-kernel, Al Piszcz

If your goal is to simply push the network (and here I am assuming you are
just using nfs for that reason simply because it seemed easy to set up and
do), and using nfs to create an actual file on disk on the other side
isn't going to be fast enough, try using netcat instead.. no nfs.

You can have netcat listen on a socket at the receiving end and redirect
to /dev/null. It is initiated on the recieving end, thus /dev/null will be
referenced by that machine.
You then can connect to it on the sending end with netcat and source from
your /dev/zero.

I used to do this, and use 'time' to determine how long it took to move xx
bytes.
It's a quick and dirty really.. But works well for rough approximations.

Arthur Perry
Lead Linux Developer / Linux Systems Architect
Validation, CSU Celestica
Sair/Linux Gnu Certified Professional
Providing professional Linux solutions for 7+ years



On Wed, 2 Jun 2004, Piszcz, Justin Michael wrote:

> root@jpiszcz:~# mkdir /p500/dev
> root@jpiszcz:~# mount 192.168.0.253:/dev /p500/dev
> root@jpiszcz:~# echo blah > /p500/dev/null
> root@jpiszcz:~# ls -l /p500/dev/null
> crw-rw-rw-  1 root sys 1, 3 Jul 17  1994 /p500/dev/null
> root@jpiszcz:~# dd if=/dev/zero of=/p500/dev/null
>
> 6179737+0 records in
> 6179736+0 records out
>
> Instead it treats it as a local block device?
>
> Kernel 2.6.5.
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network?
@ 2004-06-02 12:27 Piszcz, Justin Michael
  0 siblings, 0 replies; 8+ messages in thread
From: Piszcz, Justin Michael @ 2004-06-02 12:27 UTC (permalink / raw)
  To: Måns Rullgård, linux-kernel, Al Piszcz

Thanks, I was thinking since /dev/null isn't a ``device'' like a hard drive is; I thought this would work but I now see why it doesn't, thanks.

-----Original Message-----
From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Måns Rullgård
Sent: Wednesday, June 02, 2004 8:20 AM
To: linux-kernel@vger.kernel.org
Subject: Re: How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network?

"Piszcz, Justin Michael" <justin.piszcz@mitretek.org> writes:

> root@jpiszcz:~# mkdir /p500/dev
> root@jpiszcz:~# mount 192.168.0.253:/dev /p500/dev
> root@jpiszcz:~# echo blah > /p500/dev/null
> root@jpiszcz:~# ls -l /p500/dev/null
> crw-rw-rw-  1 root sys 1, 3 Jul 17  1994 /p500/dev/null
> root@jpiszcz:~# dd if=/dev/zero of=/p500/dev/null
>
> 6179737+0 records in
> 6179736+0 records out
>
> Instead it treats it as a local block device?
>
> Kernel 2.6.5.

That is how it's supposed to work.  Think about root on nfs.

-- 
Måns Rullgård
mru@kth.se

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-06-02 20:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-02 12:04 How come dd if=/dev/zero of=/nfs/dev/null does not send packets over the network? Piszcz, Justin Michael
2004-06-02 12:13 ` Christoph Hellwig
2004-06-02 12:19 ` Grzegorz Kulewski
2004-06-02 12:20 ` Måns Rullgård
2004-06-02 12:39 ` Richard B. Johnson
2004-06-02 20:37 ` Horst von Brand
2004-06-02 20:46 ` Arthur Perry
2004-06-02 12:27 Piszcz, Justin Michael

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®