diff options
author | irina <irinagomez@us.es> | 2016-08-02 09:43:37 +0000 |
---|---|---|
committer | irina <irinagomez@us.es> | 2016-08-02 09:43:37 +0000 |
commit | d3a25abb828de7c1e8aabec895706cec976200af (patch) | |
tree | 016a9282dfed439d836179105b64ce00a75738ff /client/engine/Disk.lib | |
parent | b67022711118f620de603db8834b122b48b82440 (diff) |
#735 ogCreatePartitions: para discos con sector IO mínimo de 4K, cambia el inicio de la primera partición a 4096
git-svn-id: https://opengnsys.es/svn/branches/version1.1@4989 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/engine/Disk.lib')
-rwxr-xr-x | client/engine/Disk.lib | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/client/engine/Disk.lib b/client/engine/Disk.lib index cadbcdd5..4c18647b 100755 --- a/client/engine/Disk.lib +++ b/client/engine/Disk.lib @@ -47,7 +47,7 @@ timeout -k 5s -s KILL 3s $(which parted) "$@" function ogCreatePartitions () { # Variables locales. -local ND DISK PTTYPE PART SECTORS START SIZE TYPE CACHEPART CACHESIZE EXTSTART EXTSIZE tmpsfdisk +local ND DISK PTTYPE PART SECTORS START SIZE TYPE CACHEPART IODISCO IOSIZE CACHESIZE EXTSTART EXTSIZE tmpsfdisk # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk str_parttype:int_partsize ..." \ @@ -74,8 +74,15 @@ SECTORS=$(ogGetLastSector $1) 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). -START=63 +IODISCO=$(ogDiskToDev $1) +IOSIZE=$(fdisk -l $IODISCO | awk '/I\/O/ {print $4}') +if [ "$IOSIZE" == "4096" ]; then + START=4096 +else + START=63 +fi PART=1 # Fichero temporal de entrada para "sfdisk" |