installer: detect ciss(4) devices/partitions correctly (#44).

This commit is contained in:
Juan RP 2015-10-10 10:19:43 +02:00
parent cb2510b379
commit 8261f90a2a
1 changed files with 17 additions and 0 deletions

View File

@ -141,6 +141,14 @@ show_disks() {
gbytes="$(($size * $sectorsize / 1024 / 1024 / 1024))"
echo "size:${gbytes}GB;sector_size:$sectorsize"
done
# cciss(4) devices
for dev in $(ls /dev/cciss|grep -E 'c[0-9]d[0-9]$'); do
echo "/dev/cciss/$dev"
size=$(cat /sys/block/cciss\!$dev/size)
sectorsize=$(cat /sys/block/cciss\!$dev/queue/hw_sector_size)
gbytes="$(($size * $sectorsize / 1024 / 1024 / 1024))"
echo "size:${gbytes}GB;sector_size:$sectorsize"
done
}
show_partitions() {
@ -176,6 +184,15 @@ show_partitions() {
echo "size:${fssize:-unknown};fstype:${fstype:-none}"
fi
done
# cciss(4) devices
for part in $(ls /dev/cciss|grep -E 'c[0-9]d[0-9]p[0-9]+'); do
fstype=$(lsblk -nfr /dev/cciss/$part|awk '{print $2}')
[ "$fstype" = "crypto_LUKS" ] && continue
[ "$fstype" = "LVM2_member" ] && continue
fssize=$(lsblk -nr /dev/cciss/$part|awk '{print $4}')
echo "$part"
echo "size:${fssize:-unknown};fstype:${fstype:-none}"
done
if [ -e /sbin/lvs ]; then
# LVM
lvs --noheadings|while read lvname vgname perms size; do