Gestión de Almacenamiento: Facultad de Ciencias de La Ingeniería

Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

4.

Gestión de
Almacenamiento
Facultad de Ciencias de la Ingeniería
Ingeniería Informática y Ciencias de la
Computación

Ing. Jonathan Carrillo


Quito, Mayo 2017

Operating System Concepts – 9th Edit9on Silberschatz, Galvin and Gagne ©2013
Contenido
 Estructuras de Almacenamiento
 Sistemas de Archivos
 Entrada/salida (I/O).
 Estructuras de Almacenamiento masivo

Operating System Concepts – 9th Edition 1.2 Silberschatz, Galvin and Gagne ©2013
File-System Structure
 File structure
 Logical storage unit
 Collection of related information
 File system resides on secondary storage (disks)
 Provided user interface to storage, mapping logical to physical
 Provides efficient and convenient access to disk by allowing
data to be stored, located retrieved easily
 Disk provides in-place rewrite and random access
 I/O transfers performed in blocks of sectors (usually 512
bytes)
 File control block – storage structure consisting of information
about a file
 Device driver controls the physical device
 File system organized into layers

Operating System Concepts – 9th Edition 1.3 Silberschatz, Galvin and Gagne ©2013
Layered File System

Operating System Concepts – 9th Edition 1.4 Silberschatz, Galvin and Gagne ©2013
File System Layers
 Device drivers manage I/O devices at the I/O control layer
 Given commands like “read drive1, cylinder 72, track 2, sector
10, into memory location 1060” outputs low-level hardware
specific commands to hardware controller
 Basic file system given command like “retrieve block 123”
translates to device driver
 Also manages memory buffers and caches (allocation, freeing,
replacement)
 Buffers hold data in transit
 Caches hold frequently used data
 File organization module understands files, logical address, and
physical blocks
 Translates logical block # to physical block #
 Manages free space, disk allocation

Operating System Concepts – 9th Edition 1.5 Silberschatz, Galvin and Gagne ©2013
File System Layers (Cont.)
 Logical file system manages metadata information
 Translates file name into file number, file handle, location by
maintaining file control blocks (inodes in UNIX)
 Directory management
 Protection
 Layering useful for reducing complexity and redundancy, but
adds overhead and can decrease performanceTranslates file
name into file number, file handle, location by maintaining file
control blocks (inodes in UNIX)
 Logical layers can be implemented by any coding method
according to OS designer

Operating System Concepts – 9th Edition 1.6 Silberschatz, Galvin and Gagne ©2013
File System Layers (Cont.)
 Many file systems, sometimes many within an operating
system
 Each with its own format (CD-ROM is ISO 9660; Unix has
UFS, FFS; Windows has FAT, FAT32, NTFS as well as
floppy, CD, DVD Blu-ray, Linux has more than 40 types,
with extended file system ext2 and ext3 leading; plus
distributed file systems, etc.)
 New ones still arriving – ZFS, GoogleFS, Oracle ASM,
FUSE

Operating System Concepts – 9th Edition 1.7 Silberschatz, Galvin and Gagne ©2013
File-System Implementation
 We have system calls at the API level, but how do we implement
their functions?
 On-disk and in-memory structures
 Boot control block contains info needed by system to boot OS
from that volume
 Needed if volume contains OS, usually first block of volume
 Volume control block (superblock, master file table) contains
volume details
 Total # of blocks, # of free blocks, block size, free block
pointers or array
 Directory structure organizes the files
 Names and inode numbers, master file table

Operating System Concepts – 9th Edition 1.8 Silberschatz, Galvin and Gagne ©2013
File-System Implementation (Cont.)
 Per-file File Control Block (FCB) contains many details about
the file
 inode number, permissions, size, dates
 NFTS stores into in master file table using relational DB
structures

Operating System Concepts – 9th Edition 1.9 Silberschatz, Galvin and Gagne ©2013
In-Memory File System Structures

 Mount table storing file system mounts, mount points, file


system types
 The following figure illustrates the necessary file system
structures provided by the operating systems
 Figure 12-3(a) refers to opening a file
 Figure 12-3(b) refers to reading a file
 Plus buffers hold data blocks from secondary storage
 Open returns a file handle for subsequent use
 Data from read eventually copied to specified user process
memory address

Operating System Concepts – 9th Edition 1.10 Silberschatz, Galvin and Gagne ©2013
In-Memory File System Structures

Operating System Concepts – 9th Edition 1.11 Silberschatz, Galvin and Gagne ©2013
Overview of Mass Storage Structure
 Magnetic disks provide bulk of secondary storage of modern computers
 Drives rotate at 60 to 250 times per second
 Transfer rate is rate at which data flow between drive and computer
 Positioning time (random-access time) is time to move disk arm to
