I have two servers that have over 20 partitions and I'm trying to figure out which partitions are encrypted or not.
Instead of going thru each one manually with the blkid command, example: blkid /dev/sda
[root@example ~]# blkid /dev/sda2
/dev/sda2: UUID="rlW1d2-Bg0Z-tt33-UFbC-w0Xk-v64F-quyjJQ" TYPE="LVM2_member"
I want to use the power of Bash to do it.
I was thinking I would create a .txt (fdisk_output.txt) with all of the partitions and then have them loop thru and output the end results to a file, however I'm not sure if I'm on the right path or not:
Code:
#!/bin/bash
for i in fdisk_output.txt
do
blkid on i
done
I'm not sure if my code is right, again the command that I want to loop thru is blkid against the various partitions and then output the results to a file.