LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-21-2021, 02:43 PM   #1
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Rep: Reputation: 164Reputation: 164
Simulating a damaged filesystem?


If I wanted to play with filesystem recovery, what would be the best way to create a corrupted/damaged filesystem?
 
Old 12-21-2021, 04:00 PM   #2
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
debugfs; dd seek= a super block or inode
https://techreport.com/forums/viewtopic.php?t=111267
Possibly fsck

OT p.s.: fixing install / boot problems is infinitely more valuable! (Way too commonly happening, especially with varying PC models &distros)

Last edited by !!!; 12-21-2021 at 04:11 PM.
 
Old 12-21-2021, 04:17 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,141

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Most users are actually more interested in recovering their data than the science of recovering the filesystem itself. This is why fsck is so misunderstood.
See my sigline for an easier answer.
 
Old 12-21-2021, 04:27 PM   #4
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
True but the OP might want to learn how to help with such problems, just like my ultimate dream is to be able to instantly and clearly fix any and every install and boot problem
 
Old 12-21-2021, 05:07 PM   #5
michael@actrix
Member
 
Registered: Jul 2003
Location: New Zealand
Distribution: OpenSUSE Tumbleweed
Posts: 68
Blog Entries: 1

Rep: Reputation: 20
Quote:
Originally Posted by SlowCoder View Post
If I wanted to play with filesystem recovery, what would be the best way to create a corrupted/damaged filesystem?
This paper includes a description of the methodology used:
Evaluating File System Reliability on Solid State Drives
Shehbaz Jaffer, Stathis Maneas, Andy Hwang, and Bianca Schroeder, University of Toronto
2019 USENIX Annual Technical Conference
https://www.usenix.org/system/files/atc19-jaffer.pdf
It's quite an interesting paper.

Last edited by michael@actrix; 12-21-2021 at 05:07 PM. Reason: typo
 
1 members found this post helpful.
Old 12-22-2021, 10:22 AM   #6
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Original Poster
Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by syg00 View Post
Most users are actually more interested in recovering their data than the science of recovering the filesystem itself. This is why fsck is so misunderstood.
No worries. I keep copious backups. And I plan to mess with a virtual drive/filesystem.

Quote:
Originally Posted by !!! View Post
True but the OP might want to learn how to help with such problems, just like my ultimate dream is to be able to instantly and clearly fix any and every install and boot problem
Yes, it is my intention to learn more. I haven't experienced an actual corruption in many years. I figure I need to refresh my knowledge.
 
Old 12-22-2021, 11:25 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,954

Rep: Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329
in post #2 you can find a good link. Basically you need to write some random data onto the given partition (for example with dd).
it was already asked: https://www.linuxquestions.org/quest...cue-it-736194/
 
1 members found this post helpful.
Old 01-04-2022, 02:02 PM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,380

Rep: Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336Reputation: 2336
Right atm, I have a damaged filesystem. It's a Toshibs 2.5" platter in a usb3 case. The partition table vanished, so it wouldn't mount. I simulated making a partition, and it had a valid ext4 signature. It was a 600GB backup disk, but started identifying as 1TB

Using parted, I recovered a/the 600G partition, but couldn't mount it, because e2fsck was called for. To make a long story short, one of the bad blocks happens to be filesystem pivotal, and e2fsck kept pointlessly overwriting this, and everything else. Badblocks is chugging away atm.

I'm sure the data is gone, but I'm nearly alone in the world because I don't care. I have a backup of the backup for just this situation . So, what do you want to do?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Disk Partition damaged - how can I rescue damaged partition ray98 Linux - General 7 10-24-2014 08:05 AM
Strategies for recovering JPEG files from a damaged filesystem yello Linux - General 2 12-17-2007 03:22 PM
Cannot mount ext3 filesystem on damaged hard drive Mathieu_G Linux - Hardware 3 04-01-2005 10:51 PM
Repair damaged /var filesystem davep911 Linux - Newbie 1 06-04-2004 08:09 AM
Slackware 9.1: ext3 Filesystem Damaged Chu Linux - General 2 03-01-2004 11:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration