SlideShare a Scribd company logo
1 of 3
Download to read offline
Embora  seja  fora  de  âmbito  com  relação  directa  nas  especificidades  do  hardware,  possui 
algum  enquadramento  pertinente  na  melhor  conceptualização  e  contextualização  de 
aspectos relacionados com o Linux (e com todos os SO’s). 
 
Nesse sentido fruto do nosso diálogo em sessão, segue alguns aspectos que colectei para de 
forma sucinta contextualizarem e eventualmente corrigirem alguma imprecisão que tenha 
sido mal esclarecida.  
Na  relação  que  existe  com  nos  discos  rígidos,  entre  sectores,  blocos  e  taxa  perdida  de 
endereçamento lógico dos ficheiros nos blocos. 
 
1. On  reading  through  disc  structure,  it  states  that  blocks  size  is  a  multiple  of  sector  size.  First 
thought is why do you even need blocks when there are sectors, and secondly why is the block 
size a multiple of sector like 1,2,4? Why can't it be half of sector? What's the relation here? 
Early in the computing industry, the term "block" was loosely used to refer to a small chunk of data. 
Later the term referring to the data area was replaced by sector, and block became associated with the 
data  packets  that  are  passed  in  various  sizes  by  different  types  of  data  streams. 
http://en.wikipedia.org/wiki/Disk_sector 
Block  is  an  abstraction  of  filesystems.  All  filesystem  operations  can  be  accessed  only  in  multiple  of 
blocks. In other terms, the smallest logically addressable unit to filesystem is block, not a sector. 
The smallest addressable unit on a block device is a sector. The sector size is physical property of a 
block device and is the fundamental unit of all block devices. 
Most block devices have 512‐byte sectors (although other sizes are common. For example, some CD‐
ROM discs have 2‐kilobyte sectors) while block sizes are commonly of size 512 bytes, 1 KB or 4KB. This is 
the reason block size is a multiple of sector. 
 
2. Disk Sector and Wasted Block Allocation For Files. 
A  sector  is  a unit  normally 512 bytes  or 1k, 2k, 4k…  with  relation  to  space  in disk  hardware. 
Filesystem block size is group of sector size.  
Suppose I am storing a file which is 5KB, how this will be written onto disk if a sector is 512 bytes 
and block is 4KB? 4KB of that File is written into one block and another 1KB of file is written into 
antoher 4KB Block. Now 3KB of that second Block is unusable. Will it be usable in future or will it 
be wasted? If I write the 10 5KB file to disk, 30KB of size will be wasted, or this 30KB is used in 
disk usage? 
First thing to note, is that the block size is almost always larger than your sector size 
To determine sector size run the following command 
root@ubuntu:~# fdisk ‐l | grep ‐E "Sector size" 
Sector size (logical/physical): 512 bytes / 512 bytes 
Sector size will almost always be either 512 bytes or 4096 bytes. 
 
To determine block size, run the following command
root@ubuntu:~# blockdev ‐‐getbsz /dev/sda 
4096 
The block size will often be 4096 on most modern OSes. You can change this if desired 
Any files that do not completely fill a block, will result in wasted space. This is normal and expected. 
http://linux.die.net/man/8/blockdev 
http://serverfault.com/questions/29887/how‐do‐i‐determine‐the‐block‐size‐of‐an‐ext3‐partition‐on‐linux 
http://www.linuxforums.org/forum/miscellaneous/5654‐linux‐disk‐block‐size‐help‐please.html 
Its a well established fact that files are stored on disk in multiples of "block" size. 
 
 
 
The concept of a block began as a simple way for physical sectors on disk to be represented logically in 
the filesystem. Each sector had its own header, data area and ECC which made it the smallest piece of 
disk that could be independently represented logically. 
As  time  went by,  with  the  advent  of caches  on  the  HDD  controller  it  became  easier  to  have  logical 
blocks which were of the size of multiple physical sectors. This way on‐disk sequential I/O increased 
resulting in better throughput. 
Today, a block is the smallest piece of disk‐space available. Typically files are stored using 1 or more 
block(s) on disk. 
 
For  each  file,  the  leftover  space  (if  any)  in  the  last 
block is used whenever changes are made to the file 
and  it  "grows",  requiring  additional  disk‐space  to 
store the newly added content. 
Additional space requirement (beyond what the free 
space in the current last block can accommodate) is 
satisfied by requesting additional blocks on the disk 
and logically linking the new set of blocks to continue 
following the current last block of the file. 
File A illustrates the above scenario.   
Advantage  of  allocating  blocks  in  advance  is  that  fragmentation  is  reduced.  Consider  the  alternative 
where there is no concept of blocks on disk and disk‐space is allocated as required i.e the amount of disk 
space allocated is exactly the file size. 
In such a setup, each time even a single character is added to the file, one would need to : 
 Allocate additional memory (1 more character). 
 Setup a link between the area containing the initial area of the file and this new byte. 
 
All this meta‐data i.e. additional formation about the "links" requires disk‐space too. This constitutes a 
fixed  overhead  for  each  such  "link"  and  hence  its  imperative  that  such  "links"  be  kept  to  a  minimal 
number. The concept of allocating disk size in "blocks" limits the overhead to a pre‐determined amount. 
Guaranteed number of files on disk = Raw disk‐space / block‐size 
Also  such  random  seeking  reduces  throughput  as  repositioning  the  disk  head  is  the  most  time‐
consuming task involved in disk I/O. Frequent random seeking is also likely to wear out the disk faster 
(remember dancing HDDs?) and must be avoided as much as possible. 
Further advantages of this approach : 
1. Faster reads ‐ Using blocks, disk reads are sequential upto the block size. Less seeks = higher read 
throughput. 
2. Faster Writes ‐ Blocks provide a simple implementation that can be mapped to pages which results 
in higher write throughput as well. 

More Related Content

Similar to 1.1.b hdd block sector

All .net Interview questions
All .net Interview questionsAll .net Interview questions
All .net Interview questionsAsad Masood Qazi
 
5231 140-hellwig
5231 140-hellwig5231 140-hellwig
5231 140-hellwigsprdd
 
EVALUATION CRITERIA FOR SELECTING NOSQL DATABASES IN A SINGLE-BOX ENVIRONMENT
EVALUATION CRITERIA FOR SELECTING NOSQL DATABASES IN A SINGLE-BOX ENVIRONMENTEVALUATION CRITERIA FOR SELECTING NOSQL DATABASES IN A SINGLE-BOX ENVIRONMENT
EVALUATION CRITERIA FOR SELECTING NOSQL DATABASES IN A SINGLE-BOX ENVIRONMENTijdms
 
UNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptx
UNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptxUNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptx
UNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptxSnehaLatha68
 
Modeling data and best practices for the Azure Cosmos DB.
Modeling data and best practices for the Azure Cosmos DB.Modeling data and best practices for the Azure Cosmos DB.
Modeling data and best practices for the Azure Cosmos DB.Mohammad Asif
 
SQL vs NoSQL deep dive
SQL vs NoSQL deep diveSQL vs NoSQL deep dive
SQL vs NoSQL deep diveAhmed Shaaban
 
Database architectureby howard
Database architectureby howardDatabase architectureby howard
Database architectureby howardoracle documents
 
Ssd gc review
Ssd gc reviewSsd gc review
Ssd gc reviewLouis liu
 
Pass chapter meeting - november - partitioning for database availability - ch...
Pass chapter meeting - november - partitioning for database availability - ch...Pass chapter meeting - november - partitioning for database availability - ch...
Pass chapter meeting - november - partitioning for database availability - ch...Charley Hanania
 
No SQL - MongoDB
No SQL - MongoDBNo SQL - MongoDB
No SQL - MongoDBMirza Asif
 
b tree file system report
b tree file system reportb tree file system report
b tree file system reportDinesh Gupta
 
Oracle smart flash cache
Oracle smart flash cacheOracle smart flash cache
Oracle smart flash cachexiangrong
 
1 Anatomy of a Database System Joseph M. Hellerstein and
1 Anatomy of a Database System Joseph M. Hellerstein and1 Anatomy of a Database System Joseph M. Hellerstein and
1 Anatomy of a Database System Joseph M. Hellerstein andVannaJoy20
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxsqlserver4
 
Silicon Valley Code Camp: 2011 Introduction to MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDBSilicon Valley Code Camp: 2011 Introduction to MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDBManish Pandit
 
Sql vs NoSQL-Presentation
 Sql vs NoSQL-Presentation Sql vs NoSQL-Presentation
Sql vs NoSQL-PresentationShubham Tomar
 

Similar to 1.1.b hdd block sector (19)

All .net Interview questions
All .net Interview questionsAll .net Interview questions
All .net Interview questions
 
Sql project ..
Sql project ..Sql project ..
Sql project ..
 
5231 140-hellwig
5231 140-hellwig5231 140-hellwig
5231 140-hellwig
 
EVALUATION CRITERIA FOR SELECTING NOSQL DATABASES IN A SINGLE-BOX ENVIRONMENT
EVALUATION CRITERIA FOR SELECTING NOSQL DATABASES IN A SINGLE-BOX ENVIRONMENTEVALUATION CRITERIA FOR SELECTING NOSQL DATABASES IN A SINGLE-BOX ENVIRONMENT
EVALUATION CRITERIA FOR SELECTING NOSQL DATABASES IN A SINGLE-BOX ENVIRONMENT
 
UNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptx
UNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptxUNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptx
UNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptx
 
Modeling data and best practices for the Azure Cosmos DB.
Modeling data and best practices for the Azure Cosmos DB.Modeling data and best practices for the Azure Cosmos DB.
Modeling data and best practices for the Azure Cosmos DB.
 
On nosql
On nosqlOn nosql
On nosql
 
2012 phoenix mug
2012 phoenix mug2012 phoenix mug
2012 phoenix mug
 
SQL vs NoSQL deep dive
SQL vs NoSQL deep diveSQL vs NoSQL deep dive
SQL vs NoSQL deep dive
 
Database architectureby howard
Database architectureby howardDatabase architectureby howard
Database architectureby howard
 
Ssd gc review
Ssd gc reviewSsd gc review
Ssd gc review
 
Pass chapter meeting - november - partitioning for database availability - ch...
Pass chapter meeting - november - partitioning for database availability - ch...Pass chapter meeting - november - partitioning for database availability - ch...
Pass chapter meeting - november - partitioning for database availability - ch...
 
No SQL - MongoDB
No SQL - MongoDBNo SQL - MongoDB
No SQL - MongoDB
 
b tree file system report
b tree file system reportb tree file system report
b tree file system report
 
Oracle smart flash cache
Oracle smart flash cacheOracle smart flash cache
Oracle smart flash cache
 
1 Anatomy of a Database System Joseph M. Hellerstein and
1 Anatomy of a Database System Joseph M. Hellerstein and1 Anatomy of a Database System Joseph M. Hellerstein and
1 Anatomy of a Database System Joseph M. Hellerstein and
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptx
 
Silicon Valley Code Camp: 2011 Introduction to MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDBSilicon Valley Code Camp: 2011 Introduction to MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDB
 
Sql vs NoSQL-Presentation
 Sql vs NoSQL-Presentation Sql vs NoSQL-Presentation
Sql vs NoSQL-Presentation
 

More from Acácio Oliveira

Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptxSecurity+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptxSecurity+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptxSecurity+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptxSecurity+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptxSecurity+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptxSecurity+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptxSecurity+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptxSecurity+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptxSecurity+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptxSecurity+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptxSecurity+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....Acácio Oliveira
 
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptxSecurity+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptxSecurity+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...Acácio Oliveira
 
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptxSecurity+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptx
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptxSecurity+ Lesson 01 Topic 05 - Common Network Protocols.pptx
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptxSecurity+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptxSecurity+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptxAcácio Oliveira
 
Security+ Lesson 01 Topic 17 - Types of Malware.pptx
Security+ Lesson 01 Topic 17 - Types of Malware.pptxSecurity+ Lesson 01 Topic 17 - Types of Malware.pptx
Security+ Lesson 01 Topic 17 - Types of Malware.pptxAcácio Oliveira
 

More from Acácio Oliveira (20)

Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptxSecurity+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
 
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptxSecurity+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
 
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptxSecurity+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
 
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptxSecurity+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
 
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptxSecurity+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
 
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptxSecurity+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
 
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptxSecurity+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
 
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptxSecurity+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
 
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptxSecurity+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
 
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptxSecurity+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
 
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptxSecurity+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
 
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
 
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptxSecurity+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
 
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptxSecurity+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
 
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
 
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptxSecurity+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
 
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptx
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptxSecurity+ Lesson 01 Topic 05 - Common Network Protocols.pptx
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptx
 
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptxSecurity+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
 
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptxSecurity+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
 
Security+ Lesson 01 Topic 17 - Types of Malware.pptx
Security+ Lesson 01 Topic 17 - Types of Malware.pptxSecurity+ Lesson 01 Topic 17 - Types of Malware.pptx
Security+ Lesson 01 Topic 17 - Types of Malware.pptx
 

Recently uploaded

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Recently uploaded (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

1.1.b hdd block sector

  • 1. Embora  seja  fora  de  âmbito  com  relação  directa  nas  especificidades  do  hardware,  possui  algum  enquadramento  pertinente  na  melhor  conceptualização  e  contextualização  de  aspectos relacionados com o Linux (e com todos os SO’s).    Nesse sentido fruto do nosso diálogo em sessão, segue alguns aspectos que colectei para de  forma sucinta contextualizarem e eventualmente corrigirem alguma imprecisão que tenha  sido mal esclarecida.   Na  relação  que  existe  com  nos  discos  rígidos,  entre  sectores,  blocos  e  taxa  perdida  de  endereçamento lógico dos ficheiros nos blocos.    1. On  reading  through  disc  structure,  it  states  that  blocks  size  is  a  multiple  of  sector  size.  First  thought is why do you even need blocks when there are sectors, and secondly why is the block  size a multiple of sector like 1,2,4? Why can't it be half of sector? What's the relation here?  Early in the computing industry, the term "block" was loosely used to refer to a small chunk of data.  Later the term referring to the data area was replaced by sector, and block became associated with the  data  packets  that  are  passed  in  various  sizes  by  different  types  of  data  streams.  http://en.wikipedia.org/wiki/Disk_sector  Block  is  an  abstraction  of  filesystems.  All  filesystem  operations  can  be  accessed  only  in  multiple  of  blocks. In other terms, the smallest logically addressable unit to filesystem is block, not a sector.  The smallest addressable unit on a block device is a sector. The sector size is physical property of a  block device and is the fundamental unit of all block devices.  Most block devices have 512‐byte sectors (although other sizes are common. For example, some CD‐ ROM discs have 2‐kilobyte sectors) while block sizes are commonly of size 512 bytes, 1 KB or 4KB. This is  the reason block size is a multiple of sector.    2. Disk Sector and Wasted Block Allocation For Files.  A  sector  is  a unit  normally 512 bytes  or 1k, 2k, 4k…  with  relation  to  space  in disk  hardware.  Filesystem block size is group of sector size.   Suppose I am storing a file which is 5KB, how this will be written onto disk if a sector is 512 bytes  and block is 4KB? 4KB of that File is written into one block and another 1KB of file is written into  antoher 4KB Block. Now 3KB of that second Block is unusable. Will it be usable in future or will it  be wasted? If I write the 10 5KB file to disk, 30KB of size will be wasted, or this 30KB is used in  disk usage?  First thing to note, is that the block size is almost always larger than your sector size  To determine sector size run the following command  root@ubuntu:~# fdisk ‐l | grep ‐E "Sector size"  Sector size (logical/physical): 512 bytes / 512 bytes  Sector size will almost always be either 512 bytes or 4096 bytes.    To determine block size, run the following command root@ubuntu:~# blockdev ‐‐getbsz /dev/sda  4096  The block size will often be 4096 on most modern OSes. You can change this if desired  Any files that do not completely fill a block, will result in wasted space. This is normal and expected. 
  • 2. http://linux.die.net/man/8/blockdev  http://serverfault.com/questions/29887/how‐do‐i‐determine‐the‐block‐size‐of‐an‐ext3‐partition‐on‐linux  http://www.linuxforums.org/forum/miscellaneous/5654‐linux‐disk‐block‐size‐help‐please.html  Its a well established fact that files are stored on disk in multiples of "block" size.        The concept of a block began as a simple way for physical sectors on disk to be represented logically in  the filesystem. Each sector had its own header, data area and ECC which made it the smallest piece of  disk that could be independently represented logically.  As  time  went by,  with  the  advent  of caches  on  the  HDD  controller  it  became  easier  to  have  logical  blocks which were of the size of multiple physical sectors. This way on‐disk sequential I/O increased  resulting in better throughput.  Today, a block is the smallest piece of disk‐space available. Typically files are stored using 1 or more  block(s) on disk.    For  each  file,  the  leftover  space  (if  any)  in  the  last  block is used whenever changes are made to the file  and  it  "grows",  requiring  additional  disk‐space  to  store the newly added content.  Additional space requirement (beyond what the free  space in the current last block can accommodate) is  satisfied by requesting additional blocks on the disk  and logically linking the new set of blocks to continue  following the current last block of the file.  File A illustrates the above scenario.   
  • 3. Advantage  of  allocating  blocks  in  advance  is  that  fragmentation  is  reduced.  Consider  the  alternative  where there is no concept of blocks on disk and disk‐space is allocated as required i.e the amount of disk  space allocated is exactly the file size.  In such a setup, each time even a single character is added to the file, one would need to :   Allocate additional memory (1 more character).   Setup a link between the area containing the initial area of the file and this new byte.    All this meta‐data i.e. additional formation about the "links" requires disk‐space too. This constitutes a  fixed  overhead  for  each  such  "link"  and  hence  its  imperative  that  such  "links"  be  kept  to  a  minimal  number. The concept of allocating disk size in "blocks" limits the overhead to a pre‐determined amount.  Guaranteed number of files on disk = Raw disk‐space / block‐size  Also  such  random  seeking  reduces  throughput  as  repositioning  the  disk  head  is  the  most  time‐ consuming task involved in disk I/O. Frequent random seeking is also likely to wear out the disk faster  (remember dancing HDDs?) and must be avoided as much as possible.  Further advantages of this approach :  1. Faster reads ‐ Using blocks, disk reads are sequential upto the block size. Less seeks = higher read  throughput.  2. Faster Writes ‐ Blocks provide a simple implementation that can be mapped to pages which results  in higher write throughput as well.