hubertf's NetBSD Blog
Send interesting links to hubert at feyrer dot de!
 
[20060323] Getting filesystem parameters
OK, this is one from the "learn something new every day"-department that I'd like to share with you: How do you find out about the read/write size negotiated in NFS mounts and other filesystem parameters? Matt Green hinted at "mount -vv" as an answer.

Looking at "normal" mount(8) output is pretty familiar, e.g. on my Sun SPARCstation 5 that has two local partitions and an NFS mount from another machine:

smaug# mount 
/dev/sd0a on / type ffs (local)
/dev/sd0e on /usr type ffs (local)
procfs on /proc type procfs (read-only, local)
kernfs on /kern type kernfs (read-only, local)
server.ipv6.fh-regensburg.de:/disk5 on /disk5 type nfs 
Two local filesystems on the first SCSI disk, procfs and kernfs, and a NFS mount from a remote NFS server - I do NFS over IPv6, works flawless since ever. Now to get a bit more information using "-v" (long lines continued with \ at the end):
smaug# mount -v
/dev/sd0a on / type ffs (local, root file system, fsid: 0x700/0x78b, \
	reads: sync 475428 async 32, writes: sync 79953 async 7238)
/dev/sd0e on /usr type ffs (local, fsid: 0x704/0x78b, reads: sync \
	711144 async 65, writes: sync 2 async 24)
procfs on /proc type procfs (read-only, local, fsid: 0x1b01/0x1ae1b, \
	reads: sync 0 async 0, writes: sync 0 async 0)
kernfs on /kern type kernfs (read-only, local, fsid: 0x8b01/0x1d28b, \
	reads: sync 0 async 0, writes: sync 0 async 0)
server.ipv6.fh-regensburg.de:/disk5 on /disk5 type nfs (fsid: 0xb01/0x70b, \
	reads: sync 0 async 0, writes: sync 0 async 0) 
This gives some insight on the filesystem IDs (not too thrilling), and also the number of reads and writes done on the filesystem, both for synchronous as well as for asynchronous operations. NFS operations are not printed, nfsstat(1) is probably more useful there.

But there is more information, if you use "-v" twice (long lines continued with \ again):

smaug# mount -vv
mount_ffs: /dev/sd0a on /: specified device does not match mounted device
/dev/sd0a on / type ffs (local, root file system, fsid: 0x700/0x78b, reads: \
	sync 475441 async 32, writes: sync 79953 async 7240)
/dev/sd0e on /usr type ffs (local, fsid: 0x704/0x78b, reads: sync 711205 \
	async 65, writes: sync 2 async 24)
procfs on /proc type procfs (read-only, local, fsid: 0x1b01/0x1ae1b, reads: \
	sync 0 async 0, writes: sync 0 async 0, [procfs: version=1, \
	flags=0x0])
kernfs on /kern type kernfs (read-only, local, fsid: 0x8b01/0x1d28b, reads: \
	sync 0 async 0, writes: sync 0 async 0)
server.ipv6.fh-regensburg.de:/disk5 on /disk5 type nfs (fsid: 0xb01/0x70b, \
	reads: sync 0 async 0, writes: sync 0 async 0, [nfs: \
	addr=2001:638:a01:5:125:2aff:fe82:cade, port=2049, addrlen=28, \
	sotype=2, proto=0, fhsize=0, flags=0x8281, \
	wsize=8192, rsize=8192, readdirsize=8192, timeo=300, retrans=10, \
	maxgrouplist=16, readahead=2, leaseterm=30, deadthresh=9]) 
Giving "-v" twice prints filesystem-specific data, in the above example for procfs's version, and all the parameters used in the NFS mount, among them the block sizes used for reading and writing blocks, rsize and wsize.

Enjoy!

[Tags: , ]


Disclaimer: All opinion expressed here is purely my own. No responsibility is taken for anything.

Access count: 38740595
Copyright (c) Hubert Feyrer