[PC-BSD Testing] 9.2 beta images, disk vendor names are cut off..

Warner Losh imp at bsdimp.com
Sun Aug 11 10:56:57 PDT 2013


On Aug 11, 2013, at 10:20 AM, Sam Fourman Jr. wrote:

> On Sun, Aug 11, 2013 at 9:40 AM, Lars Engels <lars.engels at 0x20.net> wrote:
>> Am 10.08.2013 16:37, schrieb Sam Fourman Jr.:
>> 
>>>> 
>>>> Try this:
>>>> 
>>>> sysctl -n kern.disks | tr ' ' '\n' | sort -n | xargs
>>>> 
>>> 
>>> it doesn't work... here is what I get returned
>>> 
>>> sysctl -n kern.disks | tr ' ' '\n' | sort -n | xargs
>>> ada0 ada1 da0 da1 da10 da11 da12 da13 da14 da15 da16 da17 da18 da19
>>> da2 da20 da21 da3 da4 da5 da6 da7 da8 da9
>> 
>> 
>> You're right, sorry.
>> But this one works:
>> 
>> sysctl -n kern.disks | tr ' ' '\n' | sort -n -k1.3  | xargs
>> 
>> That sorts numerical in the first column after the third character.
> 
> yes that does work
> root at Ziggy:~ # sysctl -n kern.disks | tr ' ' '\n' | sort -n -k1.3  | xargs
> ada0 ada1 da0 da1 da2 da3 da4 da5 da6 da7 da8 da9 da10 da11 da12 da13
> da14 da15 da16 da17 da18 da19 da20 da21
> root at Ziggy:~ #

It is only working on the da devices because it is a stable sort and the devices are almost in order before the sort.

Warner


More information about the Testing mailing list