"removable" flag

Andreas Schuldei andreas+linux-fai at schuldei.org
Fri Feb 29 09:48:13 CET 2008


* Andreas Schuldei (andreas+linux-fai at schuldei.org) [080228 22:07]:
> this is directly related to bug
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=404927
> 
> aparently the removable flag is used against partition table
> caching. the udev fix for the bug was applied. it moves the disk
> into the "disk" group (out of the "floppy" group). this could be
> a way to check if a device should be removed from the list of
> devices, btw, instead of the "removable" flag.

here is a patch that fixes this problem and an other one for me

the other bug is that sun fire X4500 machines have 48 disks and 
have device names like /dev/sdac1. it could be that this is even 
possible for sata disks. i guess it would be more correct to detect 
disks like that for hdXX, too. 

diff -u --from-file /srv/fai/nfsroot/live/filesystem.dir/usr/lib/fai/disk-info /usr/lib/fai/disk-info
--- /srv/fai/nfsroot/live/filesystem.dir/usr/lib/fai/disk-info  2008-02-29 09:23:22.000000000 +0100
+++ /usr/lib/fai/disk-info      2008-02-29 09:21:59.000000000 +0100
@@ -14,12 +14,12 @@
        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
+       [ `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 ' cciss/c.d.\b| ida/c.d.\b| rd/c.d.\b| hd.\b| sd.\b|/disc\b' /proc/partitions | diskandsize
+egrep ' 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 linux-fai mailing list