Skip to content

Instantly share code, notes, and snippets.

@semenko
Created June 12, 2022 01:22
Show Gist options
  • Select an option

  • Save semenko/3de2c6135687a40bd55fb3dec1411706 to your computer and use it in GitHub Desktop.

Select an option

Save semenko/3de2c6135687a40bd55fb3dec1411706 to your computer and use it in GitHub Desktop.
Generate NTFS image for Xbox OSU updater
#!/bin/bash
set -x
# By Nick Semenkovich https://nick.semenkovich.com
#
# Largely derived from:
# https://gist.github.com/kumbasar/49906cb704ce9213c972a3e008c74c0c
# I found myself needing to update an Xbox S via USB (with the Offline System Update OSU1 patch)
# See: https://support.xbox.com/en-US/help/hardware-network/console/system-update-solution/offline-system-update
#
# Unfortunately, making an NTFS filesystem on OS X is hard without disabling System Integrity Protection (SIP)
# and installing third party / semi-sketch software & extensions.
#
# Instead, you can use a remote linux machine (I bet Google Cloud Shell would work for free for this),
# and generate an image, then write that image to a flash drive on OS X.
# Download OSU
wget -O osu1.zip https://www.xbox.com/xboxone/osu1
image="osu1.img"
label="osu"
mntdir=`mktemp -d`
# This will be roughly 7GB -- it must be larger than the osu1.zip contents
sudo dd status=progress if=/dev/zero of=$image bs=4M count=1750 && sync
echo 'type=7' | sudo sfdisk $image
LOOPMOUNT=`sudo losetup --partscan --show --find ${image}`
echo $LOOPMOUNT
sudo mkfs.ntfs -Q -v -F -L ${label} ${LOOPMOUNT}p1
sudo mount ${LOOPMOUNT}p1 ${mntdir}
# Extract OSU1 into the tmpdir
unzip osu1.zip -d ${mntdir}
# Unmount everything
sudo umount ${mntdir}
sudo losetup -d ${LOOPMOUNT}
# NOTE:
# Now you need to write this on OS X to the flash drive
# Roughly:
# 0. Copy the file to your local mac ($ scp -C remote-machine:osu1.img .)
# 1. Plug in a flash drive
# 2. Find its path ($ mount )
# 3. Ensure it's unmounted ($ sudo diskutil unmount /Volumes/FLASHNAME/)
# 4. Write the image ($ sudo dd if=osu1.img of=/dev/diskNN bs=4M && sync)
@anthonyxmoonguy
Copy link

That is the GitHub Gist I was referencing in the previous step! Thank you for providing the full code.

As mentioned, this script is designed for a more complicated scenario (using a remote Linux machine and then transferring the image file to a Mac for final writing).

However, since you have the Linux environment directly on your Chromebook, we can use a simpler, more direct approach that achieves the same result without needing to create and manage the temporary osu1.img file.

The simpler, direct approach we previously discussed is less prone to error in your specific Chromebook environment.

Here is a reminder of the direct commands you need to execute, which are simpler than running the entire script above, especially on a Chromebook.


Simplified Direct Commands (No .img file needed)

You can skip the entire image creation portion of that script and jump straight to formatting and file transfer.

Phase 1: Format the USB Drive to NTFS

  1. Open the Linux Terminal and ensure your USB drive (6GB+) is plugged in and "Shared with Linux" (via the ChromeOS Files app).
  2. Install Formatting Tools: (Ensure ntfs-3g is installed)
    sudo apt update
    sudo apt install ntfs-3g
  3. Identify and Unmount the Drive:
    • Find the device name (e.g., /dev/sdb1): sudo fdisk -l
    • Unmount the drive (Replace sdb1 with your actual partition name):
      sudo umount /dev/sdb1
  4. Format the Drive to NTFS (Wipes ALL data!):
    • (Replace sdb1 with your actual partition name.)
      sudo mkfs.ntfs -f /dev/sdb1

Phase 2: Download and Transfer the OSU File

  1. Download OSU File: Download the official OSU1.zip file from the Xbox Support website into your Chromebook's Downloads folder.
  2. Navigate and Extract:
    cd ~/Downloads
    unzip OSU1.zip
  3. Copy to USB: (Copy the $SystemUpdate folder to the root of your USB.)
    • (Replace [USB Name] with the name that appears in your Files app.)
    sudo cp -r $SystemUpdate /mnt/chromeos/removable/[USB Name]/

Once this is done, safely unmount and eject the drive. You are ready to proceed with the Offline System Update (OSU) on your Xbox One S.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment