2

I have read that the XBox One formats external hard drives in NTFS format. My understanding from reading pages such as this one is that NTFS support should work "out of the box". However, when I plug the drive into my Linux machine, nothing gets mounted. In dmesg I see that the device was recognized, but fdisk claims there is no partition table. I have read about a Windows utility that is needed (on Windows, at least) to modify the MBR of the drive to switch it between "XBox Mode" and "PC Mode" so my suspicion is that a similar thing needs to be done in Linux - but I can't find any documentation on exactly what it is doing. Alternately, maybe NTFS simply isn't working out of the box - I don't see ntfs under /proc/filesystems, for instance, and a naive attempt to "modprobe ntfs-3g" failed to find anything.

I'm running (L)Ubuntu 18.04.3 LTS.

Michael
  • 1,055
  • 1
  • 16
  • 31
  • if `sudo lshw` does not find it: there is a switch at the back that determines whether or not the drive is a slave or a master. Needs to be slave. If one of the modes is the equivalent of "hibernate": Linux will refuse to mount a dirty filesystem (what hibernation basically is). "is that a similar thing needs to be done in Linux" Impossible. You need to do that from Windows. NTFS support if not installed: `sudo apt install ntfs-3g`. – Rinzwind Feb 14 '20 at 15:35
  • @Rinzwind Switch at the back of the drive? This is an external drive with no visible switches, just the USB port. – Michael Feb 14 '20 at 15:47
  • @Rinzwind `ntfs-3g is already the newest version (1:2017.3.23-2ubuntu0.18.04.2)` – Michael Feb 14 '20 at 15:47

1 Answers1

5

I just looked at the bytes on the drive and it seems like Microsoft has deliberately erased the MBR on the drive to make our lives harder.


Option 1 (preferred): Sharing the drive between Linux and Xbox

If you don't want to modify the MBR, you can access the partition directly instead. This requires some trickery!

First find the byte offset of the NTFS partition within the drive:

drive=your.drive.here
offset=`head -c 4k $drive | grep -aobuP '\x00\x00\x00NTFS' | sed 's/\:.*//'`

Now, assuming you have a mount folder like /mnt/xbox, you can mount the partition directly like so:

mount $drive -o offset=$offset /mnt/xbox

or get fancy with better options for NTFS performance:

mount $drive -t ntfs -o offset=$offset,windows_names,big_writes,streams_interface=windows,inherit /mnt/xbox

Amazingly this actually worked for me. Go ahead and mount it. Make sure you do a full shutdown of the Xbox first or it will show up as an unclean filesystem, but linux can fix that for you.


Option 2 (risky): Fix the MBR to make the drive readable by Linux.

Before we begin, backup the MBR so it can restored:

dd if=your.drive.here bs=512 count=1 of=xbox.mbr.backup.bin

Then install lilo to fix the MBR

sudo apt install lilo
lilo -M your.drive.here mbr

Warning: The drive will remain unreadable by the Xbox until you restore the MBR back to its previous state. (Use dd to copy the backup file onto the drive)

As far as I can tell, this is the same thing that the Windows Equivalent app of this is doing (modifying the MBR) and it seems to work for them, but YMMV.

SurpriseDog
  • 402
  • 5
  • 15
  • 1
    Thanks, the `lilo` trick worked for me. Then restored it with the `dd` backup and it's like nothing happened. – Pierre Nov 04 '22 at 20:55