Week 04 Journal Chapter 7 from A+ Textbook: Storage Devices - Hsanokklis/2022-2023-Tech-journal GitHub Wiki
Contiguous Allocation:
- The maximum size a file can be is determined when it is first created and cannot ever grow beyond this size.
Linked-List Allocation:
- Each file block on a disk is associated with a pointer to the next block
- Files can grow dynamically
- Blocks are not contiguous
- Unreliable, since missing a pointer can lead to loss of the remaining file
Segment-Based Allocation:
- Uses a segment table to assign multiple regions of contiguous blocks
- Permits contiguous allocation to reduce disk seek time
- Not as fast can contiguous allocation
Indexed Allocation:
- Uses a index to directly track the file block locations
- User declare maximum file size and the system will assign a file header with an array of pointers big enough to point to all file blocks
- Provides fast disk location lookups for RAM
- File blocks may be scattered all over the disk
- Does not have methods to ensure block groups stick together
Multilevel Indexed Allocation:
- Used by Linux OS
- Index entries point to index blocks and not data blocks
- Inverted Allocation:
- Allocates a disk block by hashing the file block content to a disk block location. (hashes are unique)
- Allows different file blocks of the same content to share the same disk block for storage.
_Summary: When programs are executed on a device, they must be in the main memory of the device. Ideally, programs would remain permanently in the main memory, but this isn’t possible due to the fact that main memory is volatile and its too small to hold all the programs and data._
Disk Structure: Disk provide a majority of secondary storage and they come in multi-platter disk pacts with these characteristics:
- Each platter is divided into several tracks
- Each track has several sectors
- Each platter has two surfaces
- A cylinder is a set of tracks, which are at the same track position on all disk surfaces
- Number of bytes/sector, tracks/platter and sector/track vary among disk types
- To access a sector you need to know the drive number, track/cylinder, surface and sector
- Sector is the smallest data section that can be read/written to on a block device
Disk Performance Parameters: _Disk drivers should have a fast access time and disk bandwidth _ Disk Bandwidth:
- Total number of bytes transferred, divided by the total time between the first request for services and the completion of the last transfer Access:
- read/write heads are moved to the correct track
- Electronically switched to the correct surface
- They wait for the correct sector to rotate beneath the heads
- No seek time is required when accessing tracks in the same cylinder Disk Space Management:
- Disks have a set block size
- File system allocates disk space by the block
- Allocating disk space by the block causes internal fragmentation
- Larger blocks = more fragmentation
- Smaller blocks = more disk work
- Concerns of efficient utilization of disk space and speed of access to files.
- There are 3 methods used for management(contiguous, chained, indexed)
Free Space List: Disk manager must keep track of a list of free space that happened when files are deleted(or created), the list can be kept track of in 3 ways:
-
Bitmap or Bit vector:
-
Each disk block = 1 bit
-
1 is occupied
-
0 is free
-
Make finding contiguous blocks of free memory easy
-
Can be very large for disk of todays size
-
Searching a bitmap can be really inefficient
-
Linked List:
-
A pointed points to the first free block which points to the next free block which keeps going until it points to null
-
Free sequence list:
-
Free disk blocks are in contiguous chunks so we only need to keep a pointer to the first free block of each sequence and record the number of blocks in the sequence.
Disk Space Allocation Methods: Contiguous Allocation:
- File is allocated contiguous disk blocks
- Each file, device directory contains the location of its starting block and the number of blocks
- Access is easy
- Finding space for a new file is complicated
- Size of file must be known(but cannot be known in advance, thus if it grows it can lead to internal fragmentation)
Chained(Linked) Allocation:
- Allows disk space to be allocated randomly
- Files space is a linked list of blocks (with pointers)
- Access is hard
- Only access in a sequence is possibly so accessing a random block would be hard
- Space used up by pointers is more than it needs to be
- There is a high probability of losing part of a file due to a corrupt pointer
Indexed Allocation:
- All of a file's block pointers are gathered together into its index block, an array of pointers to blocks stored on disk
- Access is easy, both sequential and direct access is possible
- Allocation is easy
- Solves external fragmentation
- No direct access to scattered block pointers
Storage Devices Overview _Summary: Storage devices hold all the data in our devices. Data such as PDFs, movies, word processing documents, spreadsheets, photos etc. All of that data is stored on optical media, flash media and magnetic media. _
Various Storage Devices
Cloud Storage: Data that is put in servers that can be accessed over the internet. The data is not necessarily on your device, which can free up room and make it easier to save files. Cloud servers are located in data centers all over the world Just a ton of hard drives, servers and other devices in a remote location somewhere ISP: Some storage is provided by your Internet service provider Companies: For work, people may store data in their companies storage servers Private companies such as Microsoft, Google, and Amazon have their own storage/cloud for people to store their data.
Hard Drive Overview Summary: Hard drives are storage devices that can be mounted inside or outside a computer. They store more data than flash drives and move data faster than tape drives. Modern hard drives have a storage capacity in terabytes.
Hard drive sizes: 5.25 inch and 3.5 inch: For desktop and small server models The 5.25 inch is not very popular 2.5 inch Designed for laptops and ultrabooks 1.8 inch Used for fs, ultrabooks, and ultraportable devices(MP3 players)
*Ultrabook is a marketing term for high-end laptop computers
Two different Hard Drive sizes
Tape drives: A device that stores computer data on magnetic tape. It stores data on a loop of flexible celluloid material(like a tape recorder)
Example of a tape drive https://www.techtarget.com/searchstorage/definition/tape-drive
External Attachment: A harddrive can be attached to a computer externally through the use of a USB, eSATA, eSATA, eSATAp, or IEEE 1394.
External hard drive enclosure
Solid State Drive Overview: _Summary: SSD’s are storage devices that use DRAM or nonvolatile flash memory instead of hard drive technologies. SSD’s get rid of the leading cause of hard drive failure: moving parts. SSD’s use flash memory, which means they are low heat producing, reliable, quiet, secure, long-lasting and fast. They can be installed internally or externally and they are common in mobile devices. They are also commonly used in places where there are temperature extremes. _
Industries use of SSD’s:
- Medical:
- CRT/MRI image storage
- Monitoring equipment
- Portable devices
- IT:
- Video surveillance
- Wireless base stations
- Security appliances
- Industrial:
- Robotics systems
- Test equipment
- Manufacturing devices
- Automotive:
- Diagnostics
- Store safety information
- Store travel statistics
Writing Data in an SSD:
- Difference between mechanical hard drives and SSDs is how data is written
- To write data SSD’s have to:
- Do an erase operation
- Move data to another location
- Write the information to memory
Write Amplification: Minimum amount of memory storage space affected by a write request Ex: 4KB of information is written on an SSD that has a 128KB erase block, 128KB must be erased before the 4KB of information can be written.
Wear Leveling: Technique used to erase and write data using all of the memory blocks instead of the same memory blocks repeatedly. There are a technologies used to do this: Software that tracks usage and direct write operations A certain amount of reserved memory blocks to use when a memory block fails A combination of the 2 previous techniques.
SSD Structure: Uses a structure called NAND 1 bit means there is no data stored in a location and 0 bit means there is data stored(for NAND) NAND flash memory retains data even when the device is powered off Used with SSDs are Single level memory cell(SLC) and multi-level memory cell(MLC)
Single level memory cell:
- Store 1 bit in each memory cell
- Last longer than MLC
- More expensive than MLC
- Multi-level memory cell:
- Store more than 1 bit in each memory cell
- Cheaper to make
- Slower transfer speeds
SSD drawbacks:
- Cost(expensive)
Hybrid SSD(SSHD):
- Combination of mechanical and flash technology
- Has flash memory integrated into mechanical drive
- Best of both worlds(lower cost, a lot of storage)
Hard Drive Interfaces Overview: _Summary: Hard drives run on a set of rules called an interface. The rules apply to: _
- Number of heads on a drive
- Commands drive responds to
- Cables used with drive
- Number of devices supported
- Number of data bits transferred at one time
- There are two major hard drive interfaces:
- Integrated drive electronics and Small Computer system Interface
Integrated Drive Electronics(IDE):
- Also known as AT attachments(ATA) or Enhanced IDE(EIDE)
- Most common in home and office computers
- Small Computer System Interface(SCSI):
- Most commonly found in network servers
External Interfaces:
- There are interfaces to attach external storage devices
- Flash drive, external hard drive attached to USB port
- IDE and SCSI architecture:
- Both started out as parallel architectures, which means multiple bits are sent over multiple paths.
- Requires precise timing and transfer rates increase
- Multiple devices can attach to the same bus
- Parallel IDE supports only two devices
- Parallel SCSI support more devices
_Parallel data transfer _
Serial architecture:
- IDE and SCSI have serial architecture options available
- Point to point bus where each device has a single connection back to the controller
- Bits sent one at a time over a single link
- More devices can attach to serial
Serial Data transfer
A photo of a parallel ATA cable and a Serial ATA cable
Hard Drive Preparation Overview(cluster, sector, cylinder): Summary: Once you install and configure a hard drive, the drive needs to be prepared to accept data which is done with hard drive preparation of partitioning the drive and high-level formatting the drive.
*A drive cannot be used on a computer until it has been partitioned and high level formatted
High Level formatting: Prepared drive to accept data from OS
Partitioning:
- Allows a drive letter to be assigned to one or more parts of the hard drive
- First step to preparing the drive
- Divides drive so computer sees it as more than one drive
- Each section gets a drive letter
A visual representation of drive partitioning
- Can be done during windows installation process
- Windows Disk management program is installed to manage disk partitions
- Diskpart can be used from the command prompt
- First hard drive is partitioned as part of windows installation, and additionally partitions are created using disk management.
Partitioning Advantages:
- Organizes drive into multiple sections such as operating system, applications and data
- Data security by placing data in a different partition as more accessible things
- Uses hard drive to its fullest capacity.
- Purpose of Partitioning(originally):
- Enable loading multiple OS’s
File system:
- Type of partition and how big it can be depends on the file system used
- Defines how data is stored on a drive
- Most common Windows file systems are FAT16, FAT32, exFAT, and NTFS
- File system that can be used depends on what operating system is installed, whether the device is internal or external, and whether files are shared.
List of file systems
Cluster: Smallest amount of space reserved for one file and is made up of a specific number of sectors
Sector: Smallest physical storage unit on a disk, a cluset will have 4 or 8 sectors.
Fault T_olerance:_ Summary: The ability to continue functioning after a hardware or software failure
Drive array: Use of one or two more hard drives which are configured for speed or redundancy(RAID) A RAID array can be used with hardware or software to help improve performance
RAID array: Comes with many levels such as 0,1 and 5
RAID level description
Have you used cloud storage in the past? Do you prefer local or cloud storage of your data? Explain your answer. I have had a lot of interaction with cloud storage. I was first introduced to cloud storage when my grandfather got me my first Apple Ipad. Of course I had no idea at the time what cloud storage really was, but I know I was able to store a certain amount of data. I now use google cloud storage on my phone. I use it mostly for storage of photos and files in my drive. The thing with cloud storage is that once something is put in the cloud it really cannot be erased. This is why I use cloud storage as well as local storage. Things that are more sensitive I keep on the local storage of my laptop or my phone, and things like pictures I keep in the cloud. The cloud definitely seems scary but it really is a cheap way of getting a lot of storage.
Have you encountered RAID in the past? Based on the resilience/performance tradeoffs, which level of RAID do you prefer? I have not yet encountered RAID. I did not know what it was before reading the textbook. I think the 5th level of raid is good because it writes data on more than one hard drive so that if a drive fails data cannot be rebuilt. I think this is an important feature to have because you never know when a drive might fail, and having a backup of your data is important. This is one of the reasons why its always good to save your work periodically or backup data on a separate drive so that if something fails you won't lose all your data.