Is it possible to filter output of lvs -a using lvs command (I know that it is possible with grep, however I look for some approach with lvm only).

I mean listing only snapshosts and/or filter by name (regex or simple pattern).

Any ideas?


Yes, you can use the --select option to filter on any number of criteria; for example, on the LV name:

sudo lvs -a --select 'lv_name =~ yourregex'

Run lvs --select help to see the full list of operators and fields you can use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.