Guest User

Untitled

a guest
Apr 26th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. # lists all IDE hard disk devices on system
  2.  
  3. for g in /proc/ide/hd*/media; do
  4. if test ! -e "$g"; then continue; fi
  5. if test xdisk = "x`cat $g`"; then
  6. d="${g%/*}"; d="${d##*/hd}"
  7. echo /dev/hd$d
  8. fi
  9. done
  10.  
  11. # lists all SATA hard disk devices on system
  12.  
  13. for sd in `egrep '^[[:space:]]*[0-9]+[[:space:]]+[0-9]+[[:space:]]+sd[a-z] ' /proc/diskstats |awk '{print $3}'`; do
  14. echo /dev/$sd
  15. done
Add Comment
Please, Sign In to add comment