Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by Hai Nguyen for kickstart device location changes (enumeration order)

I use the code to detect HDD or USB. Hope this solution will helpfull.

hard_disks=`lsblk --nodeps -no name,type,tran | grep "disk" | grep -v "usb" | grep -Eo '^[^ ]+'`count_disk=`echo $hard_disks |grep -o '' | wc -l`if [ $count_disk -ne 0 ]; then    hard_disks=`lsblk --nodeps -no name,type,tran | grep "disk" | grep -v "usb" | grep -Eo '^[^ ]+' | sed ':a;N;$!ba;s/\n/,/g'`fiusb=`lsblk --nodeps -no name,type,tran | grep "usb" | grep -Eo '^[^ ]+'`

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>