From 30fa5b494415c05d135f7b18e6eb44a48dbe2feb Mon Sep 17 00:00:00 2001 From: Juan Manuel Bardallo Date: Tue, 26 Mar 2019 12:04:01 +0100 Subject: #906 Operations with partitions and images support NVMe --- client/engine/Cache.lib | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'client/engine/Cache.lib') diff --git a/client/engine/Cache.lib b/client/engine/Cache.lib index 0e7f51ef..8565fe1c 100755 --- a/client/engine/Cache.lib +++ b/client/engine/Cache.lib @@ -81,6 +81,14 @@ esac TMPFILE=/tmp/sfdisk$$ DISK=$(ogDiskToDev $NDSK) || return $? + + # PATCH Para discos nvme la particion debe ser p1, p2, etc...en lugar de 1,2, sino falla sfdisk +NVME_PREFIX="" +if [[ $DISK == *"nvme"* ]]; then + NVME_PREFIX="p" +fi + + END=$[$(ogGetLastSector $NDSK 2>/dev/null)] # Sector final del disco. SIZE=$[$SIZECACHE*2] # Tamaño en sectores de 512 B. # Inicio partición cache según el disco tenga sectores de 4k o menores @@ -127,7 +135,7 @@ case "$(ogGetPartitionTableType $NDSK)" in # Salvamos la configuración de las particiones e incluimos la cache. trap "rm -f $TMPFILE" 1 2 3 9 15 sfdisk --dump $DISK | grep -v $DISK$PART > $TMPFILE - echo "$DISK$PART : start= $START, size= $SIZE, Id=$ID" >> $TMPFILE + echo "$DISK$NVME_PREFIX$PART : start= $START, size= $SIZE, Id=$ID" >> $TMPFILE # Ordenamos las líneas de los dispositivos UNIT=$(grep unit $TMPFILE) grep ^/dev $TMPFILE|sort -o $TMPFILE -- cgit v1.2.3-18-g5258