eCDFP (Disk Drives) - Part (2) (END)

 Using Logical Block Addressing  (LBA) 


CHS Addressing မှာ Drive က Size Limit ရှိတာကြောင့် Logical Block Addressing ကိုအသုံးပြုလာပါတယ်။ LBA Addressing က Sector တစ်ခုချင်းစီအတွက် နံပတ်တစ်ခုကိုသာ အသုံးပြုပါတယ်။ CHS Addressing မှာ (Cylinder, Head, Sector) ရဲ့ Address က (0,0,1) ဖြစ်ပြီးတော့ LBA Addressing မှာတော့ (0) ဖြစ်ပါတယ်။ CHS Addressing က (0,0,2) ဆိုရင် LBA Addressing မှာတော့ (1) ဖြစ်ပါတယ်။ အချို့သော File System တွေက CHS Addressing ကိုပဲအသုံးပြုနေဆဲဖြစ်တာကြောင့် CHS To LBA ကိုပြောင်းလဲတွက်ချက်ရပါတယ်။ ပုံသေနည်းကတော့ အောက်ပါအတိုင်းဖြစ်ပါတယ်။ 

LBA Address = (((Cylinder x Heads-Per-Cylinder) + Head) x Sectors-Per-Track) + Sector -1

ဥပမာ - Heads-Per-Cylinder က 16 ခုရှိတယ်။ Track တစ်ခုမှာ Sectors 63 ခုရှိတယ်။  ဒါဆိုရင် CHS Address (2,3,4) အတွက် LBA Address ကဘယ်လောက်လဲဆိုရင် - ?  CHS = Cylinder-2 , Head-2 , Sector – 4

(((2x16)+3) x 63) 4 – 1 = 2208

နောက်ပိုင်း HDD တွေက LBA Addressing ကိုအသုံးပြုလာပါတယ်။ CHS Addressing လို Limitation မရှိတော့ပါဘူး။ Block တိုင်းမှား နံပတ်တစ်ခုစီရှိပြီး အဲနံပတ်ကနေပဲ Block ပေါ်မှာ Data တွေ Read, Write ကိုပြုလုပ်ပါတယ်။ Course ထဲမှာတော့ HDD နဲ့ချိတ်ဆက်တဲ့ Interface အပိုင်းတွေနဲ့ BIOS အကြောင်း နည်းနည်းပါဝင်ပါတယ်။ IDE, SATA Type တွေကိုရှင်းပြတာပါ။ အားလုံးသိလောက်တယ်ထင်လို့ မဖော်ပြ တော့ပါဘူး။ 

Solid State Drives (SSD) 

ယနေ့အချိန် Investigation လုပ်တဲ့အခါမှာ HDD တင်မကပဲ SSD တွေကိုပါ Analysis လုပ်ရတာတွေကြုံတွေ့လာနိုင်ပါတယ်။ HDD လိုမဟုတ်ပဲ SSD ရဲ့တည်ဆောက်ပုံက ရှုပ်ထွေးတဲ့အတွက် Analysis လုပ်တဲ့အချိန်မှာ Challenges တွေရှိလာပါတယ်။ SSD က HDD လို Moving ဖြစ်နေတဲ့ Spindle Mortor တွေ Arms တွေမပါဝင်ပါဘူး။ MLC NAND Base Flash Memory ကိုအသုံးပြုထားပြီး Power Off ပေမဲ့ Data တွေပျောက်မသွားပါဘူး။ NAND Flash Chip တွေက 1 GB To 64 GB ဆိုပြီး Size အသီးသီးလားပါတယ်။



Inside View 


SSD Logical Components 

 NAND Flash တွေကိုတော့ Pages and Blocks ဆိုပြီးဖွဲ့စည်းထားပါတယ်။ Page ကတော့ SSD မှာ Read and Write အတွက် အသေးဆုံး Unit ဖြစ်ပါတယ်။ Standard Page Size ကတော့ KB ဖြစ်ပါတယ်။  HDD အနေနဲ့ကြည့်မယ်ဆိုရင်တော့ HDD ရဲ့ Data Read and Write အတွက် အသေးဆုံး Unit က Sector ဖြစ်ပြီး 512 Bytes ရှိပါတယ်။  SSD မှာ Page တွေစုနေတဲ့ Group ကိုတော့ Block လို့ခေါ်ပါတယ်။ Block တစ်ခုမှာ 128 Pages ရှိပြီး Block Size က 512 KB ရှိပါတယ်။ 


SSD တည်ဆောင်ပုံအရ Block က အသေးဆုံးဖြစ်ပြီး Data တွေကို Read or Write လုပ်မယ်ဆိုရင် Block တစ်ခုလုံးကို Read and Write လုပ်ပါတယ်။  Block တွေကိုစုထားတာကိုတော့ Plane လို့ခေါ်ပါတယ်။ 


Course ထဲမှာတော့ SSD နဲ့ပတ်သတ်ပြီး ဒီလောက်ပဲပါပါတယ်။ အရင်က ရေးခဲ့တဲ့ SSD နဲ့ပတ်သတ်တဲ့ အကြောင်းအရာတွေကို ဖတ်မယ်ဆိုရင်  Link - 1   Link-2   Link-3

အရေးကြီးတဲ့ အကြောင်းအရာတွေကို ပြန်ပြီး Summarize လုပ်ရရင် 
- လက်ရှိ အနေနဲ့ HDD , SSD တွေအသုံးပြုနေပါတယ်။ 
- Disk တွေမှာ မတူညီတဲ့ Characteritists နဲ့ Interface တွေရှိပါတယ်။
- HDD မှာ အသေးဆုံး Unit က Sector ဖြစ်ပါတယ်။ 
- ယခု HDD တွေက LBA Addressing ကို အသုံးပြုနေပါတယ်။ 

Volume and Partitions 

ယခု  Section မှာတော့ ဖော်ပြမဲ့ အကြောင်းအရာတွေကတော့  အောက်ပါအတိုင်းဖြစ်ပါတယ်။ 

Disk Structures: Sector, Cluster, etc. 
Partitions, Partitions Gap, Hidden Partitions 

HDD ကို Logically အရ ပိုင်းထားတာကို Partitions လို့ခေါ်ပါတယ်။ Volume and Partitions ကွဲပြားခြားနားပုံမှာ Volume ဆိုတာက Sectors တွေကို Logical အရ တစ်ဆက်တည်း ဖြစ်အောင် ပေါင်းစပ်ထားတာဖြစ်ပါတယ်။ Physically မတည်ရှိနေပါဘူး။ Partitions ကတော့ Sector တွေကို တစ်ဆက်တည်းဖြစ်အောင်ပေါင်းစပ်ထားတာဖြစ်ပါတယ်။ 


Case (1) မှာဆိုရင် Disk မှာ Partitions မရှိပါဘူး။ Volume တစ်ခုသာရှိပါတယ်။ ဒါကြောင့် Disk တစ်ခုလုံးက Volume ဖြစ်ပါတယ်။ 

Case (2) မှာဆိုရင် Disk  (2) ခုရှိပါတယ်။ Disk  (2) လုံးကို Disk တစ်ခုတည်းဖြစ်အောင်ပေါင်းထားပါတယ်။ ပေါင်းထားတာက Volume ဖြစ်ပါတယ်။ 

Case (3) မှာဆိုရင် Disk  (2) ခုရှိပါတယ်။ Disk နံပတ် (၁) ထဲက Partition တစ်ခုကိုသာ အသုံးပြုထားပါတယ်။  ဒုတိယ Disk တစ်ခုလုံးကိုတော့ အသုံးပြုထားပါတယ်။ Disk No (1) ရဲ့ Partitions + Disk (2) ဖြစ်ပါတယ်။ 