desired cylinder (seek time) and time for desired sector to rotate
under the disk head (rotational latency)
 Head crash results from disk head making contact with the disk
surface -- That’s bad
 Disks can be removable
 Drive attached to computer via I/O bus
 Busses vary, including EIDE, ATA, SATA, USB, Fibre Channel,
SCSI, SAS, Firewire
 Host controller in computer uses bus to talk to disk controller built
into drive or storage array

Operating System Concepts – 9th Edition 1.12 Silberschatz, Galvin and Gagne ©2013
Moving-head Disk Mechanism

Operating System Concepts – 9th Edition 1.13 Silberschatz, Galvin and Gagne ©2013
Hard Disks
 Platters range from .85” to 14” (historically)
 Commonly 3.5”, 2.5”, and 1.8”
 Range from 30GB to 3TB per drive
 Performance
 Transfer Rate – theoretical – 6 Gb/sec
 Effective Transfer Rate – real –
1Gb/sec
 Seek time from 3ms to 12ms – 9ms
common for desktop drives
 Average seek time measured or
calculated based on 1/3 of tracks
 Latency based on spindle speed
 1 / (RPM / 60) = 60 / RPM
 Average latency = ½ latency

Operating System Concepts – 9th Edition 1.14 Silberschatz, Galvin and Gagne ©2013
Hard Disk Performance
 Access Latency = Average access time = average seek time +
average latency
 For fastest disk 3ms + 2ms = 5ms
 For slow disk 9ms + 5.56ms = 14.56ms
 Average I/O time = average access time + (amount to transfer /
transfer rate) + controller overhead
 For example to transfer a 4KB block on a 7200 RPM disk with a
5ms average seek time, 1Gb/sec transfer rate with a .1ms
controller overhead =
 5ms + 4.17ms + 0.1ms + transfer time =
 Transfer time = 4KB / 1Gb/s * 8Gb / GB * 1GB / 10242KB =
32 / (10242) = 0.031 ms
 Average I/O time for 4KB block = 9.27ms + .031ms =
9.301ms

Operating System Concepts – 9th Edition 1.15 Silberschatz, Galvin and Gagne ©2013
The First Commercial Disk Drive

1956
IBM RAMDAC computer
included the IBM Model
350 disk storage system

5M (7 bit) characters
50 x 24” platters
Access time = < 1 second

Operating System Concepts – 9th Edition 1.16 Silberschatz, Galvin and Gagne ©2013
Solid-State Drive
 Nonvolatile memory used like a hard drive
 Many technology variations
 Can be more reliable than HDDs
 More expensive per MB
 Maybe have shorter life span
 Less capacity
 But much faster
 Busses can be too slow -> connect directly to PCI for example
 No moving parts, so no seek time or rotational latency

Operating System Concepts – 9th Edition 1.17 Silberschatz, Galvin and Gagne ©2013
Magnetic Tape
 Was early secondary-storage medium
 Evolved from open spools to cartridges
 Relatively permanent and holds large quantities of data
 Access time slow
 Random access ~1000 times slower than disk
 Mainly used for backup, storage of infrequently-used data,
transfer medium between systems
 Kept in spool and wound or rewound past read-write head
 Once data under head, transfer rates comparable to disk
 140MB/sec and greater
 200GB to 1.5TB typical storage
 Common technologies are LTO-{3,4,5} and T10000

Operating System Concepts – 9th Edition 1.18 Silberschatz, Galvin and Gagne ©2013
Disk Structure
 Disk drives are addressed as large 1-dimensional arrays of logical
blocks, where the logical block is the smallest unit of transfer
 Low-level formatting creates logical blocks on physical media
 The 1-dimensional array of logical blocks is mapped into the
sectors of the disk sequentially
 Sector 0 is the first sector of the first track on the outermost
cylinder
 Mapping proceeds in order through that track, then the rest of
the tracks in that cylinder, and then through the rest of the
cylinders from outermost to innermost
 Logical to physical address should be easy
 Except for bad sectors
 Non-constant # of sectors per track via constant angular
velocity

Operating System Concepts – 9th Edition 1.19 Silberschatz, Galvin and Gagne ©2013
Disk Attachment
 Host-attached storage accessed through I/O ports talking to I/O
busses
 SCSI itself is a bus, up to 16 devices on one cable, SCSI initiator
requests operation and SCSI targets perform tasks
 Each target can have up to 8 logical units (disks attached to
device controller)
 FC is high-speed serial architecture
 Can be switched fabric with 24-bit address space – the basis of
storage area networks (SANs) in which many hosts attach to
many storage units
 I/O directed to bus ID, device ID, logical unit (LUN)

