• Jan Safranek's avatar
    Do not reformat devices with partitions · 4cf36b8b
    Jan Safranek authored
    lsblk reports FSTYPE of devices with partition tables as empty string "",
    which is indistinguishable from empty devices. We must look for dependent
    devices (i.e. partitions) to see that the device is really empty and report
    error otherwise.
    
    I checked that LVM, LUKS and MD RAID have their own FSTYPE in lsblk output,
    so it should be only a partition table that has empty FSTYPE.
    
    The main point of this patch is to run lsblk without "-n", i.e. print all
    dependent devices and check if they're there.
    4cf36b8b
Name
Last commit
Last update
..
BUILD Loading commit data...
OWNERS Loading commit data...
doc.go Loading commit data...
fake.go Loading commit data...
mount.go Loading commit data...
mount_linux.go Loading commit data...
mount_linux_test.go Loading commit data...
mount_unsupported.go Loading commit data...
nsenter_mount.go Loading commit data...
nsenter_mount_unsupported.go Loading commit data...
safe_format_and_mount_test.go Loading commit data...