summaryrefslogtreecommitdiffstats
path: root/client/engine/Disk.lib
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2018-09-25 18:07:49 +0200
committerRamón M. Gómez <ramongomez@us.es>2018-09-25 18:07:49 +0200
commit8076226512d306e652cfbf975661847172360c82 (patch)
tree6546dc80f57f2eefdb0463c94402dfeee41b902e /client/engine/Disk.lib
parent83d87a3903ddb91b682e176644988d4e65b7ec8e (diff)
#871: Dejar espacio libre entre particiones lógicas y alinear partición de caché en sector físico para discos con sectores de 4 KB.
Diffstat (limited to 'client/engine/Disk.lib')
-rwxr-xr-xclient/engine/Disk.lib7
1 files changed, 6 insertions, 1 deletions
diff --git a/client/engine/Disk.lib b/client/engine/Disk.lib
index e9b1992b..a7db9209 100755
--- a/client/engine/Disk.lib
+++ b/client/engine/Disk.lib
@@ -73,15 +73,17 @@ SECTORS=$(ogGetLastSector $1)
# Se recalcula el nº de sectores del disco 1, si existe partición de caché.
CACHEPART=$(ogFindCache 2>/dev/null)
[ "$ND" = "${CACHEPART% *}" ] && CACHESIZE=$(ogGetCacheSize 2>/dev/null | awk '{print $0*2}')
-[ -n "$CACHESIZE" ] && SECTORS=$[SECTORS-CACHESIZE]
# Sector de inicio (la partición 1 empieza en el sector 63).
IODISCO=$(ogDiskToDev $1)
IOSIZE=$(fdisk -l $IODISCO | awk '/I\/O/ {print $4}')
if [ "$IOSIZE" == "4096" ]; then
START=4096
+ SECTORS=$[SECTORS-8192]
+ [ -n "$CACHESIZE" ] && SECTORS=$[SECTORS-CACHESIZE+2048-(SECTORS-CACHESIZE)%2048-1]
else
START=63
+ [ -n "$CACHESIZE" ] && SECTORS=$[SECTORS-CACHESIZE]
fi
PART=1
@@ -127,6 +129,9 @@ while [ $# -gt 0 ]; do
# Error si se supera el nº total de sectores.
START=$[START+SIZE]
[ $START -le $SECTORS ] || ogRaiseError $OG_ERR_FORMAT "$[START/2] > $[SECTORS/2]" || return $?
+ if [ "$IOSIZE" == "4096" -a $PART -gt 4 ]; then
+ START=$[START+2048]
+ fi
PART=$[PART+1]
shift
done