#!/bin/bash #(C)2007 DatuX #returns fullpaths to discs that are not used cd /sys/block for SYS in *; do DEV=/dev/`echo $SYS| sed s@!@/@g` #range=1 (things like dm, loop, fd etc)? [ "`cat $SYS/range`" == "1" ] && continue; #try to open device exclusively, to see if its in use if openex $DEV; then echo $DEV fi done