Identifying file associated with a bad sector on ext2/ext3/ext4

Monday, April 16, 2018


I got some SMART warnings about a bad sector on my hard drive, and I wanted to know which specific file had the bad sector.

First, I looked at the SMART logs to see where the problem was:

# smartctl -x /dev/sdd
...

  After command completion occurred, registers were:
  ER -- ST COUNT  LBA_48  LH LM LL DV DC
  -- -- -- == -- == == == -- -- -- -- --
  40 -- 51 00 08 00 00 04 4b 5b c0 40 00  Error: UNC at LBA = 0x044b5bc0 = 72047552

...

fdisk -l is useful for looking at the partition info and sector size:

# fdisk -l /dev/sdd
Disk /dev/sdd: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x54afc7e9

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdd1        2048 3907029167 3907027120  1.8T 83 Linux

Then I used badblocks to look around that physical sector for more bad sectors. My sector size is 512 bytes, shown above; also, badblocks takes the end sector number first, followed by the start sector:

# badblocks -b 512 /dev/sdd 72047570 72047540
72047552
72047553
72047554
72047555
72047556
72047557
72047558
72047559
72047560

Finally, debugfs is useful for finding which files are on those blocks.

Explanation:

  1. First, find the logical filesystem block number by computing (physical sector - partition start sector) * (physical sector size / filesystem block size). In my case, this would be (72047552 − 2048) * (512 / 4096) = 9005688. Since there are 9 contiguous sectors affected, the bad area stretches into block 9005689 as well.
  2. Use testb to see whether there is actually anything there. If not, then no data is lost.
  3. Use icheck to find the inode corresponding to those blocks. Luckily (?), both bad blocks are associated with the same inode here.
  4. Finally, use ncheck to find the pathname(s) associated with the inode.
# debugfs /dev/sdd1
debugfs 1.43.5 (04-Aug-2017)
debugfs:  testb 9005688
Block 9005688 marked in use
debugfs:  testb 9005689
Block 9005689 marked in use
debugfs:  icheck 9005688
Block   Inode number
9005688 105518423
debugfs:  icheck 9005689
Block   Inode number
9005689 105518423
debugfs:  ncheck 105518423
Inode   Pathname
105518423       /drz/rdiff-backup/artanis/var/lib/pgsql/data/base/21595/26720

Here, it was just a backup file, so once I swap out the hard drive or reallocate the sector, the next backup cycle will fix the lost data.

Tags: linux | Posted at 22:57 | Comments (15)


Comments

Davidadogs on Friday, January 17, 2020 at 14:10

Выгодно обменяем Ваш частный дом на квартиру. Звоните! Мы работаем на результат


E-mail: info@AlfaAgent.by; Сайт: https://AlfaAgent.by/obmen-kvartir

inetryconydot on Friday, January 17, 2020 at 22:40

<a href=http://rebizsearch.com/in.cgi?5&group=BgMeds&parameter=Amoxil><b>Buy Cheapest <font color=red>Amoxicillin</font> High Quality!</b></a>


<font color=green>* Secure ordering!
* Free Shipping Worldwide
* Lowest price guaranteed!
* Fully licensed pharmacy
* NO PRESCRIPTION REQUIRED
* Superior customer service 24/7 -- Very easy to get Amoxicillin online!
* 100% Satisfaction Guaranteed
* We accept: VISA, MasterCard, E-check, AMEX and more.</font>

<b>Amoxicillin (Amoxil)</b> is used to treat infections due to organisms that are susceptible to the effects of amoxicillin. Common infections that amoxicillin is used for include infections of the middle ear, tonsils, throat, larynx (laryngitis), bronchi (bronchitis), lungs (pneumonia), urinary tract, and skin. It also is used to treat gonorrhea.

<a href=http://rebizsearch.com/in.cgi?5&group=BgMeds&parameter=Amoxil><b>Order Cheap <font color=red>Amoxicillin</font> High Quality!</b></a>

Amoxicillin © 2008-2013, Top Pharmacy List! * Medication Without A Prescription! * You Can Find: The Best Quality Pills, Special Discount Medication, Full Information, Best Price Pill Or Capsules, Fast Delivery, Alternative Tablets, Fda Approved Brand & Generic Drugs Without Prescription! No Hidden Costs Or Membership Fees, Easy Ordering Process!



<b>Frequently Asked Questions</b>
- Will I get a tracking number after the order is shipped?
- Why are generic drugs cheaper than the brand name ones?
- Why are generic drugs cheaper than the brand name ones?


































