2024-07-11

BASH script to find unmounted drives/partitions in linux

 for i in `fdisk -l | grep -E -v "/dev/sd.:|Device" | grep -E --color "/dev/sd|Size" | /local/etc/colcut 1`   do

        j=`/usr/bin/echo $i | cut -c 1-8`

        /usr/bin/df -h | /usr/bin/grep -E --color "/dev/sd|Device" | /usr/bin/sort | /usr/bin/grep -q $j || /usr/bin/echo $i

    done



# this script does not find unmounted drive without a partition, and does not discern if the partition is formatted

No comments:

Post a Comment

Linux NetworkManager command line configuration

 Configure Network Settings Using Network Manager in Linux Last updated: March 25, 2025 Written by:baeldung Network ConfigurationNetworkMana...