Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Any useful tools to repair an XFS partition? [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
paulbiz
Guru
Guru


Joined: 01 Feb 2004
Posts: 508
Location: St. Louis, Missouri, USA

PostPosted: Tue Dec 02, 2008 8:40 pm    Post subject: Any useful tools to repair an XFS partition? [SOLVED] Reply with quote

USB Hard drive, either power supply or drive is failing, it disconnected while mounted... now I replaced the power supply, but it won't mount (obviously it was not cleanly shut down). I have never encountered this before with XFS, it usually just works like magic. :)

When I try to mount, I get the "wrong fs type" message, and dmesg shows this:
XFS: bad version
XFS: SB validate failed

When I try to run xfs_check against it, it segfaults! (!!!)

# xfs_check /dev/sdf1
xfs_check: size check failed
xfs_check: read failed: Invalid argument
xfs_check: data size check failed cache_node_purge: refcount was 1, not zero (node=0x1fd6c20)
xfs_check: cannot read root inode (22) cache_node_purge: refcount was 1, not zero (node=0x1fd6d70)
xfs_check: cannot read realtime bitmap inode (22) /usr/bin/xfs_check: line 28: 30698 Segmentation fault
xfs_db$DBOPTS -i -p xfs_check -c "check$OPTS" $1

xfs_repair exists, but the man page says it can only be used against clealy unmounted drives... which seems kind of funny. I ran it anyway, in read-only mode, and it was unable to find the primary superblock and started scanning the disk for the secondary. I aborted it because I don't know how much torture this drive can take.

When I run "less -f /dev/sdf1" i can see amongst the bits all of the names of my directories and files etc... so I am pretty sure the data is there and readable, but I can't figure out how to get XFS to go ahead and mount it so I can copy all of that stuff off and swear off USB hard drive adapters forever. :)

If anyone has any ideas at all about how to go about fixing/mounting this, I will be forever in your debt. Thanks.


Last edited by paulbiz on Fri Dec 12, 2008 9:36 pm; edited 2 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55108
Location: 56N 3W

PostPosted: Tue Dec 02, 2008 9:38 pm    Post subject: Reply with quote

paulbiz,

smartmontools is one of the standards.
It may not work over USB, it depends on the hardware in the external enclosure.
It can read the internal drive error log, which may tell what happened, if it was a drive issue.

It can also do some testing but be careful, some tests are data destructive.

Was the drive very cold ?
It may have taken a long time to spin up, or not spun up at all, consequently, the ready signal never goes true, or goes true after the kernel has timed out waiting.
This is normally a bad sign as it can indicate bearing problems.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
shickapooka800
Guru
Guru


Joined: 05 Dec 2004
Posts: 304
Location: no

PostPosted: Wed Dec 03, 2008 10:07 pm    Post subject: Reply with quote

i recommend just watching /var/log/messages for errors concerning the drive, and giving it a good listen. as in, physically get as close to the drive as possible and listen (be in a quiet place). this is one of the best ways to find a dying drive in my opinion.


if you get no errors (like read/write errors) and it sounds good, then maybe its something else that is wrong?
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Thu Dec 04, 2008 6:04 am    Post subject: Reply with quote

If I suspect a bad drive, I fsck it, if that succeeds but I still think It is bad
I watch /var/log/messages (make sure syslog-ng is on) and dmesg while I do:
dd if=/dev/sd[a-z] of=/dev/null
Of course this is to try and read the whole drive. There are plenty of problems this could miss, but it is a good start IMHO.
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3499
Location: Canada

PostPosted: Thu Dec 04, 2008 6:14 am    Post subject: Reply with quote

coolsnowmen wrote:
If I suspect a bad drive, I fsck it, if that succeeds but I still think It is bad
I watch /var/log/messages (make sure syslog-ng is on) and dmesg while I do:
dd if=/dev/sd[a-z] of=/dev/null
Of course this is to try and read the whole drive. There are plenty of problems this could miss, but it is a good start IMHO.


There is a fair chance that this is enclosure power supply that is misbehaving. I would actually try to put
the disk right awaty either in different enclosure or inside before going to further tests.
Back to top
View user's profile Send private message
paulbiz
Guru
Guru


Joined: 01 Feb 2004
Posts: 508
Location: St. Louis, Missouri, USA

PostPosted: Mon Dec 08, 2008 6:18 pm    Post subject: Reply with quote

dmpogo wrote:
coolsnowmen wrote:
If I suspect a bad drive, I fsck it, if that succeeds but I still think It is bad
I watch /var/log/messages (make sure syslog-ng is on) and dmesg while I do:
dd if=/dev/sd[a-z] of=/dev/null
Of course this is to try and read the whole drive. There are plenty of problems this could miss, but it is a good start IMHO.


There is a fair chance that this is enclosure power supply that is misbehaving. I would actually try to put
the disk right awaty either in different enclosure or inside before going to further tests.


I think so too... since i posted it has been working okay but this morning it becomes unresponsive again. Of course I'm at work so I have to wait 10 hours to go home and home it's not on fire :P

While it was working, I did all the usual tests and everything seemed okay... so I'm pretty sure it is the USB adapter + power supply, combined cost $8 including shipping from china/ebay -- surely it is top quality :lol:

Thanks.
Back to top
View user's profile Send private message
paulbiz
Guru
Guru


Joined: 01 Feb 2004
Posts: 508
Location: St. Louis, Missouri, USA

PostPosted: Tue Dec 09, 2008 1:09 am    Post subject: Reply with quote

I think the drive is crashing :( I tried another power adapter and it's making the click of death. I was able to mount it again, but after copying about 3 gigs off it died again :(

i have 130gb left on it.. i need to hurry hurry hurry :) sadly i have no extra SATA ports on this box to mount it internally.

As a last hope I will try to use a different IDE->SATA power adapter just in case this one is loose or something.
Back to top
View user's profile Send private message
paulbiz
Guru
Guru


Joined: 01 Feb 2004
Posts: 508
Location: St. Louis, Missouri, USA

PostPosted: Tue Dec 09, 2008 1:17 am    Post subject: Reply with quote

new adapter came right up but now XFS won't mount ... can't find superblock.. oh nooooooo :(
Back to top
View user's profile Send private message
paulbiz
Guru
Guru


Joined: 01 Feb 2004
Posts: 508
Location: St. Louis, Missouri, USA

PostPosted: Tue Dec 09, 2008 1:46 am    Post subject: Reply with quote

updated first post & topic to reflect current state of my problem & question
Back to top
View user's profile Send private message
paulbiz
Guru
Guru


Joined: 01 Feb 2004
Posts: 508
Location: St. Louis, Missouri, USA

PostPosted: Fri Dec 12, 2008 9:36 pm    Post subject: Reply with quote

After buying a new drive, I was able to keep the old one running long enough to dd it over to the fresh drive. xfs_repair and 30 minutes of scanning was able to find the secondary superblock, and I got 99%+ of my files back unharmed. :) Only the files that were written just before the crash were lost. I can live with that.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum