[go: up one dir, main page]

0% found this document useful (0 votes)
1 views28 pages

LEC 4

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 28

OF Files Systems and Storage

Models
What is File System?
• A file system is a process that manages how and where data on a
storage disk, typically a hard disk drive (HDD), is stored, accessed
and managed.
• It is a logical disk component that manages a disk's internal
operations as it relates to a computer and is abstract to a human
user.
• A file system stores and organizes data and can be thought of as a
type of index for all the data contained in a storage device. These
devices can include hard drives, optical drives and flash drives.
Types of file systems
• File allocation table (FAT) is supported by the Microsoft Windows OS. FAT is considered
simple and reliable, and it is modeled after legacy file systems. FAT was designed in
1977 for floppy disks, but was later adapted for hard disks.
• Global file system (GFS) is a file system for the Linux OS, and it is a shared disk file
system. GFS offers direct access to shared block storage and can be used as a local file
system.
• GFS2 is an updated version with features not included in the original GFS, such as an
updated metadata system. Under the terms of the GNU General Public License, both
the GFS and GFS2 file systems are available as free software.
• Hierarchical file system (HFS) was developed for use with Mac operating systems. HFS
can also be referred to as Mac OS Standard, and it was succeeded by Mac OS Extended.
Originally introduced in 1985 for floppy and hard disks, HFS replaced the original
Macintosh file system. It can also be used on CD-ROMs.
• The NT file system -- also known as the New Technology File
System (NTFS) -- is the default file system for Windows
products from Windows NT 3.1 OS onward. Improvements
from the previous FAT file system include better metadata
support, performance and use of disk space. NTFS is also
supported in the Linux OS through a free, open-source NTFS
driver. Mac OSes have read-only support for NTFS.
• Universal Disk Format (UDF) is a vendor-neutral file system
used on optical media and DVDs. UDF replaces the ISO 9660
file system and is the official file system for DVD video and
audio as chosen by the DVD Forum.
Storage Models
• Online storage (Cloud Storage). Online data storage is one of the safest and
most secure options. World-class data security protocols protect your
information, and redundant systems make sure that, even if a particular piece
of hardware at the online storage provider fails, your data is safe and secure.
• Hard Disk Drives (HDD) - The hard disk drive (HDD) is
the original hard drive. These are magnetic storage
devices that have been around since the 1950s,
though they’ve evolved over time.
• Magnetic tapes. In some instances, using magnetic tapes for
long-term data storage can be a good option. They don’t have
the same risk of becoming infected with a virus that a hard
drive will have.
• Solid-state drives emerged far more recently, in the ‘90s. SSDs don’t rely on
magnets and disks, instead they use a type of flash memory called NAND. In an
SSD, semiconductors store information by changing the electrical current of
circuits contained within the drive. This means that unlike HDDs, SSDs don’t
require moving parts to operate.
• Removable media. Other media, like USB devices, flash drives, SD cards,
DVDs and more can also be used to store data. Every one of these is highly
susceptible to theft, loss, and physical damage.
• Network storage. Network data storage is a step up from hard drive
storage. This is the process whereby you store data on a network device,
or on a server. The device or server will usually have some built-in
redundancy to protect it from failure. The obvious downside to network
storage is that, if the network isn’t accessible, neither is your data.
• CD-ROM, DVD-ROM, and BD-ROM refer to read-only optical storage disks.
The data written on them is permanent and cannot be removed or
overwritten. This is why they can't be used as a personal storage. Instead,
they are typically used for software installation programs.
• CD-R, DVD-R, and BD-R format disks are recordable, but cannot be
overwritten. Whatever data you save on a blank recordable disk will then
be permanently stored on that disk. So, they can store data, but they’re
not quite as flexible as other storage devices.
• CD-RW, DVD-RW, and BD-RE are re-writable. This allows you can to write new data
on them and erase unwanted data from them as much as you want. They’ve been
overtaken by newer technology like flash memory, but CD-RWs were once the top
choice for external storage. Most desktop computers and many laptops have a CD
or DVD drive.
Disk Device and Partition
• A hard disk consists of a set of stacked platters, each of
which has data stored electromagnetically in concentric
circles, or tracks.
• A hard disk drive controls the positioning, reading, and
writing of the hard disk. Note that the heads of all
platters are positioned as a unit.
PARTS OF A DISK DRIVE
• Platter: The physical media where data is stored in a disk drive is called
a platter. Disk platters are rigid, thin circles that spin under the power of
the drive spindle motor.
• Spindle/Motor: The platters are attached at the center to a rod or pin
called a spindle that is directly attached to the shaft of the motor that
controls the speed of rotation.
• Read/Write Heads: Read/write heads read and write data to the
platters. When one head is over a track, all other heads are at the same
location over their respective surfaces. The read/write heads convert
the electronic 0s and 1s in the magnetic fields on the disks.
• Head-Actuator Assembly: All heads are attached to a single head actuator, or actuator
arm, that moves the heads around the platters.
• Logic Board: The platters, spindle, spindle motor, head actuator and the read/write
heads are all contained in a chamber called the head disk assembly (HDA). Outside of
the HDA is the logic board that controls the movements of the internal parts and
controls the movement of data into and out of the drive.
• Buffer Memory The mechanical nature of reading and writing data on rotating platters
limits the performance of disk drives to approximately three orders of magnitude ( 1000
times) less than the performance of data transfers to memory chips.
• Disk Controller - Disk drives all have internal target controllers that respond to
commands from host or subsystem initiators. In addition to interoperating with the
external initiator, the storage controller in a disk drive is responsible for executing the
command within the drive. The software component of a disk drive controller is
referred to as firmware and is typically stored in e-prom chips in the drive's circuit
board.
DIVIDING AND COMBINING DISKS
• The disk method is a slicing technique that creates cross
sections of a solid of revolution by slicing perpendicular
on the axis of rotation and calculating the volume of the
solid by adding the volumes of the infinitely many thin
cross-sections.
FILE SYSTEM LAYOUT
• File system implementation defines how files and directories are stored,
how disk space is managed, and how to make everything work efficiently
and reliably.
File Systems are stored on disks. The above figure depicts a possible File-System
Layout.
• MBR: Master Boot Record is used to boot the computer
• Partition Table: Partition table is present at the end of MBR. This table gives the
starting and ending addresses of each partition.
• Boot Block: When the computer is booted, the BIOS reads in and executes the
MBR. The first thing the MBR program does is locate the active partition, read in its
first block, which is called the boot block, and execute it. The program in the boot
block loads the operating system contained in that partition. Every partition
contains a boot block at the beginning though it does not contain a bootable
operating system.
• Super Block: It contains all the key parameters about the file system and is read
into memory when the computer is booted or the file system is first touched.
• A file system is a set of files, directories, and other structures. File
systems maintain information and identify where a file or
directory's data is located on the disk. Each file system occupies
one logical volume.
• Boot Block - The boot block occupies the first 4096 bytes of the
file system starting at byte offset 0 on the disk. The boot block is
available to start the operating system.
• Superblock - The superblock is 4096 bytes in size and
starts at byte offset 4096 on the disk. The super-
block maintains information about the entire file
system and includes the following fields:
– Size of the file system
– Number of data blocks in the file system
– A flag indicating the state of the file system
– Allocation group sizes
IMPLEMENTING FILES
• Contiguous Allocation: Each file is stored as a contiguous run of disk blocks.
• Linked List Allocation: The second method for storing files is to keep each one as a
linked list of disk blocks. The first word of each block is used as a pointer to the next
one. The rest of the block is for data. Unlike Contiguous allocation no space is lost in
disk fragmentation.
• Linked-List Allocation Using a Table in Memory: The disadvantage of linked list can be
overcome by taking the pointer word from each disk block and putting it in a table in
memory. Such a table in main memory is called a FAT (File Allocation Table). Using FAT
random access can be made much easier.
• I-nodes: I-node is a data structure which is used to identify which block belongs to
which file. It contains the attributes and disk addresses of the file's blocks. Unlike the in-
memory table the i-node need to be in memory only when the corresponding file is
open.
Implementing Directories
• The main function of the directory system is to map the ASCII
name of the file onto the information needed to locate the data.
• SHARED FILES - When several users are working together sharing
of files takes place. In such a case it is convenient for a file to
appear simultaneously in different directories belonging to
different users. Sharing files is convenient but also introduces
problems like if the original file or the shared file are appended
with new features then it will not be updated in both the copies
of the file, it is updated only at its original location.
• Log-Structured File Systems - A log-structured file system is a file
system in which data and metadata are written sequentially to a circular
buffer, called a log.
• Journaling File Systems - The basic idea here is to keep a log of what
the file system is going to do before it does it, so that if the system
crashes before it can do its planned work, upon rebooting the system
can look in the log to see what was going on at the time of the crash
and finish the job.
• Virtual File Systems are used to integrate multiple file systems into an
orderly structure. The key idea is to abstract out that part of the file
system that is common to all file systems and put that code in a
separate layer that calls the underlying concrete file system to actually
manage the data.
THE UNIX FILE SYSTEM
• Ordinary files – An ordinary file is a file on the system that
contains data, text, or program instructions.
• Directories – Directories store both special and ordinary files.
For users familiar with Windows or Mac OS, UNIX directories
are equivalent to folders. A directory file contains an entry for
every file and subdirectory that it houses. If you have 10 files
in a directory, there will be 10 entries in the directory. Each
entry has two components.
– The Filename
– A unique identification number for the file or directory
(called the inode number)
• Special Files – Used to represent a real physical device
such as a printer, tape drive or terminal, used for
Input/Output (I/O) operations. Device or special files are
used for device Input/Output(I/O) on UNIX and Linux
systems. They appear in a file system just like an ordinary
file or a directory.
• Pipes – UNIX allows you to link commands together using
a pipe. The pipe acts a temporary file which only exists to
hold data from one command until it is read by another.
A Unix pipe provides a one-way flow of data.
• Sockets – A Unix socket (or Inter-process
communication socket) is a special file which allows
for advanced inter-process communication. A Unix
Socket is used in a client-server application
framework. In essence, it is a stream of data, very
similar to network stream (and network sockets), but
all the transactions are local to the file system.
• Symbolic Link – Symbolic link is used for referencing
some other file of the file system. Symbolic link is also
known as Soft link. It contains a text form of the path
to the file it references. To an end user, symbolic link
will appear to have its own name, but when you try
reading or writing data to this file, it will instead
reference these operations to the file it points to. If
we delete the soft link itself , the data file would still
be there. If we delete the source file or move it to a
different location, symbolic file will not function
properly.

You might also like