အပေါ်က Case တွေအရ Disk တစ်ခုထဲကနေ Volume ဖြစ်နိုင်သလို Disk တွေ Partitions တွေပေါင်းစပ်ပြီး  Volume ဖြစ်နိုင်ပါတယ်။ Investigation လုပ်တဲ့အခါမှာ System တစ်ခုမှာ Disk တစ်ခုထက်ပိုတာတွေကြုံတွေ့နိုင်ပါတယ်။ ကျွန်တော်တို့ လိုအပ်ချက်အရ Physical Disk တစ်ခုကို Logically Partitions တွေပိုင်းပါတယ်။ ပုံမှာ MS Window ရဲ့ Partitions တွေကို ဥပမာပြထားပါတယ်။ 


Volume ထဲမှာ Partitions တွေကိုတွေ့နိုင်ပါတယ်။ Window ကနေ Partitions တစ်ခုစီကို  C:, D:, E: စသည်ဖြင့် Drive Letter နာမည်တွေပေးထားပါတယ်။ Drive Letter တစ်ခုစီက သက်ဆိုင်ရာ Partitions ကို ညွှန်ပြပါတယ်။ Partitions ထဲက Data ကိုရချင်ရင် File Brower ကိုသုံးပြီး Drive Letter ကို Access လုပ်ပါတယ်။ System ကနေ Logical Partitions တွေကို Physical Disk ရဲ့ဘယ်နေရာမှာရှိတယ်ဆိုတာနဲ့ 
Partitions တစ်ခုက ဘယ်နေရာကနေစပြီး ဘယ်နေရာမှာဆုံးတယ်ဆိုတာကို Addressing Table နဲ့သတ်မှတ်ပါတယ်။ 


Partitions Tables

အခုအသုံးများတဲ့ Partitions Tables တွေက IBM DOS, (Master Boot Record) (MBR) နဲ့  GUID Partitions Table (GPT) တို့ဖြစ်ပါတယ်။ 
Master Boot Record (MBR) ကတော့ Sector တစ်ခုလုံးကို နေရာယူထားပါတယ်။ MBR က Hard Disk ရဲ့ ပထမဆုံး Sector မှာတည်ရှိပါတယ်။ LBA Addressing = 0 နဲ့ CHD Addressing အရ (0,0,1) မှာရှိပါတယ်။ MBR မှာ ပါဝင်တာတွေကတော့ 
- Boot Code
- Partitions Table
- Signature

ပုံမှာ Offset တွေကို Decimal နဲ့ပြထားပြီး 1 Sector = 512 Bytes ဖြစ်ပါတယ်။ 

အရင်တုန်းက OS တွေမှာ OS  စတင်ဖို့ အသုံးပြုတဲ့ Boot Code  က 445 Bytes ရှိပါတယ်။ ယနေ့ OS တွေကတော့ 446 Bytes နဲ့ မလုံလောက်တော့ပါဘူး။ ဒါကြောင့် MBR ထဲမှာရှိတဲ့ Boot Code က Active Partitions ထဲမှာရှိနေပြီး  Bootable Or Volume Boot Record (VBR) လို့ခေါ်ပါတယ်။ MBR က Hard Disk ရဲ့ ပထမဆုံး Sector မှာရှိနေပြီး VBR ကတော့ Partitions ရဲ့အစမှာရှိပါတယ်။ 


MBR ထဲမှာရှိတဲ့ 64-bytes Partition ကိုကြည့်မယ်ဆိုရင် 16-Bytes အနေနဲ့ 4 ပိုင်းတွေ့ရမှာ ဖြစ်ပါတယ်။ 


16-Bytes ကို ထပ်ခွဲကြည့်ရင် အောက်ပါအတိုင်းတွေ့ရမှာဖြစ်ပါတယ်။ ဘာလို့ Partition  4 ခုပဲရှိနေတာလဲဆိုရင်  MBR Partition မှာ Primary Partitions 4 ခုအထိပဲရှိနိုင်လို့ဖြစ်ပါတယ်။


MBR မှာ Partitions 4 ခုထက်ပိုပြီးသုံးထားရင် Extended Partitions လို့သတ်မှတ်ပါတယ်။ Extended Partitions ထဲက Partitions ကိုတော့ Logical Partitions လို့သတ်မှတ်ပါတယ်။ Logical Partitions အရေအတွက်ကတော့  အသုံးပြုတဲ့ System နဲ့ Version အပေါ်မူတည်ပါတယ်။ Extended Partitions ရှိနေရင်တော့ Analysis လုပ်တာကို သတိထားပြီး ပြုလုပ်ရမှာဖြစ်ပါတယ်။ Partitions Tools တွေက Partitions အမျိုးအစားအပေါ်မူတည်ပြီး လုပ်ဆောင်တဲ့အတွက်ဖြစ်ပါတယ်။ MBR မှာရှိတဲ့ Content တွေကို သတိထားပြီးဆောင်ရွက်ရမှာဖြစ်ပါတယ်။ MBR  ကနေ Extended Boot Record (EBR) ကို Point လုပ်တာလဲရှိပါတယ်။ EBR က Another MBR လို့လဲခေါ်ပါတယ်။ EBR က MBR နဲ့ Structure တူပေမဲ့ ကွဲပြားခြားနားပါတယ်။ ပုံမှာဆိုရင် Partitions နှစ်ခုရှိပြီး Primary Partitions တစ်ခုနဲ့ Extended Partitions (Logical Partition) တစ်ခုတို့ဖြစ်ပါတယ်။ နောက်တစ်ပုံကတော့ Pointer လုပ်တာကိုပြတာဖြစ်ပါတယ်။ 



Disk Partitions With EnCase Imager 

MBR With X-Way

GPT AND THE NEW BOOTING TECHNOLOGY  

MBR က Primary Partitions  (4) ခုသာရှိနိုင်ပြီး  Size ကလဲ 2TB အထိသာရှိနိုင်ပါတယ်။ နောက်ပိုင်း BIOS အစား UEFI ကိုပြောင်းလဲအသုံးပြုလာပါတယ်။ Disk Size  တွေလဲများလာတာရယ် OS တွေမှာအသုံးပြုတဲ့ Interface တွေရယ်နဲ့ Firmware/Hardware  လိုအပ်ချက်တွေကြောင့် UEFI နဲ့  GPTကိုအသုံးပြုလာကြပါတယ်။  MBR က Partitions  အတွက် 32 bits သာအသုံးပြုထားပေမဲ့ GPT ကတော့ 64 bits ကိုအသုံးပြုထားပါတယ်။  9400000000 TB 

MBR က Primary Partitions  (4) သာအသုံးပြုနိုင်ပေမဲ့ GPT ကတော့ 128 Partitions  အထိအသုံးပြုနိုင်ပါတယ်။ 



GPT မှာ Backup နဲ့ Intergrity Checking ပါဝင်ပါတယ်။ Header နဲ့ CheckSums နဲ့ Partitions Table က Disk ရဲ့ နောက်ဆုံးအပိုင်း last Sector မှာတည်ရှိပါတယ်။ Backup နဲ့  Intergrity က Partitions Table ပျက်သွားရင် အသုံးဝင်ပါတယ်။ last Sector မှာရှိတဲ့ backup ကို ပြန်ယူပြီး ပုံမှန်ဖြစ်အောင် Restore လုပ်နိုင်ပါတယ်။ Restore လုပ်တဲ့နေရာမှာ မူရင်း Disk ကိုမလုပ်ပဲ Image ကိုပဲလုပ်ရမှာဖြစ်ပါတယ်။ 