Operating System Concepts – 9th Edition 1.20 Silberschatz, Galvin and Gagne ©2013
Storage Array
 Can just attach disks, or arrays of disks
 Storage Array has controller(s), provides features to attached
host(s)
 Ports to connect hosts to array
 Memory, controlling software (sometimes NVRAM, etc)
 A few to thousands of disks
 RAID, hot spares, hot swap (discussed later)
 Shared storage -> more efficiency
 Features found in some file systems
 Snaphots, clones, thin provisioning, replication,
deduplication, etc

Operating System Concepts – 9th Edition 1.21 Silberschatz, Galvin and Gagne ©2013
Disk Management
 Low-level formatting, or physical formatting — Dividing a disk into
sectors that the disk controller can read and write
 Each sector can hold header information, plus data, plus error
correction code (ECC)
 Usually 512 bytes of data but can be selectable
 To use a disk to hold files, the operating system still needs to record its
own data structures on the disk
 Partition the disk into one or more groups of cylinders, each treated
as a logical disk
 Logical formatting or “making a file system”
 To increase efficiency most file systems group blocks into clusters
 Disk I/O done in blocks
 File I/O done in clusters

Operating System Concepts – 9th Edition 1.22 Silberschatz, Galvin and Gagne ©2013
Disk Management (Cont.)

 Raw disk access for apps that want to do their own block
management, keep OS out of the way (databases for example)
 Boot block initializes system
 The bootstrap is stored in ROM
 Bootstrap loader program stored in boot blocks of boot
partition
 Methods such as sector sparing used to handle bad blocks

Operating System Concepts – 9th Edition 1.23 Silberschatz, Galvin and Gagne ©2013
Booting from a Disk in Windows
ROM

El código de boot es
ejecutado en ROM,
este trae el MBR a
memoria y empieza a
ejecutarlo .

Ejecuta el MBR,
verifica la tabla de
Boot Block
particionamiento,
trae y ejecuta el boot Kernel
partition.

El código de boot en
el bloque de boot
carga el kernel que
está en esa partición

Operating System Concepts – 9th Edition 1.24 Silberschatz, Galvin and Gagne ©2013
Swap-Space Management

 Swap-space — Virtual memory uses disk space as an extension of main memory


 Less common now due to memory capacity increases
 Swap-space can be carved out of the normal file system, or, more commonly, it
can be in a separate disk partition (raw)
 Swap-space management
 4.3BSD allocates swap space when process starts; holds text segment (the
program) and data segment
 Kernel uses swap maps to track swap-space use
 Solaris 2 allocates swap space only when a dirty page is forced out of
physical memory, not when the virtual memory page is first created
 File data written to swap space until write to file system requested
 Other dirty pages go to swap space due to no other home
 Text segment pages thrown out and reread from the file system as
needed
 What if a system runs out of swap space?
 Some systems allow multiple swap spaces

Operating System Concepts – 9th Edition 1.25 Silberschatz, Galvin and Gagne ©2013
Verificación de la Integridad

 En el caso de MS-DOS y Windows, como ya se vio, estos


programas son CHKDSK, SCANDISK, DEFRAG; en los
sistemas Unix, el programa general se llama fsck, y
típicamente emplea a asistentes según el tipo de sistema a
revisar—fsck.vfat, fsck.ext2, etc.
 Estos programas hacen un barrido del sistema de archivos,
buscando evidencias de inconsistencia.

Operating System Concepts – 9th Edition 1.26 Silberschatz, Galvin and Gagne ©2013
Verificación de la Integridad

Operating System Concepts – 9th Edition 1.27 Silberschatz, Galvin and Gagne ©2013
Verificación de la Integridad

Operating System Concepts – 9th Edition 1.28 Silberschatz, Galvin and Gagne ©2013
Verificación de la Integridad

Operating System Concepts – 9th Edition 1.29 Silberschatz, Galvin and Gagne ©2013
Verificación de la Integridad

Operating System Concepts – 9th Edition 1.30 Silberschatz, Galvin and Gagne ©2013
Verificación de la Integridad

Operating System Concepts – 9th Edition 1.31 Silberschatz, Galvin and Gagne ©2013
Entrada/ Salida I/O

CPU Memoria I/O

controlador

Arquitectura de bus dual

Operating System Concepts – 9th Edition 1.32 Silberschatz, Galvin and Gagne ©2013
Entrada/ Salida I/O

Aplicaciones APP Esto obedece a la


