How to view filesystem journal data in Linux ?

In this article we will look how to view the filesystem journal data in Linux.

I hope everyone is aware of journalism in ext3/ext4 filesystem.

A journaled filesystem is a filesystem that maintains filesystem block data inside a special file known as “journal” that can be used to repair any problems or inconsistencies on the filesystem occured due to improper shutdown of the system.
Abnormal shutdowns can occur due to software issues or interruption of the power supply that cannot be resolved without a reboot.

To check the journal metadata of our filesystem, we can use logdump option inside debugfs command line utility like below.

[root@nglinux ~]# debugfs /dev/sda1
debugfs 1.41.12 (17-May-2010)
debugfs:  logdump
Journal starts at block 23333, transaction 10932
Found expected sequence 10932, type 1 (descriptor block) at block 23333
Found expected sequence 10932, type 2 (commit block) at block 23340
Found expected sequence 10933, type 1 (descriptor block) at block 23341
Found expected sequence 10933, type 2 (commit block) at block 23362
Found expected sequence 10934, type 1 (descriptor block) at block 23363
Found expected sequence 10934, type 2 (commit block) at block 23366
Found expected sequence 10935, type 1 (descriptor block) at block 23367
Found expected sequence 10935, type 2 (commit block) at block 23383
Found expected sequence 10936, type 1 (descriptor block) at block 23384
Found expected sequence 10936, type 2 (commit block) at block 23397
Found expected sequence 10937, type 1 (descriptor block) at block 23398
Found expected sequence 10937, type 2 (commit block) at block 23406
Found expected sequence 10938, type 1 (descriptor block) at block 23407
Found expected sequence 10938, type 2 (commit block) at block 23418
Found expected sequence 10939, type 1 (descriptor block) at block 23419
Found expected sequence 10939, type 2 (commit block) at block 23430
Found expected sequence 10940, type 1 (descriptor block) at block 23431
Found expected sequence 10940, type 2 (commit block) at block 23440
Found expected sequence 10941, type 1 (descriptor block) at block 23441
Found expected sequence 10941, type 2 (commit block) at block 23444
Found expected sequence 10942, type 1 (descriptor block) at block 23445
Found expected sequence 10942, type 2 (commit block) at block 23454
Found expected sequence 10943, type 1 (descriptor block) at block 23455
Found expected sequence 10943, type 2 (commit block) at block 23465
Found expected sequence 10944, type 1 (descriptor block) at block 23466
Found expected sequence 10944, type 2 (commit block) at block 23477
Found expected sequence 10945, type 1 (descriptor block) at block 23478
Found expected sequence 10945, type 2 (commit block) at block 23486
Found expected sequence 10946, type 1 (descriptor block) at block 23487
Found expected sequence 10946, type 2 (commit block) at block 23493
Found expected sequence 10947, type 1 (descriptor block) at block 23494
Found expected sequence 10947, type 2 (commit block) at block 23500
Found expected sequence 10948, type 1 (descriptor block) at block 23501
Found expected sequence 10948, type 2 (commit block) at block 23507
Found expected sequence 10949, type 1 (descriptor block) at block 23508
Found expected sequence 10949, type 2 (commit block) at block 23517
Found expected sequence 10950, type 1 (descriptor block) at block 23518
Found expected sequence 10950, type 2 (commit block) at block 23523
Found expected sequence 10951, type 1 (descriptor block) at block 23524
Found expected sequence 10951, type 2 (commit block) at block 23528
Found expected sequence 10952, type 1 (descriptor block) at block 23529
Found expected sequence 10952, type 2 (commit block) at block 23533
Found expected sequence 10953, type 1 (descriptor block) at block 23534
Found expected sequence 10953, type 2 (commit block) at block 23538
Found expected sequence 10954, type 2 (commit block) at block 23539
Found expected sequence 10955, type 1 (descriptor block) at block 23540
Found expected sequence 10955, type 2 (commit block) at block 23551
Found expected sequence 10956, type 1 (descriptor block) at block 23552
Found expected sequence 10956, type 2 (commit block) at block 23563
Found expected sequence 10957, type 1 (descriptor block) at block 23564
Found expected sequence 10957, type 2 (commit block) at block 23573
Found expected sequence 10958, type 1 (descriptor block) at block 23574
Found expected sequence 10958, type 2 (commit block) at block 23577
Found expected sequence 10959, type 1 (descriptor block) at block 23578
Found expected sequence 10959, type 2 (commit block) at block 23582
Found expected sequence 10960, type 1 (descriptor block) at block 23583
Found expected sequence 10960, type 2 (commit block) at block 23585
Found expected sequence 10961, type 1 (descriptor block) at block 23586
Found expected sequence 10961, type 2 (commit block) at block 23595
Found expected sequence 10962, type 1 (descriptor block) at block 23596
Found expected sequence 10962, type 2 (commit block) at block 23600
Found expected sequence 10963, type 1 (descriptor block) at block 23601
Found expected sequence 10963, type 2 (commit block) at block 23610
Found expected sequence 10964, type 1 (descriptor block) at block 23611
Found expected sequence 10964, type 2 (commit block) at block 23622
Found expected sequence 10965, type 1 (descriptor block) at block 23623
Found expected sequence 10965, type 2 (commit block) at block 23632
Found expected sequence 10966, type 1 (descriptor block) at block 23633
Found expected sequence 10966, type 2 (commit block) at block 23639
Found expected sequence 10967, type 1 (descriptor block) at block 23640
Found expected sequence 10967, type 2 (commit block) at block 23647
Found expected sequence 10968, type 1 (descriptor block) at block 23648
Found expected sequence 10968, type 2 (commit block) at block 23655
Found expected sequence 10969, type 1 (descriptor block) at block 23656
Found expected sequence 10969, type 2 (commit block) at block 23660
Found expected sequence 10970, type 1 (descriptor block) at block 23661
Found expected sequence 10970, type 2 (commit block) at block 23670
Found expected sequence 10971, type 1 (descriptor block) at block 23671
Found expected sequence 10971, type 2 (commit block) at block 23675
Found expected sequence 10972, type 1 (descriptor block) at block 23676

I am still learning about the journal stuff and will post more articles in coming days to let you know soon about this here.

Till that time, just remember that we can view journal log data using logdump option.

In case you can add something to it by posting comments below, it would be great.

Subscribe to this blog here, and stay updated with latest articles.

Leave a Reply

Your email address will not be published.