[Fai-commit] r4920 - trunk/lib
lange at alioth.debian.org
lange at alioth.debian.org
Tue May 27 13:31:23 UTC 2008
Author: lange
Date: 2008-05-27 13:31:22 +0000 (Tue, 27 May 2008)
New Revision: 4920
Modified:
trunk/lib/disk-info
Log:
use group info for detecting disks, extend pattern for detecting scsi disks
Modified: trunk/lib/disk-info
===================================================================
--- trunk/lib/disk-info 2008-05-27 13:28:01 UTC (rev 4919)
+++ trunk/lib/disk-info 2008-05-27 13:31:22 UTC (rev 4920)
@@ -14,12 +14,13 @@
isdisk=1
# skip ide cdrom
[ -f /proc/ide/$device/media ] && grep -q cdrom /proc/ide/$device/media && isdisk=0
- [ `cat /sys/block/$device/removable` -eq 1 ] && isdisk=0
+# old way of detecting disks: [ `cat /sys/block/$device/removable` -eq 1 ] && isdisk=0
+ [ `stat -c %G /dev/$device` = "disk" ] || isdisk=0
[ $isdisk -eq 1 ] && echo "$device $blocks"
done
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# echo a space separated list of devices and their block size
-egrep ' i2o/hd.\b| cciss/c.d.\b| ida/c.d.\b| rd/c.d.\b| hd.\b| sd.\b|/disc\b' /proc/partitions | diskandsize
+egrep ' i2o/hd.\b| cciss/c.d.\b| ida/c.d.\b| rd/c.d.\b| hd.\b| sd[a-z]{1,2}\b|/disc\b' /proc/partitions | diskandsize
More information about the Fai-commit
mailing list