diff options
author | ramon <ramongomez@us.es> | 2015-11-10 12:21:53 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2015-11-10 12:21:53 +0000 |
commit | 9ca55abe78d36fc1adffa80328464ae4ca176db0 (patch) | |
tree | 382613f20c9a3e0f269ee2c4e4f2988d8ca23ac1 | |
parent | 5c09bc57f90c436c55160e3a4e0f5765cdb651c5 (diff) |
#676: Activar automáticamente módulo para ZFS; detección correcta de ZPOOL y mostrar datos en tabla de configuración.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@4727 a21b9725-9963-47de-94b9-378ad31fedc9
-rwxr-xr-x | admin/Interface/getConfiguration | 4 | ||||
-rw-r--r-- | admin/WebConsole/includes/pintaParticiones.php | 4 | ||||
-rwxr-xr-x | client/engine/Disk.lib | 9 |
3 files changed, 11 insertions, 6 deletions
diff --git a/admin/Interface/getConfiguration b/admin/Interface/getConfiguration index fbed5a98..7a9636f2 100755 --- a/admin/Interface/getConfiguration +++ b/admin/Interface/getConfiguration @@ -18,6 +18,7 @@ for ((dsk=1; dsk<=$disks; dsk++)); do MSDOS) ptt=1 ;; GPT) ptt=2 ;; LVM) ptt=3 ;; + ZPOOL) ptt=4 ;; *) ptt=0 ;; esac # Información de disco (partición 0) @@ -38,7 +39,8 @@ for ((dsk=1; dsk<=$disks; dsk++)); do *) soi=$(getOsVersion $dsk $par 2>/dev/null | cut -f2 -d:) # Sistema de archivos para datos (sistema operativo "DATA") [ -z "$soi" -a "$fsi" != "EMPTY" -a "$fsi" != "CACHE" ] && soi="DATA" - uso=$(df $(ogDiskToDev $dsk $par) | awk '{getline; printf "%d",$5}') + # Obtener porcentaje de uso. + uso=$(df $(ogMountPoint $dsk $par) | awk '{getline; printf "%d",$5}') uso=${uso:0} ;; esac diff --git a/admin/WebConsole/includes/pintaParticiones.php b/admin/WebConsole/includes/pintaParticiones.php index c209fffb..02379df7 100644 --- a/admin/WebConsole/includes/pintaParticiones.php +++ b/admin/WebConsole/includes/pintaParticiones.php @@ -87,6 +87,8 @@ function pintaParticiones($cmd,$configuraciones,$idordenadores,$cc) break; case 3: $disktable[$tbKeys[$k]["numdisk"]] = "LVM"; break; + case 4: $disktable[$tbKeys[$k]["numdisk"]] = "ZPOOL"; + break; default: $disktable[$tbKeys[$k]["numdisk"]] = ""; } } @@ -94,7 +96,7 @@ function pintaParticiones($cmd,$configuraciones,$idordenadores,$cc) echo'<tr height="16">'.chr(13); echo'<td align="center"> </td>'.chr(13); echo'<td align="center">'.$tbKeys[$k]["numpar"].'</td>'.chr(13); - if ($disktable[$tbKeys[$k]["numdisk"]] == "LVM") { + if ($disktable[$tbKeys[$k]["numdisk"]] == "LVM" or $disktable[$tbKeys[$k]["numdisk"]] == "ZPOOL") { echo '<td></td>'.chr(13); } else { diff --git a/client/engine/Disk.lib b/client/engine/Disk.lib index f88b15e0..954715ac 100755 --- a/client/engine/Disk.lib +++ b/client/engine/Disk.lib @@ -683,7 +683,7 @@ fi # Comprobar que el disco existe y listar su partición activa. DISK="$(ogDiskToDev $1)" || return $? -parted $DISK print 2>/dev/null | awk '/boot/ {print $1}' +LANG=C parted -sm $DISK print 2>/dev/null | awk -F: '$7~/boot/ {print $1}' } @@ -826,7 +826,8 @@ case "$(ogGetPartitionTableType $1)" in GPT) grep -c "${DISK#/dev/}." /proc/partitions ;; MSDOS) sfdisk -l $DISK 2>/dev/null | grep -c "^$DISK" ;; LVM) lvs --noheadings $DISK 2>/dev/null | wc -l ;; - ZPOOL) zpool import -f -R /mnt -N -a 2>/dev/null + ZPOOL) zpool list &>/dev/null || modprobe zfs + zpool import -f -R /mnt -N -a 2>/dev/null zfs list -Hp -o name,canmount,mountpoint -r $(blkid -s LABEL -o value $DISK) | \ awk '$2=="on" && $3!="none" {c++} END {print c}' @@ -871,11 +872,11 @@ fi DISK=$(ogDiskToDev $1) || return $? # Comprobar tabla de particiones. -[ -b $DISK ] && TYPE=$(parted -sm $DISK print | awk -F: -v D=$DISK '{ if($1 == D) print toupper($6)}') +[ -b $DISK ] && TYPE=$(parted -sm $DISK print 2>/dev/null | awk -F: -v D=$DISK '{ if($1 == D) print toupper($6)}') # Comprobar si es volumen lógico. [ -d $DISK ] && vgs $DISK &>/dev/null && TYPE="LVM" # Comprobar si es pool de ZFS. -[ -z "$TYPE" ] && [ -n "$(blkid -s TYPE $DISK | grep zfs)" ] && TYPE="ZPOOL" +[ -z "$TYPE" -o "$TYPE" == "UNKNOWN" ] && [ -n "$(blkid -s TYPE $DISK | grep zfs)" ] && TYPE="ZPOOL" # Mostrar salida. [ -n "$TYPE" ] && echo "$TYPE" |