Re: How to get file from nfs id

2013-07-11 Thread Dan Nelson
In the last episode (Jul 11), Radek Krejca said:
> Hello,
> 
> I have problem with heavy load of my nfsd server. There is connected about 70 
> diskless machines, but in readonly mode. I catched traffic and get this:
> 
> 21:00:39.715337 IP diskless-1.3297435097 > storage.nfs: 112 getattr fh 
> Unknown/A27801CEDE115FA30A005CD908007ABA4200570CDB51
> 21:00:39.716229 IP storage.nfs > diskless-1.3297435097: reply ok 112 getattr 
> REG 444 ids 0/0 sz 64944
> 21:00:39.716463 IP diskless-1.3297435098 > storage.nfs: 112 getattr fh 
> Unknown/A27801CEDE115FA30A0043DE08007CBA4200570CDB51
> 21:00:39.719112 IP storage.nfs > diskless-1.3297435098: reply ok 112 getattr 
> REG 444 ids 0/0 sz 82800
> 21:00:39.719453 IP diskless-1.3297435099 > storage.nfs: 112 getattr fh 
> Unknown/A27801CEDE115FA30A0043DE08007CBA4200570CDB51
> 21:00:39.721636 IP storage.nfs > diskless-1.3297435099: reply ok 112 getattr 
> REG 444 ids 0/0 sz 82800
> 
> Why is the same machine requesting chmod of the same file and is there any
> way to find out name of file from this long id?

You can't get tcpdump to print it, but the getattr reply does include the
inode of the file.  If you start up wireshark and capture the same packets
(or open a capture file created by tcpdump), the inode is stored in the
"nfs->obj_attributes->attributes->fileid" field.  You can then use "find /
-inum 12345" to locate that inode on disk.

-- 
Dan Nelson
dnel...@allantgroup.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: How to get file from nfs id

2013-07-11 Thread Frank Leonhardt

On 11/07/2013 06:47, Radek Krejc(a wrote:

Hello,

I have problem with heavy load of my nfsd server. There is connected about 70 
diskless machines, but in readonly mode. I catched traffic and get this:

21:00:39.715337 IP diskless-1.3297435097 > storage.nfs: 112 getattr fh
Unknown/A27801CEDE115FA30A005CD908007ABA4200570CDB51
21:00:39.716229 IP storage.nfs > diskless-1.3297435097: reply ok 112
getattr REG 444 ids 0/0 sz 64944
21:00:39.716463 IP diskless-1.3297435098 > storage.nfs: 112 getattr fh
Unknown/A27801CEDE115FA30A0043DE08007CBA4200570CDB51
21:00:39.719112 IP storage.nfs > diskless-1.3297435098: reply ok 112
getattr REG 444 ids 0/0 sz 82800
21:00:39.719453 IP diskless-1.3297435099 > storage.nfs: 112 getattr fh
Unknown/A27801CEDE115FA30A0043DE08007CBA4200570CDB51
21:00:39.721636 IP storage.nfs > diskless-1.3297435099: reply ok 112
getattr REG 444 ids 0/0 sz 82800

Why is the same machine requesting chmod of the same file and is there any way 
to find out name of file from this long id?

Thank you
Radek


Sorry - I don't think there's an easy answer to this but someone who 
knows more about nfsd may be along soon.


However, if no better idea turns up you could try using dtrace to 
monitor the underlying calls (or hack nfsd?). I have thought about doing 
this myself, but it is only available in new FreeBSD releases and the 
DTrace user guide (from Sun) is 60 pages long and gives me a headache. I 
know Linux people do something similar using SystemTap.


Is the attribute caching on the client set correctly? Or even working (bug?)

BTW, what you're seeing isn't unusual.

Regards, Frank.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


How to get file from nfs id

2013-07-10 Thread Radek Krejča
Hello,

I have problem with heavy load of my nfsd server. There is connected about 70 
diskless machines, but in readonly mode. I catched traffic and get this:

21:00:39.715337 IP diskless-1.3297435097 > storage.nfs: 112 getattr fh
Unknown/A27801CEDE115FA30A005CD908007ABA4200570CDB51
21:00:39.716229 IP storage.nfs > diskless-1.3297435097: reply ok 112
getattr REG 444 ids 0/0 sz 64944
21:00:39.716463 IP diskless-1.3297435098 > storage.nfs: 112 getattr fh
Unknown/A27801CEDE115FA30A0043DE08007CBA4200570CDB51
21:00:39.719112 IP storage.nfs > diskless-1.3297435098: reply ok 112
getattr REG 444 ids 0/0 sz 82800
21:00:39.719453 IP diskless-1.3297435099 > storage.nfs: 112 getattr fh
Unknown/A27801CEDE115FA30A0043DE08007CBA4200570CDB51
21:00:39.721636 IP storage.nfs > diskless-1.3297435099: reply ok 112
getattr REG 444 ids 0/0 sz 82800

Why is the same machine requesting chmod of the same file and is there any way 
to find out name of file from this long id?

Thank you
Radek

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: sh script code to get file size.

2013-01-18 Thread Robert Bonomi
> From owner-freebsd-questi...@freebsd.org  Fri Jan 18 17:30:31 2013
> Date: Fri, 18 Jan 2013 18:26:54 -0500
> From: Fbsd8 
> To: FreeBSD questions 
> Subject: sh script code to get file size.
>
> In a script in am working on I need to find out the allocated
> size of a sparse file.
> The only command that comes to mind is "ls -lh"
> The "du -h" command is not appropriate because it will show
> the occupied size and not the allocated size.
>
> I don't know how to parse out to the position in the output of that
> "ls -lh" command to pickup the file size value.

   ls -lh  procmail.log |awk '{print $5}'
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: sh script code to get file size.

2013-01-18 Thread Chris Hill

On Fri, 18 Jan 2013, Fbsd8 wrote:


In a script in am working on I need to find out the allocated
size of a sparse file.
The only command that comes to mind is "ls -lh"
The "du -h" command is not appropriate because it will show
the occupied size and not the allocated size.

I don't know how to parse out to the position in the output of that
"ls -lh" command to pickup the file size value.

Is there some other way to do this?


To parse it out, I've used something like:

$ ls -lh npviewer.bin.core | cut -d \  -f 9
186M

After the backslash are two spaces: one being the space that's being 
escaped to make it the delimiter, the other to separate the options.


The number after the '-f' determines which "field" of the output is 
displayed, which may vary.


HTH.

--
Chris Hill   ch...@monochrome.org
** [ Busy Expunging  ]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: sh script code to get file size.

2013-01-18 Thread Fbsd8

Chris Hill wrote:

On Fri, 18 Jan 2013, Fbsd8 wrote:


In a script in am working on I need to find out the allocated
size of a sparse file.
The only command that comes to mind is "ls -lh"
The "du -h" command is not appropriate because it will show
the occupied size and not the allocated size.

I don't know how to parse out to the position in the output of that
"ls -lh" command to pickup the file size value.

Is there some other way to do this?


To parse it out, I've used something like:

$ ls -lh npviewer.bin.core | cut -d \  -f 9
186M

After the backslash are two spaces: one being the space that's being 
escaped to make it the delimiter, the other to separate the options.


The number after the '-f' determines which "field" of the output is 
displayed, which may vary.


HTH.


Yes that works real nice.

Thanks to all who replied.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: sh script code to get file size.

2013-01-18 Thread Fbsd8




In a script in am working on I need to find out the allocated
size of a sparse file.
The only command that comes to mind is "ls -lh"
The "du -h" command is not appropriate because it will show
the occupied size and not the allocated size.

I don't know how to parse out to the position in the output of that
"ls -lh" command to pickup the file size value.

Is there some other way to do this?



reza wrote:
> Does this work for you
>
> $ ls -lh | awk '{print $5}'
>
> 132B
> 0B
> 3.8k
> 512B
> 3.9k
> 512B
> 512B
> 14M
> 512B
>
>

Thanks that works for me.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: sh script code to get file size.

2013-01-18 Thread Vincent Hoffman
On 18/01/2013 23:26, Fbsd8 wrote:
> In a script in am working on I need to find out the allocated
> size of a sparse file.
> The only command that comes to mind is "ls -lh"
> The "du -h" command is not appropriate because it will show
> the occupied size and not the allocated size.
>
> I don't know how to parse out to the position in the output of that
> "ls -lh" command to pickup the file size value.
>
> Is there some other way to do this?
cut or awk spring to mind. I'm sure there are more :)
(23:31:48 <~>) 0
jhary@ostracod $ ls -lh Cisco-vpn-Profiles.zip | cut -f 5 -w
16k
(23:32:15 <~>) 0
jhary@ostracod $ ls -lh Cisco-vpn-Profiles.zip | awk '{print $5}'
16k
(23:32:25 <~>) 0
jhary@ostracod $ ls -lh Cisco-vpn-Profiles.zip
-rw-r--r--  1 jhary  wheel16k 11 Jul  2004 Cisco-vpn-Profiles.zip
(23:32:32 <~>) 0
jhary@ostracod $


Vince

> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscr...@freebsd.org"

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: sh script code to get file size.

2013-01-18 Thread Dan Nelson
In the last episode (Jan 18), Fbsd8 said:
> In a script in am working on I need to find out the allocated
> size of a sparse file.
> The only command that comes to mind is "ls -lh"
> The "du -h" command is not appropriate because it will show
> the occupied size and not the allocated size.
> 
> I don't know how to parse out to the position in the output of that
> "ls -lh" command to pickup the file size value.
> 
> Is there some other way to do this?

For a single file, you can get the exact filesize with "stat -f %z
filename".  For the human-friendly version, "du -hA" will work.

-- 
Dan Nelson
dnel...@allantgroup.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


sh script code to get file size.

2013-01-18 Thread Fbsd8

In a script in am working on I need to find out the allocated
size of a sparse file.
The only command that comes to mind is "ls -lh"
The "du -h" command is not appropriate because it will show
the occupied size and not the allocated size.

I don't know how to parse out to the position in the output of that
"ls -lh" command to pickup the file size value.

Is there some other way to do this?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: get file

2006-06-06 Thread Ricardo Carvalho

on orts you can also use curl

On 6/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:



-- Original message --
From: Efren Bravo <[EMAIL PROTECTED]>
> Hi,
>
> Is there a way from the console to get a file by
> http | ftp protocol?
>
> Which command should I run to do it?
>
> Thanks,
>
>
> Efren Bravo.
> -

install wget from ports, gets you something like this: wget
http://urltofileyouwanttodownload

or man wget for options

ftp, connect to ftp service on remote box and cd to the directory where
the file resides and do: get filename.   File will end up in the directory
from which you initiated ftp on your box.

Bob
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "
[EMAIL PROTECTED]"


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: get file

2006-06-06 Thread bob . middaugh

 -- Original message --
From: Efren Bravo <[EMAIL PROTECTED]>
> Hi,
> 
> Is there a way from the console to get a file by
> http | ftp protocol?
> 
> Which command should I run to do it?
> 
> Thanks,
> 
> 
> Efren Bravo.
> -

install wget from ports, gets you something like this: wget 
http://urltofileyouwanttodownload

or man wget for options

ftp, connect to ftp service on remote box and cd to the directory where the 
file resides and do: get filename.   File will end up in the directory from 
which you initiated ftp on your box.

Bob
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: get file

2006-06-06 Thread michael johnson

On 6/6/06, Efren Bravo <[EMAIL PROTECTED]> wrote:


Hi,

Is there a way from the console to get a file by
http | ftp protocol?

Which command should I run to do it?



fetch


Thanks,



Efren Bravo.
-
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=ZWZyZW5iYQ%3D%3D

__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.yahoo.es
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "
[EMAIL PROTECTED]"


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: get file

2006-06-06 Thread Igor Robul
On Tue, Jun 06, 2006 at 02:36:02PM +0200, Efren Bravo wrote:
> Hi,
> 
> Is there a way from the console to get a file by
> http | ftp protocol?
fetch (in base system)
wget (in ports)
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


get file

2006-06-06 Thread Efren Bravo
Hi,

Is there a way from the console to get a file by
http | ftp protocol?

Which command should I run to do it?

Thanks,


Efren Bravo.
-
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=ZWZyZW5iYQ%3D%3D

__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.yahoo.es 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"