Related search:
Amoxicillin No Prescription
<b>Amoxicillin Sinus Infection</b>
Online Amoxicillin Canada
<quote>read news...</quote>
Amoxicillin For Cats
Buy Amoxicillin Online In Adelaide
Buy Amoxicillin cheap
Woman Taking Amoxicillin In Canada
Buy Amoxicillin Without Prescription
Buy Amoxicillin Online Canadian
Amoxicillin
Amoxicillin Cheap Lethbridge
Allergic Reactions To Amoxicillin
Buy Amoxicillin Online In Greece
Purchase Amoxicillin Canada
Buy Amoxicillin
Buy Amoxicillin Uk
<b>Amoxicillin Buy</b>
Amoxicillin For Sinus Infection
How To Buy Amoxicillin In Mckinney
Amoxicillin Online Discount Virginia
Buy Amoxicillin In St Louis
Buy Amoxicillin Online
Amoxicillin 500 Mg
Prescription Online No Doctor Amoxicillin Carrollton
Amoxicillin Tablets
<quote>read more...</quote>
<i>Amoxicillin Antibiotic Side Effects</i>
Amoxicillin For Sale
<b>Allergic Reactions To Amoxicillin</b>
Order Amoxicillin Online Discount Nevada
Over The Counter Amoxicillin
Buying Amoxicillin Over The Internet Forum
Amoxicillin Allergy
Order Amoxicillin Online Discount Wisconsin
Amoxicillin Sinus Infection
Online Pharmacy In Dubai Uae
Buy Amoxicillin Without Prescription
<i>Amoxicillin Rash</i>
<quote>...</quote>
Bu Amoxicillin Online In Sydney
No Prescription For Sale Amoxicillin Kalifornien
Buy Amoxicillin In Spain
Order Amoxicillin Online Discount Ohio
Free Amoxicillin Online In Montreal
Generic Amoxicillin
Order Amoxicillin Canada
What Is Amoxicillin Used For
Buy Insulin U.S. Pharmacy Online
Amoxicillin Online
Online Amoxicillin Canada
Amoxicillin Online
Amoxicillin Buy Online Cod Wyoming
Amoxicillin No Prescription
Generic Fast Delivery No Prescription Amoxicillin Connecticut
Amoxicillin Uk Cheap Purchase Buy
Over The Counter Amoxicillin
Amoxicillin 500 Mg
<b>Order Amoxicillin Online</b>
Amoxicillin Buy
Ordering Amoxicillin United States Without A Prescription
Cheapest Amoxicillin Uk Cheap
Buy Amoxicillin Without Prescription
Amoxicillin Non Prescr'S Illinois
Buy Amoxicillin Online In Belgium
Amoxicillin 250mg
<i>No Prescription Us Master Amoxicillin San Francisco</i>

Amoxicillin No Prescription In Victoria
What Is Amoxicillin Used For
Order Amoxicillin
Amoxicillin Packages Uk
Amoxicillin Free Consultation Fedex Overnight Delivery Buy In Amarillo
Amoxicillin Tablets
Buy Amoxicillin In Adelaide
Generic Amoxicillin In United States
Buy Amoxicillin Online Pharmacy Birmingham
No Cost Prescription For Amoxicillin Texas
Amoxicillin 500 Mg
Amoxicillin Cod Fedex Hawaii
Buy Amoxicillin Online In Bradford
Order Amoxicillin
Best Online Price Amoxicillin Sale Amoxicillin In Usa & Uk & Sverige Discount Tablets
Amoxicillin Sinus Infection
Soft Tabs No Prescription Amoxicillin Ohio
Amoxicillin For Dogs
Chinese Herbal Female Amoxicillin In The Uk
Purchase+discret+quick,Order Cheapest Amoxicillin In Sydney For Sale No Script
Amoxicillin Online Without Prescription
<quote>USA TODAY NEWS...</quote>
Generic Amoxicillin
Amoxicillin In Western Australia
Buy Amoxicillin Edinburgh
Amoxicillin Amoxil
Buy Amoxicillin Prescriptions Online In Fremont
Amoxicillin Overinght Delivery To Australia
Amoxil Amoxicillin
Amoxicillin Order Online Los Angeles
Buy Amoxicillin Online Buy In Wiesbaden
<b>Amoxicillin Buy</b>
Buy Amoxicillin Without Prescription
Amoxicillin Fast Delivery To Holland
Buy Amoxicillin Cheap In Poland
Walgreens No Prescription Amoxicillin Jersey City
How To Buy Amoxicillin In Canada For A Canadian
Amoxicillin Generic
Buy Amoxicillin Sydney Australia
Amoxicillin Online Usa
What Is Amoxicillin Used For
<b>Amoxicillin Antibiotic</b>
Amoxicillin Fast Delivery To Us
Amoxicillin Online Pharmacy Brentford
Amoxicillin For Sale No Script Brisbane
Buy Amoxicillin Now Online In Concord
Amoxicillin Tablets
Amoxicillin Tablets For Sale Uk
Amoxicillin Rash
Buy Amoxicillin In Spain
Amoxicillin Online
No Prescription Us Pharmacy Master Card Amoxicillin Miami
<b>Amoxicillin Without Prescription</b>
Saturday Delivery On Amoxicillin Buy In Muenster
Where Can I Purchase Amoxicillin In Brazil
Order Online No Prescription Amoxicillin Texas
What Is Amoxicillin Used For
Amoxicillin Online Without Prescription

