From owner-freebsd-net@FreeBSD.ORG Sat Jan 30 22:55:26 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65E63106566B for ; Sat, 30 Jan 2010 22:55:26 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id E4CEF8FC14 for ; Sat, 30 Jan 2010 22:55:25 +0000 (UTC) Received: by bwz5 with SMTP id 5so534214bwz.3 for ; Sat, 30 Jan 2010 14:55:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:cc:subject:references :organization:from:date:in-reply-to:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=Y0V0Lz30NruI1BXyy8VP+uKbpxJghw4245ANV5KlJc8=; b=f61hC+A1OhfyuW8oIF9+5kPHTxqKa7JIpsial3Mepx+x04qpJxs4Jx3M5dnvhJti6j pICC2lNLoteASVgbUqB2GWR+TJjcBUcoqzRwaomSdocA3LRYhzzLwJuJAJKQHTXzWwtb rDfQWTLIqBAalHrXHp5BqfSn24UFvGNb4YCGc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:cc:subject:references:organization:from:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; b=Igdg/uHA48wJ0ug9cBYEFABp1C8xyRiWou9G36PKmxvNxr1qnzEudWXBUhf8K1mqa9 ec6zTFDrLHUKBNLC96PcFRPWbr8wL7HzGwif7E1GJ4t8aO/b5HmDJdSVOC/9BYB+wH6K BkuqYSfSXTGngiwD05m8UC1qPZl2FLKUYsYnQ= Received: by 10.204.141.3 with SMTP id k3mr1701666bku.48.1264892124700; Sat, 30 Jan 2010 14:55:24 -0800 (PST) Received: from localhost ([95.69.161.2]) by mx.google.com with ESMTPS id 13sm1481070bwz.6.2010.01.30.14.55.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 30 Jan 2010 14:55:23 -0800 (PST) To: Alan Aldrich References: Organization: TOA Ukraine From: Mikolaj Golub Date: Sun, 31 Jan 2010 00:55:21 +0200 In-Reply-To: (Alan Aldrich's message of "Thu\, 28 Jan 2010 08\:46\:33 -0800") Message-ID: <86wryzurs6.fsf@kopusha.onet> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Cc: freebsd-net@freebsd.org Subject: Re: NFS mount properties X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2010 22:55:26 -0000 On Thu, 28 Jan 2010 08:46:33 -0800 Alan Aldrich wrote: > I am trying to determine how to examine the actual properties of an > nfs mount in FreeBSD > In CentOS one can 'cat /proc/mounts' to determine all of the mount > properties. > Specifically I am trying to confirm whether the mount is using TCP or > UDP as I want it to > be TCP . Is there some similar way to tell in FreeBSD? > > My fstab entry says this > 192.168.44.55:/mcp/home /net nfs rw,async,-d,-3,-s,-i,noatime,- > T 0 0 > It mounts fine, > but I want to confirm that it is actually mounting with TCP and not > UDP and cannot figure out > what tool will tell me this. > > 'mount' tells me this > 192.168.44.55:/mcp/home on /net (nfs, asynchronous, noatime) > > but not whether it is mounted TCP or UDP If it is mounted with TCP u UDP you can find out with netstat, checking tcp connections to 2049 port. If you see established connections like below tcp4 0 0 10.0.0.110.895 10.0.100.2.2049 ESTABLISHED then tcp is used. Certainly if you have several mounts on the same ip it complicates the situation :-) I don't know any such tools that would report this info and would glad to hear about them, but if I really needed this info I could use the universal tool -- kgdb :-) zhuzha:~% sudo kgdb (kgdb) set print pretty (kgdb) p *mountlist.tqh_first.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next $26 = { ... mnt_list = { tqe_next = 0xc5e9a78c, tqe_prev = 0xc5e9acac }, ... mnt_opt = 0xc61f7760, ... mnt_stat = { f_version = 537068824, f_type = 4, f_flags = 0, f_bsize = 512, f_iosize = 32768, f_blocks = 284354052, f_bfree = 137997300, f_bavail = 115248976, f_files = 18394110, f_ffree = 16921938, f_syncwrites = 0, f_asyncwrites = 0, f_syncreads = 0, f_asyncreads = 0, f_spare = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, f_namemax = 255, f_owner = 0, f_fsid = { val = {67174148, 4} }, f_charspare = '\0' , f_fstypename = "nfs", '\0' , f_mntfromname = "srv01.ua1:/var/public\000\004(\000\000\000\000\000\214\004\b\003\000\000\000\003\000\000\000P\000\000\000X\002\000\000\200»\000\000\000ÐBÆ\000\000\000\000 \a \aÀ\a7Æ \a7ÆÀx\037Æ°x\037Æ\004\000\000\000\v\000\000", f_mntonname = "/mnt/0", '\0' }, ... } (kgdb) p *mountlist.tqh_first.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_opt.tqh_first $27 = { link = { tqe_next = 0xc6370560, tqe_prev = 0xc61f7760 }, name = 0xc61f7770 "rw", value = 0xc61f7780, len = 1, pos = 0, seen = 0 } (kgdb) p *mountlist.tqh_first.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_opt.tqh_first.link.tqe_next $28 = { link = { tqe_next = 0xc6370580, tqe_prev = 0xc6370520 }, name = 0xc61f77a0 "soft", value = 0xc61f77b0, len = 1, pos = 1, seen = 1 } (kgdb) p *mountlist.tqh_first.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_opt.tqh_first.link.tqe_next.link.tqe_next $29 = { link = { tqe_next = 0xc63705a0, tqe_prev = 0xc6370560 }, name = 0xc61f77c0 "intr", value = 0xc61f7810, len = 1, pos = 2, seen = 1 } (kgdb) p *mountlist.tqh_first.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_opt.tqh_first.link.tqe_next.link.tqe_next.link.tqe_next $30 = { link = { tqe_next = 0xc63705e0, tqe_prev = 0xc6370580 }, name = 0xc61f77d0 "rsize", value = 0xc61f77e0, len = 6, pos = 3, seen = 1 } (kgdb) p *mountlist.tqh_first.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_opt.tqh_first.link.tqe_next.link.tqe_next.link.tqe_next.link.tqe_next $31 = { link = { tqe_next = 0xc6370620, tqe_prev = 0xc63705a0 }, name = 0xc61f77f0 "wsize", value = 0xc61f7800, len = 6, pos = 4, seen = 1 } (kgdb) p *mountlist.tqh_first.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_list.tqe_next.mnt_opt.tqh_first.link.tqe_next.link.tqe_next.link.tqe_next.link.tqe_next.link.tqe_next $32 = { link = { tqe_next = 0xc6370640, tqe_prev = 0xc63705e0 }, name = 0xc61f7820 "tcp", value = 0xc61f7830, len = 1, pos = 5, seen = 1 } If I needed to do this frequently I would write a gdb script taking as an example nice scripts from jhb :-) http://people.freebsd.org/~jhb/gdb/ -- Mikolaj Golub