lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 Feb 2017 16:59:49 -0800
From:   thanumalayan mad <madthanu@...il.com>
To:     linux-ext4@...r.kernel.org
Subject: e2fsck exit codes

Hi all,

I'm trying to figure out a way to tell fsck to inform me and abort if
it suspects disk corruption, but continue otherwise. I thought I knew
how to do this, but I don't.

I did the following experiment: I created a new file system using
mkfs.ext4, mounted it, ran a simple workload on it, and hard-rebooted
the machine during the middle of the workload. After rebooting the
machine, I ran "fsck.ext4 -fy" on the partition. Fsck complains about
wrong inode counts and block counts, and exits with code 1.

Is this the expected behavior? I retried the experiment on a couple of
machines, so I know its not an actual corrupted-drive issue. The
following is an example output of fsck:

root@...py:/home/madthanu# fsck.ext4 -f /dev/sda8
e2fsck 1.42.12 (29-Aug-2014)
/dev/sda8: recovering journal
Clearing orphaned inode 6063 (uid=0, gid=0, mode=0100664, size=2377)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (2710767, counted=2681703).
Fix<y>? no
Free inodes count wrong (698998, counted=684135).
Fix<y>? no
/dev/sda8: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda8: 10/699008 files (80.0% non-contiguous), 83473/2794240 blocks

root@...py:/home/madthanu# echo $?
1

root@...py:/home/madthanu# fsck.ext4 -fy /dev/sda8
e2fsck 1.42.12 (29-Aug-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (2710767, counted=2681703).
Fix? yes
Free inodes count wrong (698998, counted=684135).
Fix? yes
/dev/sda8: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda8: 14873/699008 files (0.1% non-contiguous), 112537/2794240 blocks

root@...py:/home/madthanu# echo $?
1

Is there a correct way to do that? "fsck.ext4 -p" does continue
without complaining much, but as I understand it, it might continue
even if there was disk corruption (so long as fsck has enough
confidence that it restored the correct version of corrupted metadata,
it'll continue).

Thanks,
Thanu

---
(Thanumalayan Sankaranarayana Pillai)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