Read XFS in Windows?

Posted by: Dignan

Read XFS in Windows? - 06/11/2012 22:21

My Western Digital NAS didn't survive the recent move intact. It seems the controller board has died, though the drive still spins fine. I have it hooked up to my desktop now, running Windows 7.

The problem is that it's using an XFS file system.

Is there an easy way to read this from Windows? I've found about five different XFS file recovery programs, but they all range from around $30 to $100, but I'm not going to pay that for a one-time need.

What do I do?
Posted by: Shonky

Re: Read XFS in Windows? - 06/11/2012 23:04

VM running linux mapping the drive directly to the VM?
Posted by: mlord

Re: Read XFS in Windows? - 07/11/2012 01:18

Boot a live Linux CD, mount the XFS volume read-only, mount the Windows drive (ntfs-3g) R/W, and copy your files over.
Posted by: Dignan

Re: Read XFS in Windows? - 07/11/2012 11:53

Originally Posted By: mlord
Boot a live Linux CD, mount the XFS volume read-only, mount the Windows drive (ntfs-3g) R/W, and copy your files over.

Okay, here's the annoying thing...my optical drives aren't working and my machine seems to be having issues booting to USB. So...
Originally Posted By: Shonky
VM running linux mapping the drive directly to the VM?

This is what I'd been trying, but it doesn't seem to be working.

After my original post, I went virtual. I mounted the Ubuntu install as a virtual CD, then installed it into a VirtualBox VM. It's up and running great, and will be a great way for me to get more familiar with Ubuntu.

But at the moment I can't seem to get it to mount the partition. I'm pretty sure I'm doing it right, but I won't be surprised if I'm not. I created a directory for the mount, then I entered the following:
Code:
mount -t xfs /dev/sda2 /mnt/windows

But this returns:
Code:
mount: wrong fs type, bad option, bad superblock on /dev/sda2,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

This has led me down a troubleshooting rabbit hole that's taken me nowhere. What do I do?
Posted by: mlord

Re: Read XFS in Windows? - 07/11/2012 12:14

If this was from a dedicated "NAS" box, then how many drives can the NAS hold? More than one, right?

In which case it probably always overlays a RAID of some kind onto the drive(s) before making filesystems. And doubly so if it used some kind of special hardware controller board for the drives.

What do these commands show you (run as "root" from within Ubuntu):

fdisk -l
cat /proc/partitions
Posted by: Dignan

Re: Read XFS in Windows? - 07/11/2012 12:50

Nope, it was a single-drive NAS. This model, I'm pretty sure, but it could be the one before it.

After fdisk -l:

Code:
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 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
Disk identifier: 0x000c2ec5

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    15728639     7863296   83  Linux
/dev/sda2        15730686    16775167      522241    5  Extended
/dev/sda5        15730688    16775167      522240   82  Linux swap / Solaris

After cat /proc/partitions:

Code:
major minor  #blocks  name

   8        0    8388608 sda
   8        1    7863296 sda1
   8        2          1 sda2
   8        5     522240 sda5
  11        0    1048575 sr0
Posted by: Dignan

Re: Read XFS in Windows? - 07/11/2012 12:54

Oh...now that I look at what you had me post, I'm assuming I'm having trouble because the VM has created a virtual disk with the assignment of sda? How do I give it access to the disk that's showing up in Windows as the actual sda? Or should I be trying to get my optical drives working now? smile

I've attached a shot of what I have in Disk Management.
Posted by: peter

Re: Read XFS in Windows? - 07/11/2012 13:11

The mount command you show attempts /dev/sda2, but your fdisk listing shows that the filesystem is on /dev/sda1...

Peter
Posted by: Dignan

Re: Read XFS in Windows? - 07/11/2012 13:14

Originally Posted By: peter
The mount command you show attempts /dev/sda2, but your fdisk listing shows that the filesystem is on /dev/sda1...

Yeah, I'm not sure how to address the difference between the virtual machine and the host desktop's hard drives... I assume that as far as the VM knows there are no other hard drives other than the virtual one that gets mounted at boot...
Posted by: peter

Re: Read XFS in Windows? - 07/11/2012 13:25