Michaelesori on Saturday, January 18, 2020 at 00:32

Все для дома и ремонта: http://35stupenek.ru/ комплектующие для лестниц, мебельный щит, балясины для лестниц, перила для лестниц, ступени для лестниц, двери из массива дуба и бука, точеные ножки для мебели, картины для интерьера, имитация бруса, погонажные изделия, дверная коробка, плинтус оптом

XRumerTest on Saturday, January 18, 2020 at 03:56

Hello. And Bye.

psype on Saturday, January 18, 2020 at 04:15

<a href=https://compoundingpharmacyusa.com/predcor.html>Predcor</a>






http://www.anavin.ir/danesh/%D9%85%D9%88%D8%B3%D8%B3%D9%87-%D8%A2%D9%85%D9%88%D8%B2%D8%B4-%D8%B9%D8%A7%D9%84%DB%8C-%D8%BA%DB%8C%D8%B1%D8%A7%D9%86%D8%AA%D9%81%D8%A7%D8%B9%DB%8C-%D8%A7%DB%8C%D9%88%D8%A7%D9%86%DA%A9%DB%8C/

fktrpr94f

EdwardlaM on Saturday, January 18, 2020 at 10:42

Birdman Coffee and Books Check out this laid-back hangout for supper and songwriter nights, workshops and more on select Mondays not to mention great coffee, baked goods and breakfast every day of the week.
Cite this article Pick a style below, and copy the text for your bibliography.
BentoNet Applikationen unendlich viele Möglichkeiten.
http://mezibarkegularasida.info/full-album/-4.php You can filter globally to show relevant items across all your lists, or you can filter within a specific list to see a more pertinent short-list of actions.
He told Q magazine May 2009.
Like you, they work hard and care about the work they do.

inetryconydot on Sunday, January 19, 2020 at 11:37

<a href=http://rebizsearch.com/in.cgi?5&group=BgMeds&parameter=Amoxil><b>Buy Cheapest <font color=red>Amoxicillin</font> High Quality only!</b></a>


<font color=green>* Secure ordering!
* Free Shipping Worldwide
* Lowest price guaranteed!
* Fully licensed pharmacy
* NO PRESCRIPTION REQUIRED
* Superior customer service 24/7 -- Very easy to get Amoxicillin online!
* 100% Satisfaction Guaranteed
* We accept: VISA, MasterCard, E-check, AMEX and more.</font>

<b>Amoxicillin (Amoxil)</b> is used to treat infections due to organisms that are susceptible to the effects of amoxicillin. Common infections that amoxicillin is used for include infections of the middle ear, tonsils, throat, larynx (laryngitis), bronchi (bronchitis), lungs (pneumonia), urinary tract, and skin. It also is used to treat gonorrhea.

<a href=http://rebizsearch.com/in.cgi?5&group=BgMeds&parameter=Amoxil><b>Order Cheap <font color=red>Amoxicillin</font> High Quality!</b></a>

Amoxicillin © 2008-2013, Top Pharmacy List! * Medication Without A Prescription! * You Can Find: The Best Quality Pills, Special Discount Medication, Full Information, Best Price Pill Or Capsules, Fast Delivery, Alternative Tablets, Fda Approved Brand & Generic Drugs Without Prescription! No Hidden Costs Or Membership Fees, Easy Ordering Process!



<b>Frequently Asked Questions</b>
- Do you sell generic pills or brand medicines?
- What if I didn't find an answer to my question here?
- What is the quality of generic drugs?


































