You are not logged in.

#1 2016-06-02 21:57:37

rdata
Member
Registered: 2015-07-12
Posts: 9

Advice on file system recovery wanted

I have a 1 Tb disk that fails to mount using

mount /dev/sdb1 /mountpoint

but can be mounted with

mount -o sb=131072,ro /dev/sdb1 /mountpoint

When mounted using the first backup superblock the vast majority of data in the disk appears to be valid. Most of the data are files ranging from 500mb to 1gb in size. A few small .jpgs seem to be missing but that's all the damage I found so far.

Free space is being wrongly reported tho. df -h

Filesystem                Size      Used Available
/dev/sdb1               916.9G    199.6M    870.1G

Actually, there are only 50G left on the disk. It's mostly full.


e2fsck -n  /dev/sdb1 says :

e2fsck: Superblock invalid, trying backup blocks...
One or more block group descriptor checksums are invalid.  Fix? no

Group descriptor 0 checksum is invalid.  IGNORED.
Group descriptor 1 checksum is invalid.  IGNORED.
..................
Group descriptor 7452 checksum is invalid.  IGNORED.

*comment : checksum for group descriptors from 0 to 7452, all invalid]
then there are a bunch of messages like this one :

Entry 'file_name' in /path/to/file (46268779) has deleted/unused inode 81.  Clear? no

Entry 'file_name' in /path/to/file (46268779) has an incorrect filetype (was 1, should be 0).
Fix? no

*comment : most of the files listed there are files that I already deleted a while back when the disk was working.

Pass 3: Checking directory connectivity
/lost+found is not a directory (ino=19)
Unlink? no

Pass 4: Checking reference counts
Inode 2 ref count is 10, should be 9.  Fix? no

Pass 5: Checking group summary information
Block bitmap differences:  -(9250--9253) -9255 -(9258--31781) -(33793--34102) -(34112--34175) -(34206--34219) -(34223--34432) -(34436--34439) -(34448--34463) -(34484--34491) -(34592--34599) -(34601--34757) -(34760--34767) -(95620--95743) -(95888--95935) -(95987--95991) -(96000--96277) -(99466--99839) -(99930--100349) -(164865--165119) -(165365--165503) -(165608--165837) -(230402--230645) -(295937--296191) -(296366--296447) -(296739--296959) -(314659--314879) -(315172--315359) -(382977--384336) -(384486--384729) -(384768--385023) -(488904--489391) -(494884--495103) -(495396--495496) -(532512--557049) -(565994--565995) -(566592--566783) -(567168--567295) -(635188--636590) -(692874--693205) -(48922624--48959734) -(51779584--51802111) -(52865024--52906157) -(53645568--53646591) -(53655552--53672959) -(53673984--53693936) -(98697216--98699263) -(107882496--107905130) -(118384640--118469209) -(118470656--118489087) -(118521856--118536191) -118669313 -(129722368--129765918) -(130158592--130194815) -(130195456--130197503) -(132167680--132169727) -(132206592--132356961) -(132358144--132393702) -(132636672--132644863) -(132677632--132687871) -132873639 -(133011456--133082028) -(133222400--133231459) -(133232640--133267456) -(133269504--133275647) -(133445632--133484543) -(133584896--133595135) -(135067648--135108614) -(135110656--135126945) -(135127040--135260160) -(135262208--135266303) -(135299072--135319551) -(135608320--135741440) -(135743488--135790591) -(135823360--135941427) -(135942144--136005485) -(136005632--136037139) -(136038400--136057991) -(136058880--136086874) -(136087552--136097791) -(136564736--136611180) -(139235417--139236798) -(139237376--139267059) -(139340575--139361053) -(139362304--139408298) -(140197888--140241898) -(144273408--144406528) -(144408576--144597805) -(168329216--168331263) -(168624128--168636415) -(168638464--168656409) -(168656896--168677861) -(168679424--168680738) -(168744960--168786214) -(168787968--168805558) -(168806400--168810495) -(168978432--169078784) -(169080832--169101797) -(169148416--169236396) -(169457664--169478143) -(169666560--169766912) -(169768960--169867465) -(169936896--170014888) -(170033152--170067967) -(170102784--170186751) -170401826 -(170788864--170819583) -(170844160--170917887) -170926112 -(170950656--171200010) -(171544576--171573247) -(171583488--171671551) -171673601 -(171685888--171716607) -(171819008--171854506) -(171876352--171878399) -(171884544--171886591) -(171999232--172056575) -(172371968--172456314) -(172457984--172461725) -(172462080--172490751) -(172523520--172589626) -(174206976--174340096) -(174342144--174383103) -(174489600--174516495) -(174735360--174764031) -(174981120--175112191) -175120416 -(175144960--175179905) -(176586752--176685055) -(176717824--176740493) -(176848896--176904191) -(176934912--176975871) -(176977408--176979455) -(176979968--177051648) -(177053696--177120051) -177120392 -(177121280--177143807) -(177149952--177151999) -(177156096--177158143) -(177164288--177166335) -(177172480--177174527) -(177180672--177182719) -(177186816--177188863) -(177195008--177197055) -(177201152--177203199) -(177207296--177209343) -(177254400--177256447) -(177262592--177264639) -(177268736--177270783) -(177281024--177283071) -(177289216--177291263) -(177297408--177299455) -(177303552--177305599) -(177311744--177313791) -(177319936--177321983) -(177328128--177330175) -(177338368--177340415) -(177346560--177348607) -(177354752--177356799) -(177362944--177363184) -(177532928--177551359) -177741857 -(177995776--178008063) -(178012160--178014208) -(178016256--178028543) -(178036736--178042879) -(178046976--178053119) -(178061312--178171903) -(178180096--178257919) -178266162 -(178456576--178525098) -(178526208--178615158) -(178616320--178718720) -(179015680--179071204) -(179175424--179306495) -179314745 -(179494912--179505555) -(184399872--184532992) -(184535040--184549375) -(184680448--184702975) -(184770560--184776703) -(184817664--184900578) -(185040896--185063423) -(185270272--185284607) -(185303040--185305087) -(185327616--185427968) -(185430016--185444351) -(185630720--185634815) -185866299 -(186185728--186318848) -(186320896--186441407) -(186441728--186575561) -(186718208--186810367) -(186839040--186873856) -(187101184--187170815) -(187203584--187271168) -(187273216--187462127) -(187463680--187479699) -(187480064--187516927) -(187541504--187558655) -(187559936--187670527) -(187704347--187706120) -(187777024--187910144) -(187912192--188025726) -(188026880--188219391) -(188289024--188540202) -(188540928--188608512) -(188610560--188743679) -188751907 -(188784640--188796443) -(188796928--188798975) -(188882944--188902853) -(188907520--188981247) -(189923328--189968384) -(189970432--190035980) -(190038016--190046207) -(190423040--190648320) -(190650368--190666104) -(190666752--190810113) -(190812160--190840831) -(190976000--191005371) -(191006720--191098648) -(191098880--191232000) -(191234048--191331186) -(191332352--191365119) -(191397888--191409238) -(191455232--191534670) -(191535104--191610761) -(191610880--191617023) -(191649792--191775097) -(191776768--191889407) -(191981568--192010399) -(192055296--192090112) -(192092160--192378880) -(192380928--192413695) -(192460437--192470737) -(192471040--192608256) -(192610304--192746944) -(192786432--192896847) -(192897024--192935935) -(193501184--193634304) -(193636352--193667194) -(193669120--193802240) -(193804288--193852220) -(193853440--193921458) -(193923072--193986559) -193994785 -(194031616--194144910) -(194146304--194256270) -(194256896--194390016) -(194392064--194505750) -(194506752--194510847) -(194543616--194731357) -(194889728--195022848) -(195024896--195035135) -(195096576--195152094) -(195153920--195287040) -(195289088--195364974) -(195366912--195395708) -(195397632--195407871) -(195409201--195420451) -(195422208--195505591) -(195506176--195559423) -(195592192--195627680) -(195629056--195647487) -(195688448--195950593) -(195952640--196050943) -(196052480--196077907) -(196421632--196514260) -(196515840--196607999) -(196640768--196664228) -(196796416--196798463) -(196800512--196808703) -(196810752--196878336) -(196880384--196949029) -(196950016--197083136) -(197085184--197132287) -(197165056--197193118) -(197193728--197287769) -(197287936--197296127) -(197445632--197480448) -(197482496--197549589) -(197998592--198126499) -(198127616--198180863) -(198213632--198281216) -(198283264--198316203) -(198318080--198432736) -(198952960--199072618) -(199270400--199318248) -(199385088--199518208) -(199520256--199557645) -(199559168--199638311) -(199639040--199706089) -(200493056--200562693) -(200564736--200640240) -(210032640--210107137) -(210108416--210127025) -(210475008--210515906) -(218826752--218846844) -(218857472--218897618) -(219117568--219144639) -(222101504--222167893) -(228399104--228488629) -(235704320--235894456) -(235894784--235901620) -(242825216--242866214) -(243204096--243256204)
Fix? no


Free blocks count wrong for group #0 (23513, counted=986).
Fix? no
.................................
Free blocks count wrong for group #7447 (32768, counted=32658).
Fix? no

*comment: block counts wrong from 0 to 7447

Inode bitmap differences:  -(17--56) -(58--183) -(185--335) -337 -343 -347
Fix? no

Free inodes count wrong for group #0 (8181, counted=7856).
Fix? no
Directories count wrong for group #0 (2, counted=1).
Fix? no
...........
Free inodes count wrong for group #6667 (8192, counted=8184).
Fix? no
Directories count wrong for group #6667 (0, counted=8).
Fix? no

*commnet: there are 430 groups which have a wrong inodes and directory count

*that's basically all the errors that e2fsck found.


Now, my question is : is it safe to let e2fsck fix the file system? Or is it possible that fsck would accidentally delete stuff that I can currently access (with sb=xxxx option), or cause some other damage?

Thanks in advance!

Last edited by rdata (2016-06-02 22:38:48)

Offline

#2 2016-06-02 22:03:01

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Advice on file system recovery wanted

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Fo … s_and_code


Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2016-06-02 23:40:03

syg00
Member
Registered: 2006-01-11
Posts: 31

Re: Advice on file system recovery wanted

fsck is for ensuring the consistency of the filesystem - files may become victims, that is why lost+found is always created on ext?. Note this applies to any run of fsck.
If you are concerned (and you should be), image the disk and work on the copy.

Offline

#4 2016-06-03 00:35:55

frostschutz
Member
Registered: 2013-11-15
Posts: 1,658

Re: Advice on file system recovery wanted

fsck is a filesystem destroyer

backup the files you can access...

for experiments you can use overlays: https://raid.wiki.kernel.org/index.php/ … erlay_file

Offline

#5 2016-06-03 05:44:27

rdata
Member
Registered: 2015-07-12
Posts: 9

Re: Advice on file system recovery wanted

Thanks guys! I was hoping I could get away with using fsck but it seems risky. I need to learn how overlays work. In theory I should be able to run fsck on a copy of the metadata, without actually modifying the original file system? That's clever.

Offline

Board footer

Powered by FluxBB