Disk ပေါ်လုပ်ရင်ဘာဖြစ်လဲဆိုရင် လုပ်လို့တော့ရပါတယ် လုပ်နေရင်း အမှားတစ်ခုခုဖြစ်ရင် ပျက်နေတာ ပိုပျက်သွားနိုင်ပါတယ်။ နောက်ပိုင်း OS တွေနဲ့ Mother Board တွေက  GPT and UEFI တွေများပါတယ်။ GPT Drive ကိုတပ်ချင်ရင် UEFI Support ဖြစ်မှပဲရပါမယ်။ OS နဲ့ System Firmware ကြားမှာ UEFI Frame Work  Bridge လုပ်ပေးပါတယ်။ OS Boot လုပ်တဲ့အချိန်မှာ UEFI Partitions ကိုရှာပြီးမှ boot Process ကိုလုပ်ဆောင်ပါတယ်။ UEFI က OS Partitions ကိုတွေ့တဲ့အချိန်မှာ အခြားလိုအပ်တဲ့ File တွေနဲ့အတူ OS ကို Loading လုပ်ပါတယ်။ 

GPT Layout 

GPT မှာပါဝင်တာတွေကတော့ 
- Protective MBR 
- GPT Header 
- Partitions Table 
- Partitions
- Backup For Both GPT Header and Partitions Table

GPT Layout Example 


GPT Layout Example 


GPT Disk တွေမှာ Partition Entries ကို Disk ရဲ့ First Sector ကနေ ဖယ်ထုတ်ထားပါတယ်။ GPT Disk ရဲ့ ပထမဆုံး Section ကတော့ Protective MBR ဖြစ်ပါတယ်။  Support မဖြစ်တဲ့ GPT Drive တွေ၊ Recognized မဖြစ်တဲ့ GPT Drive တွေ၊  Corrupt ဖြစ်နေတဲ့ GPT Drive တွေ၊ Legacy BIOS   တွေအတွက်ကို ပြုပြင်ပေးပါတယ်။ Protective MBR မှာတော့ Partition ရှိတာကို သိပေမဲ့ Partition က ဘာဆိုတာကို မသိနိုင်ပါဘူး။ GPT Header မှာတော့ MBR မှာရှိတဲ့အားနည်းချက်တွေကိုပြင်ဆင်ထားပါတယ်။ ပုံမှာ GPT Header  ကိုပြထားပါတယ်။ 

Protective MBR With Disk Editor View 

GPT Header With Disk Editor View 


GPT Header

Header ရဲ့ ပထမဆုံးအပိုင်းမှာ EFI Signature “EFI PART” နဲ့ GUID Information တို့ပါဝင်ပါတယ်။ GPT ရဲ့ LBA က 1 ဖြစ်ပြီး Last Sector မှာလဲ LBA backup ပါဝင်ပါတယ်။ First and Last Partitions  တွေရဲ့ LBA တွေပါဝင်ပါတယ်။ Disk က 512 Bytes  ရှိတဲ့ Sector အသုံးပြုထားတယ်ဆိုရင် ကျန်တဲ့  Sector အပိုင်းတွေက Zero ဖြစ်နေပါမယ်။ တစ်ခြား Sector Size အသုံးပြုရင်လဲ Sector Size ထက်ကျော်တဲ့အပိုင်းက Zero တွေကြည့်ဖြစ်နေပါမယ်။ LBA Address က 8 Bytes အသုံးပြုထားပြီး  2 ပါဝါ 64 Addressable Space ရှိပါတယ်။

GPT Header ရဲ့ Header Size ကဘယ်လောက်ရှိတယ်။ အခု GPT Header ရှိနေတဲ့ LBA ကဘယ်လောက်။ Partition တွေအတွက် သုံးနိုင်တဲ့ LBA ဘယ်ကနေစပြီး ဘယ်အထိအသုံးပြုနိုင်တယ်။ Partition Table က ဘယ်မှာရှိတယ်။ Partition ဘယ်လောက်အထိရှိနိုင်တယ်။ (Default = 128) Backup က LBA ဘယ်လောက်မှာရှိဆိုတာတွေကို တွေ့နိုင်ပါတယ်။    


