LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
 
Search this Thread
Old 08-24-2014, 06:00 AM   #1
Zippy1970
Member
 
Registered: Sep 2007
Posts: 119

Rep: Reputation: 17
Trying to recover an XFS drive.


A friend gave me his Buffalo LS-XHL NAS to look at because it crashed an he has tons of photos on it he wants to recover. Inside the NAS is a 1TB HDD. Apparently, the LS-XHL uses the XFS file system. It uses 6 partitions, of which partition #6 is the data partition.

When I connect the drive to my Windows system, Windows finds all 6 partitions but can only read the first since that's the only FAT32 partition on the disk. The other 5 partitions are XFS partitions. Windows sees those partitions just fine but tells me they need to be formatted first before it can use them (since Windows doesn't support XFS obviously).

When I connect the drive to a linux system, Linux isn't even able to see any partition. DMESG is filled with lines like these:

Code:
[] sd 10:0:0:0:0: [sdb]
[] Results: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[] sd 10:0:0:0:0: [sdb]
[] Sense key: Medium Error [Current]
[] sd 10:0:0:0:0: [sdb]
[] Add. Sense: Unrecovered read error
[] sd 10:0:0:0:0: [sdb] CDB:
[] Read(10): 28 00 00 d5 c0 78 00 00 08 00
[] sd 10:0:0:0:0: [sdb] Unhandled sense code
etc.
parted -l gives me this:

Code:
Error: /dev/sdb: unrecognised disk label
Model: Jmicron Corp. (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk flags:
Doing a xfs_repair /dev/sdb gives me this:

Code:
Phase 1 - find and verify superblock...
superblock read failed, offset 0, size 524288, ag 0, rval -1

fatal error -- Input/output error
What I don't understand is why Windows is able to find all partitions just fine and Linux isn't.

Any tips?

Thanks in advance.
 
Old 08-24-2014, 08:06 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 2,844

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
Windows doesn't attempt to access the partitions...

Linux reads the partition table, and the home blocks of any filesystems in those partitions.

And running xfs_repair on the entire disk is an error. Being a filesystem repair, it only handles the contents of a partition.

It is also possible the disk is using GPT where Linux is not - thus the partitions would not be recognized.

In any case, it appears that the disk has failed...
 
Old 08-24-2014, 12:51 PM   #3
Zippy1970
Member
 
Registered: Sep 2007
Posts: 119

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by jpollard View Post
And running xfs_repair on the entire disk is an error. Being a filesystem repair, it only handles the contents of a partition.
Ok, but linux doesn't see any partition, even the one that Windows is able to read just fine (the first - FAT32 - partition).
 
Old 08-24-2014, 01:32 PM   #4
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,859

Rep: Reputation: 452Reputation: 452Reputation: 452Reputation: 452Reputation: 452
I am concerned that the drive my be failing, so it would be wise to use ddrescue to image the data partition to another drive. Then you can either try to recover that partition or carve data out of it using testdisk or foremost.

After you image the partition you may want to check the SMART attributes using 'smartctl -a /dev/sd?' where ? is the correct device.
 
Old 08-24-2014, 03:26 PM   #5
Zippy1970
Member
 
Registered: Sep 2007
Posts: 119

Original Poster
Rep: Reputation: 17
Again, the thing is that I don't understand why Windows sees all partitions just fine, and Linux sees none. No matter what distro I try.

This is what linux sees (click to enlarge):

Click image for larger version

Name:	xfsdisk_linux.jpg
Views:	12
Size:	16.8 KB
ID:	16213

And this is what Windows sees (click to enlarge):

Click image for larger version

Name:	xfsdisk_win7.jpg
Views:	11
Size:	31.1 KB
ID:	16214

PS: I thought the first partition was FAT32, but it's actually EXT3 (and I have an Ext3 driver installed on Windows).

Last edited by Zippy1970; 08-24-2014 at 03:37 PM.
 
Old 08-24-2014, 06:52 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,963

Rep: Reputation: 1205Reputation: 1205Reputation: 1205Reputation: 1205Reputation: 1205Reputation: 1205Reputation: 1205Reputation: 1205Reputation: 1205
It may be that Windows isn't as strict in its checking. Wouldn't be the first time.
Maybe try sfdisk - it's likely to be less strict than (recent) libparted. Or see if testdisk will take a look at it.
 
Old 08-24-2014, 07:22 PM   #7
Zippy1970
Member
 
Registered: Sep 2007
Posts: 119

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by syg00 View Post
Or see if testdisk will take a look at it.
I thought testdisk didn't support XFS?
 
Old 08-24-2014, 08:04 PM   #8
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,859

Rep: Reputation: 452Reputation: 452Reputation: 452Reputation: 452Reputation: 452
Check the main page:
http://www.cgsecurity.org/wiki/TestDisk
It can find XFS partitions. Photorec can also carve data like foremost (filesystem doesn't matter for this).
 
Old 08-25-2014, 02:51 PM   #9
jefro
Guru
 
Registered: Mar 2008
Posts: 12,754

Rep: Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614Reputation: 1614
At one time an app called Ranish used to be able to correct partitions. Not sure if that has been updated.
 
Old 08-25-2014, 03:24 PM   #10
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,696

Rep: Reputation: 640Reputation: 640Reputation: 640Reputation: 640Reputation: 640Reputation: 640
This link tells what tools you need for reading & manipulating xfs
https://wiki.ubuntu.com/XFS
 
Old 08-25-2014, 04:13 PM   #11
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Whatever fits the task best
Posts: 16,273
Blog Entries: 2

Rep: Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448
Proper mode of operation for recovering data from failing disks:
1. Create an image of the disk or partition in question. Once you have created that image disconnect the disk (data and power) and leave it alone.
2. Make a copy of the image file and from now on only work on that copy, leave the original alone, so that failed recovery attempts can be compensated with just creating a new copy from the original.
3. Try to mount the filesystem(s) (using the offset option of the mount command), if that doesn't work use the filesystem tools to try to repair the filesystem. If that also doesn't work use a file carver like Photorec to try to recover the files.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to repair missing partition table and recover data from xfs? MikeyCarter Linux - Software 3 06-15-2009 06:21 PM
Recover truncated file's contents on XFS? Tomasu Linux - Server 10 04-29-2008 08:08 AM
Newby that needs to recover data from failed NAS drive (xfs formatted) MargJT Linux - Newbie 6 02-24-2008 02:13 AM
Raid 5 XFS FC2 recover disk failure mattma Linux - Hardware 1 11-11-2006 06:12 PM
Recover files from XFS partition Christof999 Linux - Software 5 07-23-2006 11:47 AM


All times are GMT -5. The time now is 04:08 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration