Question: Recently had a LVM'd CentOS 6.5 install get accidentally cold-shutdown. On bootup, it says that the home partition need fscking:

```
/dev/mapper/vg_myserver-lv_home: Block bitmap for group 3072 is not in group.  (block 3335668205)

/dev/mapper/vg_myserver-lv_home: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.

```

...but I guess the root partition is OK, since it gives me a shell there. So we run `e2fsck -b 32768 /dev/mapper/vg_myserver/lv_home` and after saying Yes to various fixes, on Pass 5 it just prints endless numbers to the screen, very fast. Once in a while it will print them in neat columns, and if these are block numbers, after a couple hours we are still nowhere near the first 2% being done of our 1.2 TB LV.

I read that you can use `cleap_mmp` with `tune2fs`, but upon trying that, it doesn't accept cleap\_mmp nor list it among valid options.

My question is, how does everyone deal with a corrupt ext4 fs without weeks of downtime? Does everyone have this dilemma, or weeks of downtime vs rebuilding your server / lost data? If so why does anyone use or recommend the use of ext4? Is there some trick I'm missing that would **let me target the specific block/group it's complaining about**, so we can get on with it and mount the home fs again?

Answer: 
If you don't need to do the whole thing in regex, I would do it on two steps: first match all 10-letter words, then filter them for uniqueness. The shortest way I know how to do this is in Perl:

```
perl -nle 'MATCH:while(/\W(\w{10})\W/g){
             undef %seen;
             for(split//,$1){next MATCH if ++$seen{$_} > 1}
             print
           }' your_file

```

Note the additional `\W` anchors to ensure that only words that are exactly 10 characters long are matched.
A Perl solution:

```
perl -lne 'print if (!/(.)(?=$1)/g && /^\w{10}$/)' file

```

but it doesnt work with

```
perl -lne 'print if (!/(.)(?=\1)/g && /^\w{10}$/)' file

```

or

```
perl -lne 'print if ( /(.)(?!$1)/g && /^\w{10}$/)' file

```

tested with perl v5.14.2 and v5.18.2