SlideShare une entreprise Scribd logo
1  sur  9
Télécharger pour lire hors ligne
Case study: ext3 FS
The ext3 file system
• Design goals
   – Add journaling capability to the ext2 FS
   – Backward and forward compatibility with ext2
      • Existing ext2 partitions can be mounted as ext3
   – Leverage the proven ext2 performance
   – Reuse most of the ext2 code base
   – Reuse ext2 tools, including e2fsck




                                                     2
The ext3 journal
Option1: Journal FS data         Option2: Journal disk block
structure updates                updates
• Example:                       • Example:
   – Start transaction              – Start transaction
   – Delete dir entry               – Update block #n1 (contains the
   – Delete i-node                    dir entry)
   – Release blocks 32, 17, 60      – Update block #n2 (i-node
                                      allocation bitmap)
   – End transaction
                                    – Update block #n3 (data block
                                      allocation bitmap)
                                    – Add transaction

  Question: which approach is better?
                                                           3
The ext3 journal
Option1: Journal FS data              Option2: Journal disk block
structure updates                     updates
✔
    Efficient use of journal space;   ✗
                                          Even a small update adds a whole
    hence faster journaling               block to the journal
✗
    Individual updates are applied    ✔
                                          Multiple updates to the same
    separately                            block can be aggregated into a
                                          single update
✗
    The journaling layer must
                                      ✔
                                          The journaling layer is FS-
    understand FS semantics               independent (easier to implement)




                      Ext3 implements Option 2

                                                                   4
Journaling Block Device (JBD)
• The ext3 journaling layer is called
  Journaling Block Device (JBD)
• JBD interface                             ext3fs
   – Start a new transaction                    start, update,
   – Update a disk block as part of a           complete
     transaction                             JBD
   – Complete a transaction
       • Completed transactions are
         cached in RAM
                                 Block device      Journal


                                                       5
Journaling Block Device (JBD)
• JBD interface (continued)
   – Commit: write transaction data
     to the journal                         ext3fs
       • Multiple FS transactions are           start, update,
         committed in one go                    complete
   – Checkpoint: flush the journal to
                                             JBD
     the disk
       • Used when the journal is full
         or the FS is being
         unmounted               Block device      Journal


                                                       6
Transaction lifecycle

in progress    Updates are cached in RAM



               Updates are cached in RAM; no additional
 completed     updates are allowed in the same transaction


               Updates are written to the journal and
 committed     marked as committed. Transaction can be
               replayed after an unclean unmount


               Updates are written to the file system; the
checkpointed   transaction is removed from the journal
                                                     7
Journaling modes
• Ext3 supports two journaling modes
   – Metadata+data
      • Enforces atomicity of all FS operations
   – Metadata journaling
      • Metadata is journaled
      • Data blocks are written directly to the disk
      • Improves performance
      • Enforces file system integrity
      • Does not enforce atomicity of write's



                                                       8
JBD
• JBD can keep the journal on a block device or in a file
   – Enables compatibility with ext2 (the journal is just a
     normal file)
• JBD is independent of ext3-specific data structures
   – Separation of concerns
      • The FS maintains on-disk data and metadata
      • JBD takes care of journaling
   – Code reuse
      • JBD can be used by any other FS that requires
        journaling


                                                         9

Contenu connexe

Tendances

B tree file system
B tree file systemB tree file system
B tree file systemDinesh Gupta
 
Grub2 Booting Process
Grub2 Booting ProcessGrub2 Booting Process
Grub2 Booting ProcessMike Wang
 
Btrfs: Design, Implementation and the Current Status
Btrfs: Design, Implementation and the Current StatusBtrfs: Design, Implementation and the Current Status
Btrfs: Design, Implementation and the Current StatusLukáš Czerner
 
I/O System and Case Study
I/O System and Case StudyI/O System and Case Study
I/O System and Case StudyGRamya Bharathi
 
งานคอมพิม แอม
งานคอมพิม แอมงานคอมพิม แอม
งานคอมพิม แอมJe M'appelle Ammy Kjn
 
b tree file system report
b tree file system reportb tree file system report
b tree file system reportDinesh Gupta
 
Windows 10 Operating System
Windows 10 Operating SystemWindows 10 Operating System
Windows 10 Operating Systemawaisajaz
 
แนวข้อสอบ Os
แนวข้อสอบ Osแนวข้อสอบ Os
แนวข้อสอบ OsChamp Phinning
 
Hpux AdvFS On Disk Structure Scoping
Hpux AdvFS On Disk Structure ScopingHpux AdvFS On Disk Structure Scoping
Hpux AdvFS On Disk Structure ScopingJustin Goldberg
 
แนวข้อสอบระบบปฎิบัติการคอมพิวเตอร์ Os
แนวข้อสอบระบบปฎิบัติการคอมพิวเตอร์ Osแนวข้อสอบระบบปฎิบัติการคอมพิวเตอร์ Os
แนวข้อสอบระบบปฎิบัติการคอมพิวเตอร์ OsChamp Phinning
 
StartUpOpen 2011 - Projekat13
StartUpOpen 2011 - Projekat13StartUpOpen 2011 - Projekat13
StartUpOpen 2011 - Projekat13BlogOpen
 

Tendances (20)

Grub
GrubGrub
Grub
 
B tree file system
B tree file systemB tree file system
B tree file system
 
1.1.a mbr limits v2
1.1.a mbr limits v21.1.a mbr limits v2
1.1.a mbr limits v2
 
Grub2 Booting Process
Grub2 Booting ProcessGrub2 Booting Process
Grub2 Booting Process
 
Btrfs: Design, Implementation and the Current Status
Btrfs: Design, Implementation and the Current StatusBtrfs: Design, Implementation and the Current Status
Btrfs: Design, Implementation and the Current Status
 
เรื่อง 1
เรื่อง 1เรื่อง 1
เรื่อง 1
 
Extlect03
Extlect03Extlect03
Extlect03
 
I/O System and Case Study
I/O System and Case StudyI/O System and Case Study
I/O System and Case Study
 
งานคอมพิม แอม
งานคอมพิม แอมงานคอมพิม แอม
งานคอมพิม แอม
 
OpenZFS dotScale
OpenZFS dotScaleOpenZFS dotScale
OpenZFS dotScale
 
windows 7
windows 7windows 7
windows 7
 
b tree file system report
b tree file system reportb tree file system report
b tree file system report
 
ch17
ch17ch17
ch17
 
Windows 10 Operating System
Windows 10 Operating SystemWindows 10 Operating System
Windows 10 Operating System
 
แนวข้อสอบ Os
แนวข้อสอบ Osแนวข้อสอบ Os
แนวข้อสอบ Os
 
Hpux AdvFS On Disk Structure Scoping
Hpux AdvFS On Disk Structure ScopingHpux AdvFS On Disk Structure Scoping
Hpux AdvFS On Disk Structure Scoping
 
Emu log
Emu logEmu log
Emu log
 
แนวข้อสอบระบบปฎิบัติการคอมพิวเตอร์ Os
แนวข้อสอบระบบปฎิบัติการคอมพิวเตอร์ Osแนวข้อสอบระบบปฎิบัติการคอมพิวเตอร์ Os
แนวข้อสอบระบบปฎิบัติการคอมพิวเตอร์ Os
 
why we need ext4
why we need ext4why we need ext4
why we need ext4
 
StartUpOpen 2011 - Projekat13
StartUpOpen 2011 - Projekat13StartUpOpen 2011 - Projekat13
StartUpOpen 2011 - Projekat13
 

En vedette

Course 102: Lecture 5: File Handling Internals
Course 102: Lecture 5: File Handling Internals Course 102: Lecture 5: File Handling Internals
Course 102: Lecture 5: File Handling Internals Ahmed El-Arabawy
 
Máy cắt dây tia lửa điện (nhóm iii)
Máy cắt dây   tia lửa điện (nhóm iii)Máy cắt dây   tia lửa điện (nhóm iii)
Máy cắt dây tia lửa điện (nhóm iii)tranduyen76
 
dMT SPC Presentation Rotating Equip.-E
dMT SPC Presentation Rotating Equip.-EdMT SPC Presentation Rotating Equip.-E
dMT SPC Presentation Rotating Equip.-Edmtgms
 
Bedrijfspresentatie C2 - The Communication Square
Bedrijfspresentatie C2 - The Communication SquareBedrijfspresentatie C2 - The Communication Square
Bedrijfspresentatie C2 - The Communication SquareValerie Leeman
 
Leermiddelen en leerlijnen
Leermiddelen en leerlijnenLeermiddelen en leerlijnen
Leermiddelen en leerlijnenwimdboer
 
Future of cities meda city congress november 2012
Future of cities   meda city congress november 2012Future of cities   meda city congress november 2012
Future of cities meda city congress november 2012Alain Jordà
 
ICT in (Dutch) schools
ICT in (Dutch) schoolsICT in (Dutch) schools
ICT in (Dutch) schoolswimdboer
 
РИФ+КИБ 2013 // Как создать персонализированный маркетинг? // OZON.ru (Кира Ж...
РИФ+КИБ 2013 // Как создать персонализированный маркетинг? // OZON.ru (Кира Ж...РИФ+КИБ 2013 // Как создать персонализированный маркетинг? // OZON.ru (Кира Ж...
РИФ+КИБ 2013 // Как создать персонализированный маркетинг? // OZON.ru (Кира Ж...Kira Zhestkova
 
Kamaroninfo núm 24. abril 1998
Kamaroninfo núm 24. abril 1998Kamaroninfo núm 24. abril 1998
Kamaroninfo núm 24. abril 1998Josep Miquel
 
Chapter1 introduction-to-design
Chapter1 introduction-to-designChapter1 introduction-to-design
Chapter1 introduction-to-designVin Voro
 
Uth Mag Post Event Achievements - Updated
Uth Mag Post Event Achievements - UpdatedUth Mag Post Event Achievements - Updated
Uth Mag Post Event Achievements - UpdatedUth Mag
 
Cpa network presentation_unisender_conf_prefinal
Cpa network presentation_unisender_conf_prefinalCpa network presentation_unisender_conf_prefinal
Cpa network presentation_unisender_conf_prefinalKira Zhestkova
 

En vedette (20)

Lect10
Lect10Lect10
Lect10
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Course 102: Lecture 5: File Handling Internals
Course 102: Lecture 5: File Handling Internals Course 102: Lecture 5: File Handling Internals
Course 102: Lecture 5: File Handling Internals
 
4. linux file systems
4. linux file systems4. linux file systems
4. linux file systems
 
Máy cắt dây tia lửa điện (nhóm iii)
Máy cắt dây   tia lửa điện (nhóm iii)Máy cắt dây   tia lửa điện (nhóm iii)
Máy cắt dây tia lửa điện (nhóm iii)
 
dMT SPC Presentation Rotating Equip.-E
dMT SPC Presentation Rotating Equip.-EdMT SPC Presentation Rotating Equip.-E
dMT SPC Presentation Rotating Equip.-E
 
Bedrijfspresentatie C2 - The Communication Square
Bedrijfspresentatie C2 - The Communication SquareBedrijfspresentatie C2 - The Communication Square
Bedrijfspresentatie C2 - The Communication Square
 
Leermiddelen en leerlijnen
Leermiddelen en leerlijnenLeermiddelen en leerlijnen
Leermiddelen en leerlijnen
 
Future of cities meda city congress november 2012
Future of cities   meda city congress november 2012Future of cities   meda city congress november 2012
Future of cities meda city congress november 2012
 
ICT in (Dutch) schools
ICT in (Dutch) schoolsICT in (Dutch) schools
ICT in (Dutch) schools
 
РИФ+КИБ 2013 // Как создать персонализированный маркетинг? // OZON.ru (Кира Ж...
РИФ+КИБ 2013 // Как создать персонализированный маркетинг? // OZON.ru (Кира Ж...РИФ+КИБ 2013 // Как создать персонализированный маркетинг? // OZON.ru (Кира Ж...
РИФ+КИБ 2013 // Как создать персонализированный маркетинг? // OZON.ru (Кира Ж...
 
Extlect01
Extlect01Extlect01
Extlect01
 
Anna col
Anna colAnna col
Anna col
 
Kamaroninfo núm 24. abril 1998
Kamaroninfo núm 24. abril 1998Kamaroninfo núm 24. abril 1998
Kamaroninfo núm 24. abril 1998
 
Chapter1 introduction-to-design
Chapter1 introduction-to-designChapter1 introduction-to-design
Chapter1 introduction-to-design
 
Waterfall video
Waterfall videoWaterfall video
Waterfall video
 
JAXB
JAXBJAXB
JAXB
 
Uth Mag Post Event Achievements - Updated
Uth Mag Post Event Achievements - UpdatedUth Mag Post Event Achievements - Updated
Uth Mag Post Event Achievements - Updated
 
Monterey Slides
Monterey SlidesMonterey Slides
Monterey Slides
 
Cpa network presentation_unisender_conf_prefinal
Cpa network presentation_unisender_conf_prefinalCpa network presentation_unisender_conf_prefinal
Cpa network presentation_unisender_conf_prefinal
 

Similaire à Lect11

Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Ahmed El-Arabawy
 
Osdc2011.ext4btrfs.talk
Osdc2011.ext4btrfs.talkOsdc2011.ext4btrfs.talk
Osdc2011.ext4btrfs.talkUdo Seidel
 
Learn about log structured file system
Learn about log structured file systemLearn about log structured file system
Learn about log structured file systemGang He
 
ext2-110628041727-phpapp02
ext2-110628041727-phpapp02ext2-110628041727-phpapp02
ext2-110628041727-phpapp02Hao(Robin) Dong
 
TLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsTLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsShu-Yu Fu
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in LinuxHenry Osborne
 
Do journaling filesystems guarantee against corruption after a power failure (1)
Do journaling filesystems guarantee against corruption after a power failure (1)Do journaling filesystems guarantee against corruption after a power failure (1)
Do journaling filesystems guarantee against corruption after a power failure (1)Rudhramoorthi Andiappan
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copyShay Cohen
 
Zarafa SummerCamp 2012 - Z-push 2.0 changes for administrators
Zarafa SummerCamp 2012 - Z-push 2.0 changes for administratorsZarafa SummerCamp 2012 - Z-push 2.0 changes for administrators
Zarafa SummerCamp 2012 - Z-push 2.0 changes for administratorsZarafa
 
Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)MongoDB
 
OSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
OSDC 2011 | Enterprise Linux Server Filesystems by Remo RickliOSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
OSDC 2011 | Enterprise Linux Server Filesystems by Remo RickliNETWAYS
 
Installing Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsInstalling Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsKevin OBrien
 
Linuxkongress2010.gfs2ocfs2.talk
Linuxkongress2010.gfs2ocfs2.talkLinuxkongress2010.gfs2ocfs2.talk
Linuxkongress2010.gfs2ocfs2.talkUdo Seidel
 
PostgreSQL + ZFS best practices
PostgreSQL + ZFS best practicesPostgreSQL + ZFS best practices
PostgreSQL + ZFS best practicesSean Chittenden
 

Similaire à Lect11 (20)

Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)
 
Osdc2011.ext4btrfs.talk
Osdc2011.ext4btrfs.talkOsdc2011.ext4btrfs.talk
Osdc2011.ext4btrfs.talk
 
Lect09
Lect09Lect09
Lect09
 
Ext filesystem4
Ext filesystem4Ext filesystem4
Ext filesystem4
 
Os
OsOs
Os
 
XFS.ppt
XFS.pptXFS.ppt
XFS.ppt
 
Learn about log structured file system
Learn about log structured file systemLearn about log structured file system
Learn about log structured file system
 
ext2-110628041727-phpapp02
ext2-110628041727-phpapp02ext2-110628041727-phpapp02
ext2-110628041727-phpapp02
 
TLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsTLPI Chapter 14 File Systems
TLPI Chapter 14 File Systems
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
Do journaling filesystems guarantee against corruption after a power failure (1)
Do journaling filesystems guarantee against corruption after a power failure (1)Do journaling filesystems guarantee against corruption after a power failure (1)
Do journaling filesystems guarantee against corruption after a power failure (1)
 
main memory
main memorymain memory
main memory
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copy
 
Zarafa SummerCamp 2012 - Z-push 2.0 changes for administrators
Zarafa SummerCamp 2012 - Z-push 2.0 changes for administratorsZarafa SummerCamp 2012 - Z-push 2.0 changes for administrators
Zarafa SummerCamp 2012 - Z-push 2.0 changes for administrators
 
Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)
 
os
osos
os
 
OSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
OSDC 2011 | Enterprise Linux Server Filesystems by Remo RickliOSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
OSDC 2011 | Enterprise Linux Server Filesystems by Remo Rickli
 
Installing Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsInstalling Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System Considerations
 
Linuxkongress2010.gfs2ocfs2.talk
Linuxkongress2010.gfs2ocfs2.talkLinuxkongress2010.gfs2ocfs2.talk
Linuxkongress2010.gfs2ocfs2.talk
 
PostgreSQL + ZFS best practices
PostgreSQL + ZFS best practicesPostgreSQL + ZFS best practices
PostgreSQL + ZFS best practices
 

Plus de Vin Voro

Tele3113 tut6
Tele3113 tut6Tele3113 tut6
Tele3113 tut6Vin Voro
 
Tele3113 tut5
Tele3113 tut5Tele3113 tut5
Tele3113 tut5Vin Voro
 
Tele3113 tut4
Tele3113 tut4Tele3113 tut4
Tele3113 tut4Vin Voro
 
Tele3113 tut1
Tele3113 tut1Tele3113 tut1
Tele3113 tut1Vin Voro
 
Tele3113 tut3
Tele3113 tut3Tele3113 tut3
Tele3113 tut3Vin Voro
 
Tele3113 tut2
Tele3113 tut2Tele3113 tut2
Tele3113 tut2Vin Voro
 
Tele3113 wk11tue
Tele3113 wk11tueTele3113 wk11tue
Tele3113 wk11tueVin Voro
 
Tele3113 wk10wed
Tele3113 wk10wedTele3113 wk10wed
Tele3113 wk10wedVin Voro
 
Tele3113 wk10tue
Tele3113 wk10tueTele3113 wk10tue
Tele3113 wk10tueVin Voro
 
Tele3113 wk11wed
Tele3113 wk11wedTele3113 wk11wed
Tele3113 wk11wedVin Voro
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wedVin Voro
 
Tele3113 wk9tue
Tele3113 wk9tueTele3113 wk9tue
Tele3113 wk9tueVin Voro
 
Tele3113 wk8wed
Tele3113 wk8wedTele3113 wk8wed
Tele3113 wk8wedVin Voro
 
Tele3113 wk9wed
Tele3113 wk9wedTele3113 wk9wed
Tele3113 wk9wedVin Voro
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wedVin Voro
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wedVin Voro
 
Tele3113 wk7tue
Tele3113 wk7tueTele3113 wk7tue
Tele3113 wk7tueVin Voro
 
Tele3113 wk6wed
Tele3113 wk6wedTele3113 wk6wed
Tele3113 wk6wedVin Voro
 
Tele3113 wk6tue
Tele3113 wk6tueTele3113 wk6tue
Tele3113 wk6tueVin Voro
 
Tele3113 wk5tue
Tele3113 wk5tueTele3113 wk5tue
Tele3113 wk5tueVin Voro
 

Plus de Vin Voro (20)

Tele3113 tut6
Tele3113 tut6Tele3113 tut6
Tele3113 tut6
 
Tele3113 tut5
Tele3113 tut5Tele3113 tut5
Tele3113 tut5
 
Tele3113 tut4
Tele3113 tut4Tele3113 tut4
Tele3113 tut4
 
Tele3113 tut1
Tele3113 tut1Tele3113 tut1
Tele3113 tut1
 
Tele3113 tut3
Tele3113 tut3Tele3113 tut3
Tele3113 tut3
 
Tele3113 tut2
Tele3113 tut2Tele3113 tut2
Tele3113 tut2
 
Tele3113 wk11tue
Tele3113 wk11tueTele3113 wk11tue
Tele3113 wk11tue
 
Tele3113 wk10wed
Tele3113 wk10wedTele3113 wk10wed
Tele3113 wk10wed
 
Tele3113 wk10tue
Tele3113 wk10tueTele3113 wk10tue
Tele3113 wk10tue
 
Tele3113 wk11wed
Tele3113 wk11wedTele3113 wk11wed
Tele3113 wk11wed
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wed
 
Tele3113 wk9tue
Tele3113 wk9tueTele3113 wk9tue
Tele3113 wk9tue
 
Tele3113 wk8wed
Tele3113 wk8wedTele3113 wk8wed
Tele3113 wk8wed
 
Tele3113 wk9wed
Tele3113 wk9wedTele3113 wk9wed
Tele3113 wk9wed
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wed
 
Tele3113 wk7wed
Tele3113 wk7wedTele3113 wk7wed
Tele3113 wk7wed
 
Tele3113 wk7tue
Tele3113 wk7tueTele3113 wk7tue
Tele3113 wk7tue
 
Tele3113 wk6wed
Tele3113 wk6wedTele3113 wk6wed
Tele3113 wk6wed
 
Tele3113 wk6tue
Tele3113 wk6tueTele3113 wk6tue
Tele3113 wk6tue
 
Tele3113 wk5tue
Tele3113 wk5tueTele3113 wk5tue
Tele3113 wk5tue
 

Lect11

  • 2. The ext3 file system • Design goals – Add journaling capability to the ext2 FS – Backward and forward compatibility with ext2 • Existing ext2 partitions can be mounted as ext3 – Leverage the proven ext2 performance – Reuse most of the ext2 code base – Reuse ext2 tools, including e2fsck 2
  • 3. The ext3 journal Option1: Journal FS data Option2: Journal disk block structure updates updates • Example: • Example: – Start transaction – Start transaction – Delete dir entry – Update block #n1 (contains the – Delete i-node dir entry) – Release blocks 32, 17, 60 – Update block #n2 (i-node allocation bitmap) – End transaction – Update block #n3 (data block allocation bitmap) – Add transaction Question: which approach is better? 3
  • 4. The ext3 journal Option1: Journal FS data Option2: Journal disk block structure updates updates ✔ Efficient use of journal space; ✗ Even a small update adds a whole hence faster journaling block to the journal ✗ Individual updates are applied ✔ Multiple updates to the same separately block can be aggregated into a single update ✗ The journaling layer must ✔ The journaling layer is FS- understand FS semantics independent (easier to implement) Ext3 implements Option 2 4
  • 5. Journaling Block Device (JBD) • The ext3 journaling layer is called Journaling Block Device (JBD) • JBD interface ext3fs – Start a new transaction start, update, – Update a disk block as part of a complete transaction JBD – Complete a transaction • Completed transactions are cached in RAM Block device Journal 5
  • 6. Journaling Block Device (JBD) • JBD interface (continued) – Commit: write transaction data to the journal ext3fs • Multiple FS transactions are start, update, committed in one go complete – Checkpoint: flush the journal to JBD the disk • Used when the journal is full or the FS is being unmounted Block device Journal 6
  • 7. Transaction lifecycle in progress Updates are cached in RAM Updates are cached in RAM; no additional completed updates are allowed in the same transaction Updates are written to the journal and committed marked as committed. Transaction can be replayed after an unclean unmount Updates are written to the file system; the checkpointed transaction is removed from the journal 7
  • 8. Journaling modes • Ext3 supports two journaling modes – Metadata+data • Enforces atomicity of all FS operations – Metadata journaling • Metadata is journaled • Data blocks are written directly to the disk • Improves performance • Enforces file system integrity • Does not enforce atomicity of write's 8
  • 9. JBD • JBD can keep the journal on a block device or in a file – Enables compatibility with ext2 (the journal is just a normal file) • JBD is independent of ext3-specific data structures – Separation of concerns • The FS maintains on-disk data and metadata • JBD takes care of journaling – Code reuse • JBD can be used by any other FS that requires journaling 9