necesidad de los
múltiples
SOFTWARE SISTEMA OPERATIVO fabricantes de
dispositivos de
KERNEL E/S de generar
Código específico para
controlar ellos mismos los
(DRIVER) Driver para sus
Objetivo de los dispositivos
fabricantes:
Cargar el Electrónica del Dispositivo
controlador de (CONTROLADOR )
manera dinámica HARDWARE
en el sistema HW
durante su
ejecución (Mecánica)

Operating System Concepts – 9th Edition 1.33 Silberschatz, Galvin and Gagne ©2013
Almacenamiento Masivo

 RAID Redundant Arrays of Independent Disk


 Para abordar los problemas de rendimiento y de fiabilidad de los
datos (recuperabilidad, tolerancia a fallos) es indispensable
operaciones de recuperación y modificación.
 Si se produce un fallo, RAID mantiene el servidor activo y en
operación hasta que se sustituya la unidad defectuosa.
 Algunas averías/fallos de los discos magnéticos:

Operating System Concepts – 9th Edition 1.34 Silberschatz, Galvin and Gagne ©2013
Almacenamiento Masivo

 RAID Redundant Arrays of Independent Disk


 El controlador RAID permite que un arreglo de discos se muestre al
DBMS como un disco único muy grande. Para obtener un alto
desempeño, el controlador RAID puede controlar hasta 90 discos.

Operating System Concepts – 9th Edition 1.35 Silberschatz, Galvin and Gagne ©2013
Almacenamiento Masivo

 RAID Redundant Arrays of Independent Disk


 La probabilidad de fallos disminuye conforme aumenta el número de
discos.

Operating System Concepts – 9th Edition 1.36 Silberschatz, Galvin and Gagne ©2013
Almacenamiento Masivo

 RAID Redundant Arrays of Independent Disk

Operating System Concepts – 9th Edition 1.37 Silberschatz, Galvin and Gagne ©2013
Almacenamiento Masivo

 RAID Redundant Arrays of Independent Disk


 RAID ofrece un mejor el rendimiento R/W tomando en cuenta el tipo
RAID.

Operating System Concepts – 9th Edition 1.38 Silberschatz, Galvin and Gagne ©2013
Almacenamiento Masivo

 Network Attached Storage (almacenamiento conectado en red)


 Es el nombre dado a una tecnología de almacenamiento dedicada a
compartir la capacidad de almacenamiento conectado a una red
(normalmente TCP/IP) que permite almacenar y ubicar los datos en
un punto centralizado para usuarios autorizados de la red y
multiplicidad de clientes, haciendo uso de un Sistema Operativo
optimizado para dar acceso con los protocolos CIFS, NFS, FTP o
TFTP

Operating System Concepts – 9th Edition 1.39 Silberschatz, Galvin and Gagne ©2013
Almacenamiento Masivo
 Storage Area Network SAN
 Es una red de almacenamiento específica basada en tecnología Fiber
Channel, que permite conectar diferentes servidores a un sistema de
almacenamiento donde residen los datos. Esta agrupa los siguientes
elementos.
 (1) Una red de alta velocidad de canal de fibra (2) Un equipo de
interconexión dedicado (conmutadores, puentes, etc.)
(3)Elementos de almacenamiento de red (discos duros)

Operating System Concepts – 9th Edition 1.40 Silberschatz, Galvin and Gagne ©2013
Almacenamiento Masivo

 Tiered Storage
 Se refiere al almacenamiento de información por niveles.
 Tiered Storage es un sistema de almacenamiento de datos que
consta de dos o más tipos de medios de almacenamiento; estos
pueden ser unidades de discos duros, discos ópticos, RAID, unidades
de estado sólido y unidades de cinta magnética.
 El tipo de medio utilizado para almacenar una categoría de datos está
determinado por varios factores, incluidos el costo de los medios, los
requisitos de disponibilidad de datos, la capacidad de recuperación de
datos, etc.

Operating System Concepts – 9th Edition 1.41 Silberschatz, Galvin and Gagne ©2013
Almacenamiento Masivo

 Tiered Storage

Operating System Concepts – 9th Edition 1.42 Silberschatz, Galvin and Gagne ©2013
Almacenamiento Masivo

 JBOD
 JBOD es el acrónimo de Just a Bunch of Disks (“sólo un montón-de-
discos”)
 En esta configuración, cada unidad se considera un dispositivo
independiente. Todos los discos aparecerán en el ordenador como
discos duros individuales, divididos en las particiones creadas por la
utilidad de gestión de discos del sistema operativo, es decir, los
discos se presentan como si estuvieran conectados directamente en
los discos internos y son usados para aumentar la capacidad de
almacenamiento de conexión directa de los servidores de archivos.

Operating System Concepts – 9th Edition 1.43 Silberschatz, Galvin and Gagne ©2013

You might also like