Dear friends and colleges
we have servers with rhel 7.5 version , and each server include disks with filesystem and disks without filesystem
usually sda - is the OS disk , and sdb is disk that already have filesystem,
with the following lsblk syntax we can capture the disks list with filesystem type
lsblk --fs -o NAME,FSTYPE
NAME FSTYPE
sda
├─sda1 xfs
└─sda2 LVM2_member
├─VG-LV_root xfs
├─VG-LV_swap swap
└─VG-LV_var xfs
sdb ext4
sdc
sdd
I want to know how to match all the disks that are without filesystem
expected output
sdc
sdd
so we try the following syntax
lsblk --fs -o NAME,FSTYPE | awk '$2 == "" {print $1}'
but we get the following
sda
sdc
sdd
so we get sda in spite sda have filesystem ( XFS )
so how to capture only the real disks that are without filesystem - sdc / sdd