A tool to prepare a USB sticks for XBOX Dev Mode usage. Works on Linux. Alternative to XboxMediaUSB
So you want to create a USB drive to use it with DevMode on Xbox One/Series console, but you don't have Windows on your PC? XBOX Homebrew can't see files you've placed on a USB stick? Don't worry, I got you.
- USB Flash drive
- Computer with Linux
- Basic terminal usage knowledge (how to run commands in terminal)
- Partition the USB stick, create NTFS filesystem on the first partition.
gparted
is a wonderful tool to do this. THIS WILL DESTROY ALL DATA ON A USB DRIVE - Mount it with ntfs-3g.
mount.ntfs-3g /dev/sdc1 /mnt
It is important to usentfs-3g
for the first time, because it's impossible to set initial NTFS ACLs for the root inode when using kernel ntfs3 driver due to a bug. This will make Xbox apps unable to write to folders they created. You can usentfs3
later on. - Create a directory structure with
mkdirs.sh /mnt
(Optional) - Copy data to it
- Fix NTFS ACLs of all files on USB stick by running the
setntfsacl.sh
script or by running afind
command manually - Unmount the drive and plug in into an Xbox
- Mount the flash drive with either
ntfs3
orntfs-3g
- Copy data to it
- Fix NTFS ACLs of all files on USB stick by running the
setntfsacl.sh
script or by running afind
command manually - Unmount the drive and plug in into an Xbox
setntfsacl.sh
script automatically detects correct attribute name for ntfs3
/ntfs-3g
mounts, performs some additional checks before doing anything
sh setntfsacl.sh /media/MY_FLASH_DRIVE_MOUNT_POINT/
There are 2 different attribute names depending on what driver is used (ntfs-3g vs. ntfs3). Trying to set incorrect one will just spit errors, but won't do any harm. Just run one the following find
command:
find /media/MY_FLASH_DRIVE_MOUNT_POINT/ -exec setfattr --name=system.ntfs_security --value="0sAQAEhFwAAABoAAAAAAAAABQAAAACAEgAAwAAAAATFAD/AR8AAQEAAAAAAAUSAAAAABMUAP8BHwABAQAAAAAABQsAAAAAExgA/wEfAAECAAAAAAAPAgAAAAEAAAABAQAAAAAABRIAAAABBQAAAAAABRUAAAAGsbBbubMHygak2qABAgAA" {} \; -ls
find /media/MY_FLASH_DRIVE_MOUNT_POINT/ -exec setfattr --name=system.ntfs_acl --value="0sAQAEhFwAAABoAAAAAAAAABQAAAACAEgAAwAAAAATFAD/AR8AAQEAAAAAAAUSAAAAABMUAP8BHwABAQAAAAAABQsAAAAAExgA/wEfAAECAAAAAAAPAgAAAAEAAAABAQAAAAAABRIAAAABBQAAAAAABRUAAAAGsbBbubMHygak2qABAgAA" {} \; -ls
Q: What does this horrible 0sAQAEhFwAAABoAAAAAAAAABQAAAACAEgAAwAAAAATFAD/AR8AAQEAAAAAAAUSAAAAABMUAP8BHwABAQAAAAAABQsAAAAAExgA/wEfAAECAAAAAAAPAgAAAAEAAAABAQAAAAAABRIAAAABBQAAAAAABRUAAAAGsbBbubMHygak2qABAgAA
mean?
A: It's a value I got by setting a correct file permissions on Windows and then reading them on linux with getfattr
.
Q: I have the following errors while tryin to mount Flash drive in Linux after it was ejected from Xbox.
"Error mounting /dev/sdc1 at /media/user/128G: wrong fs type, bad option, bad superblock on /dev/sdc1, missing codepage or helper program, or other error"
or dmesg has the following:
ntfs3(sdc1): It is recommened to use chkdsk.
ntfs3(sdc1): volume is dirty and "force" flag is not set!
A: Filesystem was not cleanly unmounted and ntfs3 kernel driver doesn't want to mount such filesystem. That's what "Safely Remove Hardware and Eject Media" function in Windows for. Unfortunately, there is no such function on Xbox, so the only way to do this is to power down an Xbox completely (not sleep mode) before ejecting a USB drive.
You may want to run ntfsfix -d /dev/sdc1
to clear the volume dirty flag.