Skip to content

Commit 25f37c0

Browse files
authored
Create lvm-vg2scsi-channel
formatted version stolen :)
1 parent 3d74762 commit 25f37c0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lvm-vg2scsi-channel

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
echo "connected disks" > /root/disks.txt; echo "physical volumes" > /root/physical_volumes.txt; ls -ld /sys/block/sd*/device | awk '{print$9}' | cut -d \/ -f 4 >> /root/disks.txt; pvs | awk '{print$1}' | cut -d \/ -f 3 | sort >> /root/physical_volumes.txt; diff -y /root/disks.txt /root/physical_volumes.txt
2+
#
3+
#formatted version below
4+
#
5+
echo -en 'DISK\t\tVG\n-----\t\t--\n' ; for i in /sys/block/sd*/device; do echo -n $(ls -ld $i | cut -d'/' -f 4,8 | sed 's/\// /gi') ; echo -ne '\t' ; pvs | tail -n +2 | grep $(echo $i | cut -d'/' -f4) | awk '{print $2}' ; echo ; done
6+
#
7+
#output should look like:
8+
#
9+
# DISK VG
10+
# ----- --
11+
# sda 2:0:0:0
12+
# sdb 2:0:1:0 os

0 commit comments

Comments
 (0)