summaryrefslogtreecommitdiffstats
path: root/client
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
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')
-rwxr-xr-xclient/engine/Cache.lib2
-rwxr-xr-xclient/engine/Disk.lib7
2 files changed, 7 insertions, 2 deletions
diff --git a/client/engine/Cache.lib b/client/engine/Cache.lib
index 8f6c9663..0e7f51ef 100755
--- a/client/engine/Cache.lib
+++ b/client/engine/Cache.lib
@@ -87,7 +87,7 @@ SIZE=$[$SIZECACHE*2] # Tamaño en sectores de 512 B.
IOSIZE=$(fdisk -l $DISK | awk '/I\/O/ {print $4}')
if [ $IOSIZE -eq 4096 ]; then
END=$[$END-8192]
- START=$[END-SIZE-8192]
+ START=$[END-SIZE+2048-(END-SIZE)%2048]
else
START=$[END-SIZE+1]
fi
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