0% found this document useful (0 votes)
59 views20 pages

GROUP 18 - Storage Device Management

Uploaded by

Innocent mugume
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views20 pages

GROUP 18 - Storage Device Management

Uploaded by

Innocent mugume
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

BANADDA MUBARAKA 2000705769

GROUP 18
20/U/5769/PS
OTHIENO BENEDICT ERNEST 2000708078 20/U/8078/Eve
SSEMBATYA DAVID 2000705693 20/U/5693/EVE
MUKISA SAMUEL OWEKITIIBWA 2000705673 20/U/5673/EVE
MUWANGUZI CYRUS 2000705723 20/U/5723/PS
STORAGE DEVICE MANAGEMENT
Storage Device Management

The operating system is responsible for several aspects of storage device


management.
These include:-
1. Drive Initialization
2. Booting from a drive
3. Bad block recovery
Drive Initialization

Drive initialization involves:-


a) drive formatting
b) Partitioning
c) volume creation and management
d) logical formatting
Drive Formatting

Before a storage device can store data, it must be divided into sectors that the
controller can read and write, the NVM pages must be initialized and FTL created
in a process called low-level formatting/ Physical formatting.
NVM (Non Volatile Memory): is a semiconductor technology that does not require
a continuous power supply to retain the data or program code stored in a
computing device. 
FTL(Flash Translation Layer): is software that lets an operating system read and
write flash-based storage modules as if they were rotating disk drives.
Low-Level Formatting –is the process of outlining the positions of the tracks and
sectors on the hard disk, and writing the control structures that define where the
tracks and sectors are. This is often called a "true" formatting operation, because it
really creates the physical format that defines where the data is stored on the disk.
The data/control structure consists of the header, data area and trailer. The header
and trailer contain information used by the controller such as sector/page number
and error detection/ correction code.
Data structures enable OS to:-
• Manage the space on the disk
• Keep track of files
• Manage defective areas so they don’t cause problems.

Most drive are low-level formatted at factory as part of the


manufacturing process. This helps the manufacturer to initialize
mapping from logical block numbers to defect-free sectors or pages
on the media
Creating Operating System Data
Structures
Before the we can use a drive to hold files, the operating system needs to
record it’s own data structures on the drive. And it does this in three
steps:-
1. Partitioning.
2. Volume creation and management.
3. Logical formatting.
Step 1: Partition

The involves partitioning the drive into one or more groups of blocks or
pages. The OS can then treat each partition as though It were a separate
device.
Creating a partition on a hard drive enables it to support separate file
systems, each in its own partition and each file system can then use its
own method to allocate file space in logical units called clusters or
allocation units.
Some OSes and file systems perform the partitioning automatically when
the entire device is to be managed by the file system.
The partition information is written in a fixed format at a fixed location on a
storage device.
The device, when recognized by the operating system, has its partition
information read, and the operating system then creates device entries
for the partitions.

From there, a configuration file, such as /etc/fstab, tells the operating


system to mount each partition containing a file system at a specified
location and to use mount options such as read-only.

Mounting a file system is making the file system available for use by the
system and its users.
Step 2: Volume Creation and
Management
Sometime this step is implicit:- when a file is placed directly within a partition, that volume is
then ready to be mounted and used.
Other time the step is explicit:- for example when multiple partitions or devices are used
together as a RAID set, with one or more file systems spread across the devices.
Step 3: Logical Formatting

In this step, the OS stores the initial file system data structure onto the
device.
The data structure may include maps of free and allocated space, an initial
empty directory.
The partition information also indicates if a partition contains a bootable
file system (containing the operating system). The partition labeled for boot
is used to establish the root of the file system and once it is mounted,
device links for all other devices and their partitions can be created.
A computer’s file system mainly consists of all mounted volumes; For
example on Windows, these are separately named via a letter (C:, D:, E:).
On Windows, the file system interface makes it clear when a given device is being used.
Figure shows the Windows 7 Disk Management tool displaying three volumes (C:, E:, and F:).
Note that E: and F: are each in a partition of the “Disk 1” device and that there is unallocated
space on that device for more partitions
To increase efficiency, most file systems group blocks together into larger chunks, frequently
called clusters.

Device I/O is done via blocks, but file system I/O is done via clusters, effectively assuring that
I/O has more sequential-access and fewer random-access characteristics.

File systems try to group file contents near its metadata as well, reducing HDD head seeks
when operating on a file.
Boot Block(Booting From a drive)

For a computer to start running(when powered up or rebooted), it must


have an initial program to run(Bootstrap Loader).
The program is stored in NVM flash memory firmware on the system
motherboard and mapped to a known memory location.
The program initializes all aspects of the system from CPU registers, to
device controller and contents of main memory. It also calls the full
Bootstrap program stored in the boot blocks at a fixed location on the
device.
A device that has a boot partition is called a boot disk or system disk.
The code in the bootstrap NVM instructs the storage controller to read the boot blocks into
memory (no device drivers are loaded at this point) and then starts executing that code. The full
bootstrap program is more sophisticated than the bootstrap loader: it is able to load the entire
operating system from a non-fixed location on the device and to start the operating system
running.

Consider boot process in Windows which allows a drive to be divided into partitions, and one
partition— identified as the boot partition—contains the operating system and device drivers. The
Windows system places its boot code in the first logical block on the hard disk or first page of the
NVM device, which it terms the master boot record, or MBR.
Booting begins by running code that is resident in the system’s firmware. This code directs the system to
read the boot code from the MBR, understanding just enough about the storage controller and storage
device to load a sector from it.

In addition to containing boot code, the MBR contains a table listing the partitions for the drive and a flag
indicating which partition the system is to be booted from.

Once the system identifies the boot partition, it reads the first sector/page from that partition (called the
boot sector), which directs it to the kernel. It then continues with the remainder of the boot process, which
includes loading the various subsystems and system services.
Bad Blocks Recovery
Because disks have moving parts and small tolerances, they are prone to failure.
Sometimes the failure is complete; in that, the disk needs to be replaced and its contents
restored from backup media to the new disk.
Depending on the disk and controller in use, these blocks are handled in a variety of ways.
1. Manual Handling
2. Sector sparing / forwarding
3. Sector slipping.
Manual Handling

On older disks, such as some disks with IDE controllers, bad blocks are
handled manually.
One strategy is to scan the disk to find bad blocks while the disk is being
formatted. Any bad blocks that are discovered are flagged as unusable so
that the file system does not allocate them.
If blocks go bad during normal operation, a special program (such as the
Linux badblocks command) must be run manually to search for the bad
blocks and to lock them away.
Data that resided on the bad blocks usually are lost.
Sector sparing / forwarding
More sophisticated disks are smarter about bad-block recovery.
The controller maintains a list of bad blocks on the disk. The list is initialized during the low-
level formatting at the factory and is updated over the life of the disk.
Low-level formatting also sets aside spare sectors not visible to the operating system. The
controller can be told to replace each bad sector logically with one of the spare sectors.
Sector slipping

As an alternative to sector sparing, some controllers can be instructed to


replace a bad block by sector slipping.
For example: Suppose that logical block 17 becomes defective and the
first available spare follows sector 202. Sector slipping then remaps all the
sectors from 17 to 202, moving them all down one spot.
That is, sector 202 is copied into the spare, then sector 201 into 202, then
200 into 201, and so on, until sector 18 is copied into sector 19. Slipping
the sectors in this way frees up the space of sector 18 so that sector 17
can be mapped to it.

You might also like