GPT Disk ရဲ့ GPT Header Backup ကို Disk ရဲ့နောက်ဆုံးမှာ တနည်းအားဖြင့် last Sector မှာတွေ့နိုင်ပါတယ်။ အောက်ကပုံမှာ GPT Header နဲ့ GPT Header Backup ကိုပြထားပါတယ်။ GPT  နဲ့ MBR Base Device တွေက Acquisition  လုပ်တဲ့နေရာမှာကွဲပြားခြားနားခြင်းမရှိပါ။ GPT  နဲ့ MBR က Disk ရဲ့ Partitions နဲ့ Logical Structure ကိုပဲခွဲခြားတာဖြစ်ပါတယ်။ 

GPT Header &  Partition Table  Backup 

Partition Table 

Partition Table ကတော့ Logical  Block Address  (2), Sector (2) မှာရှိပါတယ်။ Partition Table က GPT Storage ထဲမှာ Partition ဘယ်လောက်ရှိတယ်။ Partition တစ်ခုစီရဲ့ GUID, Unique Partition GUID, Partition ရဲ့ First LBA, Last LBA (Partition တစ်ခုက LBA ဘယ်လောက်မှာစပြီး ဘယ်လောက်မှာဆုံးတယ်။) Attribute Flag, Partition Name တို့ကိုဖော်ပြပေးပါတယ်။ အောက်ကပုံမှာဆိုရင် Basic Data Partition 3 ခုရှိပါတယ်။ Basic Data Partition 3 ခုမှာ တစ်ခုက Windows Recovery Environment (RE) ဖြစ်ပါတယ်။ ကျန်တဲ့ 2 ခုက EFI System Partition နဲ့ Microsoft Reserved Partition (MSR)  ဖြစ်ပါတယ်။


GPT Partition Table 

GPT Partition Table 


GUID Partition Table 

Hidden Protected Area (HPA) 


HPA ဆိုတာက Disk ပေါ်မှာရှိပြီး HPA Partitions ကို OS က မမြင်နိုင်ပါ။ Disk ပြုလုပ်တဲ့ Vendor က Product နဲ့ပတ်သတ်တဲ့ အချက်အလက်တွေထည့်ဖို့ပြုလုပ်ထားတာဖြစ်ပါတယ်။


 HPA ကိုရည်ရွယ်ချက်မျိုးစုံနဲအသုံးပြုပါတယ်။ System Boot လုပ်ဖို့၊  HD  Diagnostic လုပ်ဖို့၊ Recovery လုပ်ဖို့ နဲ့ Device ပျောက်ရင် ပြန်ရှာဖို့အတွက် စသည်ဖြင့်ရည်ရွယ်ချက်အမျိုးမျိုးနဲ့အသုံးပြုပါတယ်။ မသမာတဲ့ရည်ရွယ်ချက်နဲ့ Hidden Protected Area (HPA) ထဲမှာ Data တွေသိမ်းထားလို့ရပါတယ်။ HPA ရှိ- မရှိ ATA Command နဲ့သိနိုင်ပါတယ်။ 



 Hidden Protected Area (HPA) ကိုသိဖို့အတွက် Linux CLI Tools hdparm -  Command , The Sleuth Kit (TSK), ATATool, dmesg တို့လို Tools တွေရှိပါတယ်။  Imager တွေမှာလဲ HPA ရှိ မရှိကို Detect လုပ်ပေးပါတယ်။ 

#hdparm –N /dev/sda

Encase Imager With Device Configuration Overlay (DCO ) 


Disk ကို Edit လုပ်ဖို့အတွက်ဆိုရင် Active@Disk, WinHex, X-Way, Disk Editor, Hxd, လို Tools တွေရှိပါတယ်။  (END) 

Comments

Popular posts from this blog

B-Trees (NTFS)

NTFS Index Attributes

Volatility Workbench (GUI) for the Volatility tool