Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Mar 2019 10:37:46 +0100 (CET)
From:      =?ISO-8859-1?Q?Trond_Endrest=F8l?= <Trond.Endrestol@fagskolen.gjovik.no>
To:        FreeBSD current <freebsd-current@freebsd.org>
Subject:   Re: ZFS no longer mounted in alphanumerical order
Message-ID:  <alpine.BSF.2.21.9999.1903121034570.315@mail.fig.ol.no>
In-Reply-To: <e45bc5ab-af40-ad75-b5b2-8b0830aa915a@FreeBSD.org>
References:  <201903120012.x2C0CeeJ012446@gndrsh.dnsmgr.net> <e45bc5ab-af40-ad75-b5b2-8b0830aa915a@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 12 Mar 2019 08:54+0200, Andriy Gapon wrote:

> On 12/03/2019 02:12, Rodney W. Grimes wrote:
> >> On 11/03/2019 23:03, Freddie Cash wrote:
> >>> Wouldn't it make more sense to teach df, du, "zfs list", and other things
> >>> that list the mounted filesystems to use sorted output?
> >>
> >> | sort [desired options]
> > 
> > Except that df and zfs list have a header that you have to deal with,
> > which is not so easy to get sort to do the right things with out
> > some hoop jumping.
> 
> Like "| tail +2" ?
> Or if it's just for visual inspection (as seems to be the case for the original
> poster) just mentally filter out that line.
> 
> >> P.S.
> >> zfs list already supports sorting by a specific property.
> > 
> > Perhaps make zfs list -s mountpoint a default?
> 
> Why?

I concocted a shell script, it looks promising:

#!/bin/sh
#-
# Parallel mounting of ZFS filesystems leaves a chaotic listing of
# mounted filesystems when viewed by df(1).
# Separating the header from the remaining lines and sorting the
# latter before recombining is a viable solution.
#-

DF=/bin/df

${DF} ${@} | grep    ^Filesystem
${DF} ${@} | grep -v ^Filesystem | sort -k 6

# new-df.sh

-- 
Trond.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.21.9999.1903121034570.315>