



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Hard Disk Drives
TCSS 422: OPERATING SYSTEMS Chapter 37 HDD Internals Seek time Rotational latency Transfer speed Capacity Scheduling algorithms June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Primary means of data storage (persistence) for decades Consists of a large number of data sectors Sector size is 512-bytes An n sector HDD can be is addressed as an array of 0..n-1 sectors June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Writing disk sectors is atomic (512 bytes) Sector writes are completely successful, or fail Many file systems will read/write 4KB at a time Linux ext3/4 default filesystem blocksize – 4096
June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Specify the bytes/inode ratio. mke2fs creates an inode for every bytes-per-inode bytes of space on the disk. The larger the bytes-per-inode ratio, the fewer inodes will be created. This value generally shouldn't be smaller than the blocksize of the filesystem, since in that case more inodes would be made than can ever be used. Be warned that it is not possible to expand the number of inodes on a filesystem after it is created, so be careful deciding the correct value for this parameter. June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Host ~2,000,000 files totaling 9.5 GB on a ~20GB filesystem on a cloud-based Virtual Machine With default inode ratio (4096 block size), only ~488,000 files will fit Drive less than half full, but files will not fit! HDDs support a minimum block size of 512 bytes OS filesystems such as ext3/ext4 can support “finer grained” management at the expense of a larger catalog size June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Device total size bytes- used bytes- free usage /dev/vda2 13315844 9556412 3049188 76% /mnt
Device total inodes used free usage /dev/vda2 3552528 1999823 1552705 57% /mnt June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Torn write When OS uses larger block size than HDD Block writes not atomic - they SPAN multiple HDD sectores Upon power failure only a portion of the OS block is written HDD access Sequential reads of sectors is fastest Random sector reads are slow Disk head continuously must jump to different tracks June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Made from aluminum coated with thin magnetic layer HDD records on both sides of each platter Data is stored by inducing magnetic changes June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Connected to motor which spins the disk Speed measures in RPM (rotations per minute) Typical: 7200-15000 rpm 10000 rpm – 1 rotation in 6ms; 15k rpm 1 rotation in 4ms
June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Outer tracks have More sectors Single track disk Head: one per surface of drive Arm: moves heads across surface of platters June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Buffer to support caching reads and writes Improves drive response time Up to 128 MB, slowly have been growing Two styles Writeback cache Report write complete immediately when data is transferred to HDD cache Dangerous Writethrough cache Reports write complete only when write is physically completed on disk June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
I/O Time The rate of I/O June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Random workload: 4KB random read on HDD Sequential workload: read 100MB contiguous sectors June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
There is a huge gap in drive throughput between random and sequential workloads See sample HDD configurations here: https://www.hgst.com/products/hard-drives June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Disk scheduler: determine how to order I/O requests Multiple levels - OS and HW OS: provides ordering HW: further optimizes using intricate details of physical HDD implementation and state June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Disk scheduling – which I/O request to schedule next Shortest Seek Time First (SSTF) Order queue of I/O requests by nearest track June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
Problem 1: HDD abstraction Drive geometry not available to OS. Nearest-block-first is a comparable alternate algorithm. Problem 2: Starvation Steady stream of requests for local tracks may prevent arm from traversing to other side of platter June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
SWEEP Single repeated passes across disk Issue: if request arrives for a recently visited track it will not be revisited until a full cycle completes F -SCAN Freeze request queue during sweep Cache arriving requests until later Elevator (C-SCAN) – circular scan Sweep from outer to inner track and reverse, inner to outer track, etc. June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
On modern drives, both seek and rotation are roughly equivalent: Thus, SPTF (Shortest Positioning Time First) is useful.
June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.
June 1, 2017 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L18.