Oh right, sorry, yes, /dev/sda isn't even your drive. And the fact that yours isn't in /proc/partitions means that yes, it doesn't have a standard partition table. I assume that if you type dmesg, it does mention that it's found the physical drive? perhaps as /dev/sdb?

Peter
Posted by: mlord

Re: Read XFS in Windows? - 07/11/2012 13:43

Originally Posted By: peter
Oh right, sorry, yes, /dev/sda isn't even your drive. And the fact that yours isn't in /proc/partitions means that yes, it doesn't have a standard partition table. I assume that if you type dmesg, it does mention that it's found the physical drive? perhaps as /dev/sdb?


Probably not. I expected to see /dev/sdb (with or without subpartitions) in /proc/partitions
Posted by: Dignan

Re: Read XFS in Windows? - 07/11/2012 13:52

I've attached the huge list of stuff that dmesg returned.
Posted by: mlord

Re: Read XFS in Windows? - 07/11/2012 14:05

Nothing new there. Your VM doesn't have access to the drive yet.
Posted by: canuckInOR

Re: Read XFS in Windows? - 07/11/2012 14:44

Has the USB controller in the virtual machine been enabled? VirtualBox doesn't, IIRC, enable that by default.
Posted by: peter

Re: Read XFS in Windows? - 07/11/2012 15:52

Which of the drives in your Disk Manager picture is the one we're talking about? How is it attached to your PC -- USB? eSATA?

Peter
Posted by: Dignan

Re: Read XFS in Windows? - 08/11/2012 02:30

Originally Posted By: mlord
Nothing new there. Your VM doesn't have access to the drive yet.

Yeah, I guess I'm trying to figure out how to do that.

Originally Posted By: canuckInOR
Has the USB controller in the virtual machine been enabled? VirtualBox doesn't, IIRC, enable that by default.

I'll look for that setting, but...

Originally Posted By: peter
Which of the drives in your Disk Manager picture is the one we're talking about? How is it attached to your PC -- USB? eSATA?

D'oh! Sorry. Yeah, we're looking at the first drive, the one that's all chopped up into multiple partitions, and we're looking at the last partition of that drive. I found some instructions online that said the fourth partition on the first SATA drive would be sda2, but I don't know how you get "2" for the fourth partition. Wouldn't it be "3?"

And the drive is connected to SATA just like the others.
Posted by: drakino

Re: Read XFS in Windows? - 08/11/2012 02:54

sda is the first SCSI/SATA attached drive in the virtual machine, which should be the virtual disk the VM created. The external drive formatted XFS will be something else, such as sdb once it's properly passed into the VM.

Since it's attached via SATA, you need to pass it in as a raw disk:

http://www.virtualbox.org/manual/ch09.html#rawdisk
Posted by: peter

Re: Read XFS in Windows? - 08/11/2012 07:52

Originally Posted By: Dignan
I found some instructions online that said the fourth partition on the first SATA drive would be sda2, but I don't know how you get "2" for the fourth partition. Wouldn't it be "3?"

Your internet has been deceiving you. The four primary partitions are sda1 to sda4 (or sdb1 to sdb4, etc.), though they're numbered in the order they're defined in the partition table, not in the order they appear on the disk -- it'd be legit but decidedly odd for sda1 to be the one at the end, for instance.

Peter
Posted by: Dignan

Re: Read XFS in Windows? - 08/11/2012 20:16

Originally Posted By: mlord
Boot a live Linux CD, mount the XFS volume read-only, mount the Windows drive (ntfs-3g) R/W, and copy your files over.

Okay, so I rummaged through my pile of boxes, finally found a DVD burner, and made an Ubuntu live disc and booted to it. I didn't need to mount the existing drives because they came up automatically, and I was easily able to mount the NAS drive with no troubles whatsoever. I copied all the data off and now I'll wipe the drive for use as a regular NTFS disc.

Thanks for the help, folks. I'm still interested in trying out the Ubuntu VM, so I'll play around with that.
Posted by: JBjorgen

Re: Read XFS in Windows? - 09/11/2012 01:16

Well done!
Posted by: Dignan

Re: Read XFS in Windows? - 09/11/2012 10:29

Originally Posted By: JBjorgen
Well done!

Thank you! But as usual I'm glad I got the help here, and I learned a good deal as well.