Related search:
Amoxicillin Without Prescription
<b>Amoxicillin 250mg</b>
Amoxicillin Fast Delivery To Israel
<quote>read news...</quote>
Amoxicillin 250mg
Buy Amoxicillin Online In South Australia
Buy Amoxicillin Online
Purchase Cheap Amoxicillin In Washington Ordering Without Dr
Amoxicillin 500
Buy Amoxicillin Online In Europe
Expired Amoxicillin
Walgreens No Prescription Amoxicillin Jersey City
Amoxicillin Clavulanic
Buy No Rx Cheap Order Amoxicillin In Liverpool Buy Online Cod
Amoxicillin Impotence Pill In Vermont
Amoxicillin Sinus Infection
Amoxicillin Over The Counter
<b>Amoxicillin 500mg Capsule</b>
Amoxicillin No Prescription
Discount Amoxicillin Uk
Generic No Prescription Buyers Guide Amoxicillin Alabama
Buy Cheap Amoxicillin In The Us
Amoxicillin 875 Mg
Amoxicillin Online Without Prescription
Purchase Amoxicillin In Yonkers
Amoxicillin 500 Mg
<quote>read more...</quote>
<i>Buy Amoxicillin Online No Prescription</i>
Buy Amoxicillin Online No Prescription
<b>Order Amoxicillin</b>
Amoxicillin Online Usa
Buy Amoxicillin Uk
Buy Amoxicillin Online In Arkansas
Amoxicillin 250mg
Cheap Online Order Amoxicillin Buy In Pau
Amoxicillin Acne
Amoxicillin Mail Order New Mexico
Amoxicillin Without Prescription
<i>Amoxicillin Buy</i>
<quote>...</quote>
Cheapest Amoxicillin To Buy Online In Ventura
Amoxicillin Orlando
Buy Amoxicillin Uk
Amoxicillin In Norman
Buying Original Amoxicillin In Germany
Amoxicillin Capsules
Ordering Amoxicillin From Canada
Amoxicillin Trihydrate
Cheapest Amoxicillin In France!
Amoxicillin Clavulanate
<b>Amoxicillin 500mg Capsule</b>
Amoxicillin 500 Mg
Amoxicillin For Cheap In Alabama
Amoxicillin Dosage For Sinus Infection
Amoxicillin Overinght Tel Aviv
Online Orderable Buy Amoxicillin Sale Amoxicillin In Usa Buy Online Prescription
Order Amoxicillin
Amoxicillin Acne
<b>Buy Amoxicillin</b>
Amoxicillin 500mg
Amoxicillin Ohne Rezept Hampton
High Quality Purchase Amoxicillin In Usa Without Prescr'S
Amoxicillin Antibiotic Side Effects
Amoxicillin Buy Online Cod Alabama
Amoxicillin Buy In Alabama Online
Order Amoxicillin Online
<i>Purchase Amoxicillin In Colorado</i>

Amoxicillin Pills Without Prescription
Generic Amoxicillin
Buy Amoxicillin Uk
Where To Buy Levitra Cialis No Prescription Amoxicillin Alabama
Amoxicillin Shipped Overnight No Rx At Sweden
Amoxicillin Price
Buy Amoxicillin In Los Angeles Usa
Cheap Amoxicillin Buy Pills In England
Can You Buy Amoxicillin In Michigan
No Prescription Low Price Amoxicillin Waco
Amoxicillin Tablets
Free With No Prescription Amoxicillin Scottsdale
Acheter,Acquisto,Purchase Amoxicillin Sale Amoxicillin In Sydney Discount Tablets
Amoxicillin During Pregnancy
At Discounted Prices Amoxicillin Sale Amoxicillin In Montana Discount Tablets
Amoxicillin Chlamydia
Amoxicillin Free Usa Shipping.
What Is Amoxicillin Used For
Buying Amoxicillin Pain Relief No Script Washington
Amoxicillin Online Pharmacy Tennessee
Amoxicillin Sinus Infection
<quote>USA TODAY NEWS...</quote>
Expired Amoxicillin
Amoxicillin Purchase Uk
Buy Amoxicillin In St Louis
Order Amoxicillin Online
No Prescription Needed Amoxicillin Georgia
Can You Buy Amoxicillin Over The Counter In The Us
Amoxicillin Chlamydia
Order Cheap Buy Order Cheap Amoxicillin In Sheffield Online No Script
Amoxicillin Prices San Diego
<b>Amoxicillin 250mg</b>
Amoxicillin Antibiotic
Best Buy Online Sale Amoxicillin In Los Angeles
Buy Amoxicillin Online In Mexico City.
Order Amoxicillin Online Discount Washington
Lowest Price Where To Buy Buy Amoxicillin Sale Amoxicillin In North Carolina Discount Tablets
Cheap Amoxicillin
Buy Order Amoxicillin Sale Amoxicillin In Usa Purchase Online
Cheapest Place To Buy Buy Amoxicillin Online Buy In Lafayette
Amoxicillin 875 Mg
<b>Amoxicillin 250mg</b>
Buy Generic Amoxicillin Us
Amoxicillin Non Prescr'S Illinois
Victoria Amoxicillin
Getting Amoxicillin In Canada
Amoxicillin Dosage For Sinus Infection
Canadian Pharmacy No Prescription Amoxicillin Norfolk
Amoxicillin Acne
Buy Amoxicillin Online In Uk
Amoxicillin Augmentin
Cheap Online Order Amoxicillin Buy In Pau
<b>Amoxicillin Antibiotic</b>
Free With No Prescription Amoxicillin Scottsdale
Buy Amoxicillin Online In Canada
Generic Cialis No Prescription Amoxicillin Birmingham
Order Amoxicillin
Amoxicillin Tablets

DennisJoync on Monday, January 20, 2020 at 16:42

Реклама, продажи http://1541.ru/cms/reklama.php SEO на Pinterest, в Pinterest, 220 usd за месяц

MauriceCem on Tuesday, January 21, 2020 at 02:20

Осторожно! Внимание! <a href=https://gipermarket-gorod-dverej.ua/>Не выполняют условия договора</a>. Не связывайтесь с Городом дверей ни при каких условиях. Вас просто разведут и кинут. У клиентов только плохие отзывы об этой конторе. Все положительные отзывы пишут на заказ.

Davidadogs on Wednesday, January 22, 2020 at 10:46

Обменяем вашу квартиру Быстро и на Выгодных условиях. Оплата по факту. Звоните!


E-mail: info@AlfaAgent.by; Сайт: https://AlfaAgent.by/obmen-kvartir

psype on Wednesday, January 22, 2020 at 18:51

Same with the particular gum or lozenges.

<a href=https://farmaciadanivan2.com/primadox.html>Primadox</a>

Assuming there are no stores near you, you may order a computer and have it delivered.


Having a fantastic effect on our body as a whole, and with a good inherent ability to satisfy an individual’s particular health shortfalls, the benefits of a regular dose of Ginseng Extract by means of a tea are manifold.

<a href=https://lafarmaciadeifarmacisti.com/airomir.html>Airomir</a>

I have spoken to many people who have experienced dependancy or more severe sleep problems than when they first took zopiclone after taking it.

http://drsunilgupta.com/274-pr7jalqb096efod916425-28364.html

fktrpr94f
For many people who have a headache or some other minor pain, Tylenol, Advil and Aleve are the brands commonly reached for.

DennisJoync on Thursday, January 23, 2020 at 22:54

Реклама в Pinterest самая эффективная по продажам https://youtu.be/gjll0jf-Itw для интернет магазинов, ebay, etsy, amazon

Michaelesori on Friday, January 24, 2020 at 16:15

Заказать Продвижение, рекламу, SEO http://1541.ru/cms/reklama.php in Pinterest, 220 usd за месяц

Ustimchukzoose on Saturday, January 25, 2020 at 01:09

http://bit.ly/37s3dPW - best article writing service
UNFOLD THE BENEFITS OF HIRING PROFESSIONAL ESSAY WRITERS ONLINE
In an ideal world, college writing would be a good way to express yourself creatively. You would have a flash of insight, find a smart solution to a challenging problem, and commit everything to paper.
Alas, graduate writing sessions are fleeting moments of questionable fun restricted by the confines of English grammar and mind-boggling instructions.
All of that changes with our writing essay services – a next-gen way to hire essay writers online. If you are stuck, request the assistance of a quick essay writer today!
A few hours, and you’ll have a perfect paper on your computer. It’s that easy!
http://bit.ly/2tpE9u7 - resume writing services


For partners http://bit.ly/2Qebt05

<a href=http://casinoschoolonline.com/forum/viewtopic.php?p=892249#892249>I need help writing a essay</a> <a href=http://www.elizabethrosephotographer.com/?page_id=2#comment-172837>Magic essay writer</a> <a href=http://ricardomalta.net/mural/index.php>Web content writing services</a> 07961e9

Donnagar on Saturday, January 25, 2020 at 02:20

Вы не правы. Могу это доказать. Пишите мне в PM, пообщаемся.


------
[url=http://resjohnwa.info/services/Planilla-calculo-prestamo-sistema-frances.html]simulacion prestamo banco frances[/url]


...абсурд не в человеке и не в мире, но в их совместном присутствии


------
[url=http://dedinttot.info/catalogtree/Requisitos-prestamo-banco-santander.html]requisitos para sacar un prestamo en santander[/url]

Add a comment

Name:
Email: (optional, not displayed to public)
URL:

Comment: