diff options
-rwxr-xr-x | client/engine/Cache.lib | 2 | ||||
-rwxr-xr-x | client/engine/Disk.lib | 7 |
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 |