how to browse apple time machine backups on linux?
I have this older model 2TB backup drive from an apple ecosystem. G-Technology by Hitachi There is a users folder that seems to be backed up in I see a bands folder with 8MB sparsebundle stripes. In the root directory of the drive, I see apple time machine file. I do not have an apple product now. But is is possible to browser the contents or put it back together some how if I have an apple computer or without an apple OS. The contents of the drive are most likely not encrypted; yet I'm not sure if it is required to have a password to put the data back together or browse it. can you elaborate on this subject on how to go about this? Additional details I see while i have this drive mounted on my Debian 13 laptop Filesystem hfsplus Mounted on /media/adam/G-DRIVE Mounted from /dev/sdb2
ChatGPT said:
Got it—you have an older 2 TB Apple Time Machine backup drive with HFS+ filesystem, and inside you see a bands folder with many 8 MB files (the sparsebundle structure). This is the typical layout for Time Machine backups pre-APFS. Let’s break this down so you can understand what you’re looking at and what your options are for browsing or restoring the data.
1. Understanding the Structure
- Time Machine Backups (Pre-APFS Era):
- Backups were stored inside sparsebundles:
- A sparsebundle is basically a directory with:
Info.plist(metadata about the backup)token(sometimes present, may contain encryption info)bands/directory → contains many 8 MB “band” files that together form a single disk image.
- A sparsebundle is basically a directory with:
- When mounted on macOS, the sparsebundle appears as a single virtual disk.
- Inside that virtual disk → you see
Backups.backupdb/→ then dated snapshots → then the full filesystem tree.
- Backups were stored inside sparsebundles:
2. Encryption vs. No Encryption
- If the backup was encrypted:
- You would have been prompted for a password when Time Machine was originally set up.
- The
Info.plistwill mention something aboutEncryptionorcom.apple.TimeMachine.Encryption. - Without the password → the data is inaccessible.
- If it was NOT encrypted:
- macOS will just mount the sparsebundle like a normal disk image, no password needed.
Given what you said (“most likely not encrypted”), there’s a good chance this backup can be opened directly if you get access to macOS.
3. Access Options
You have two main paths:
Option A: Using macOS (Easiest)
- Copy the entire sparsebundle folder from your Debian system to a macOS system or directly mount the drive on macOS.
- On macOS, double-click the
.sparsebundle→ It mounts as a virtual disk. - Browse inside →
Backups.backupdb→ then the hostname folder → then dated folders → standard files/folders appear.
This is the official method Apple intended.
Option B: Access Without macOS (Linux)
Since you’re on Debian 13, you can use:
hfsprogsorhfsplus-toolsfor HFS+ read access.qemu-nbdorapfs-fusefor mounting Apple disk images if needed.
For sparsebundles:
- Combine all
bands/into a single disk image:cat bands/* > fullimage.dmgBut this might be huge and unnecessary. - Better approach: Use
tmfs(Time Machine FUSE driver) orhdiutil(macOS only).
On Linux,tmfscan directly mount Time Machine backups, but it’s not always reliable.
Realistically, macOS makes this way easier because it knows the sparsebundle format natively.
4. Recommendations
- If possible, borrow or use a macOS machine → mount directly → copy out files.
- If you must stay on Linux:
- Check for tmfs: https://github.com/abique/tmfs
- Or mount the sparsebundle using
qemu-nbd+hfsprogs.
5. Next Steps
I can help you:
- Determine if the backup is encrypted by inspecting its metadata.
- Give you exact Linux commands to mount the sparsebundle if you prefer staying on Debian.
- Or give you the simplest macOS workflow if you have access to one.
Do you want me to help you check if the backup is encrypted first, or do you want the Linux mounting method right away?
You said:
Linux mounting method right away on my Debian 13 laptop
ChatGPT said:
Got it — since you’re on Debian 13 with the drive already mounted at /media/adam/G-DRIVE, we can try mounting the Time Machine sparsebundle on Linux without needing a Mac.
Here’s a step-by-step guide that works if the backup is not encrypted:
1. Install Required Tools
We’ll need qemu-nbd for mounting the virtual disk, nbd kernel module for network block devices, and hfsprogs to access the HFS+ filesystem inside.
apt update
apt install qemu-utils nbd-client hfsprogs -y
2. Load the NBD Kernel Module
modprobe nbd max_part=16
This creates /dev/nbd0, /dev/nbd1, etc., for use as virtual block devices.
3. Locate the Sparsebundle
Check the drive contents. Your sparsebundle folder probably ends with .sparsebundle. Example:
ls /media/adam/G-DRIVE
Let’s assume it’s called MyBackup.sparsebundle.
4. Convert Sparsebundle Bands to a Single Image
Unfortunately, Linux can’t natively read sparsebundle band directories. We need to assemble it into one .dmg first:
cd /media/adam/G-DRIVE/MyBackup.sparsebundle
cat bands/* > ../backup.dmg
This will take some time depending on size.
5. Connect the Disk Image via NBD
qemu-nbd --connect=/dev/nbd0 /media/adam/G-DRIVE/backup.dmg
6. Find Partitions in the Disk Image
fdisk -l /dev/nbd0
Look for a partition (likely HFS+) such as /dev/nbd0p1.
7. Create a Mount Point and Mount HFS+ Partition
mkdir -p /mnt/timemachine
mount -t hfsplus -o ro /dev/nbd0p1 /mnt/timemachine
Now you can browse files in /mnt/timemachine/Backups.backupdb/...
8. When Done, Clean Up
umount /mnt/timemachine
qemu-nbd --disconnect /dev/nbd0
Quick Notes
- This method works only if the backup is unencrypted.
- If
mountcomplains about journaling, we can try mounting as read-only with-o ro,force. - If it was encrypted, we’ll need extra steps with
hdiutilon macOS orfvde-toolson Linux.
If you want, I can give you a single script to automate all of this on Debian so you just run it and mount the Time Machine backup directly.
Do you want me to prepare that script for you?
You said:
yes, and below is what the files look like adam@laptop:/media/adam/G-DRIVE$ cd "JOHN’s iMac (2).sparsebundle"/ adam@laptop:/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle$ ls bands com.apple.TimeMachine.MachineID.plist Info.plist com.apple.TimeMachine.MachineID.bckup Info.bckup token adam@laptop:/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle$
ChatGPT said:
Perfect — I see the full sparsebundle structure with bands/, Info.plist, and no immediate sign of encryption keys. We can automate the entire Linux mounting process into a single script that:
- Assembles the bands into one disk image
- Maps it with
qemu-nbd - Finds the HFS+ partition
- Mounts it read-only for browsing
- Cleans up when done
Here’s the script you can use on your Debian 13 system:
Script: mount_tm_backup.sh
#!/bin/bash
# Mount Apple Time Machine sparsebundle on Debian
# Usage: ./mount_tm_backup.sh "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle"
set -e
if [ -z "$1" ]; then
echo "Usage: $0 <path_to_sparsebundle>"
exit 1
fi
SPARSEBUNDLE="$1"
WORKDIR=$(dirname "$SPARSEBUNDLE")
BASENAME=$(basename "$SPARSEBUNDLE")
DMG="$WORKDIR/${BASENAME}.dmg"
MOUNTPOINT="/mnt/timemachine"
echo "[*] Installing required packages..."
apt update -qq && apt install -y qemu-utils nbd-client hfsprogs
echo "[*] Loading nbd kernel module..."
modprobe nbd max_part=16
if [ ! -f "$DMG" ]; then
echo "[*] Assembling sparsebundle into single dmg file (this may take a while)..."
cat "$SPARSEBUNDLE"/bands/* > "$DMG"
else
echo "[*] Reusing existing dmg file: $DMG"
fi
echo "[*] Connecting disk image via NBD..."
qemu-nbd --connect=/dev/nbd0 "$DMG"
echo "[*] Detecting partitions..."
fdisk -l /dev/nbd0 || true
# Usually first partition is correct; user can override with arg2 if needed
PARTITION="/dev/nbd0p1"
mkdir -p "$MOUNTPOINT"
echo "[*] Mounting HFS+ partition as read-only..."
mount -t hfsplus -o ro,force "$PARTITION" "$MOUNTPOINT"
echo
echo "[+] Backup mounted at $MOUNTPOINT"
echo "[+] Browse backups under $MOUNTPOINT/Backups.backupdb"
echo
echo "When done, run:"
echo " umount $MOUNTPOINT && qemu-nbd --disconnect /dev/nbd0"
Usage
Save the script as mount_tm_backup.sh, make it executable:
chmod +x mount_tm_backup.sh
Run it with:
./mount_tm_backup.sh "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle"
This will:
- Check/install tools
- Build
JOHN’s iMac (2).sparsebundle.dmgfrom bands if not already built - Map it with
qemu-nbd - Mount the first partition read-only under
/mnt/timemachine
If you like, I can also write a second script to safely unmount and clean up after you’re done browsing the backup.
Do you want me to make that unmount script too?
You said:
Actually, I want to run this script later. This hard drive space is only 32% occupied and I would like to create a new partition as a backup for my Debian and Windows systems. How would I go about using the remainder free space of this drive as a new partition?
ChatGPT said:
Ah, okay — you want to keep the existing Apple Time Machine backup intact but use the remaining free space on this 2 TB drive to create a new partition for backups of Debian and Windows systems.
Because the drive is using HFS+ for Time Machine, we cannot just resize the HFS+ partition from inside Linux without risk. The safest approach is:
- Check the current partition table so we see how the disk is structured.
- Use a tool like
gparted(graphical) orparted/fdisk(CLI) to create a new partition in the unallocated space without touching the existing one. - Format the new partition in a cross-platform filesystem (like
NTFSorexFAT) so both Debian and Windows can use it easily.
Step 1: Identify the Disk Layout
Run:
lsblk -f
and
fdisk -l /dev/sdb
Your drive is probably /dev/sdb, since it was mounted from /dev/sdb2.
This will show:
/dev/sdb1(maybe EFI or empty)/dev/sdb2(HFS+ Time Machine partition)- free space (we need to confirm how it’s represented)
Step 2: Use GParted (Safest)
Install gparted:
apt update
apt install gparted -y
Then run:
gparted
- Select the correct drive (
/dev/sdb), not your main OS drive! - You should see the existing HFS+ partition in use, plus some unallocated space at the end.
- Right-click the unallocated space → New → Choose filesystem:
NTFS→ if Windows will back up here too.ext4→ if only Linux will use it.exFAT→ if both Linux and Windows need write access but you prefer simpler cross-platform.
- Apply changes.
Step 3: Mount or Use the New Partition
After formatting, the new partition (e.g., /dev/sdb3) will appear in lsblk -f.
You can mount it on Debian:
mkdir /mnt/backup
mount /dev/sdb3 /mnt/backup
Windows will see it automatically if it’s NTFS or exFAT.
Step 4: Consider Backup Tools
- On Debian, you can use
rsyncortimeshiftfor system backups. - On Windows, you can use built-in File History or Macrium Reflect, storing them on the new partition.
If you want, I can write you a completely non-destructive CLI script that detects the free space and makes the new partition automatically without risking the Time Machine data.
Do you want me to prepare that automated script for you?
You said:
if i want to mount with your script mount_tm_backup.sh Do i need a lot of free space on my laptop hard drive?
ChatGPT said:
No, you don’t need a ton of free space on your laptop’s internal drive to use the mount_tm_backup.sh script — but there are some details to be aware of:
How the Script Works with Space
- The script reads all the 8 MB band files from the sparsebundle and concatenates them into one big disk image (
.dmg) on the same drive where the sparsebundle lives. - So, if your sparsebundle is 1 TB, you’d need another 1 TB of free space if you build the
.dmgseparately.
That’s not ideal for large backups.
Better Approach: Mount Without Duplicating
Instead of creating a single .dmg, we can mount the sparsebundle directly without copying it. This way, no additional free space is required — only temporary system files (a few MB at most).
Here’s the modified approach:
- Install required tools:
apt install qemu-utils nbd-client hfsprogs -y
modprobe nbd max_part=16 - List partitions:
fdisk -l /dev/nbd0 - Mount the partition:
mkdir -p /mnt/timemachine
mount -t hfsplus -o ro /dev/nbd0p1 /mnt/timemachine
Connect the sparsebundle directly using qemu-nbd's backing file mode:qemu-nbd --connect=/dev/nbd0 /media/adam/G-DRIVE/JOHN’s\ iMac\ \(2\).sparsebundle
This requiresqemu-nbdwith sparsebundle support (some builds have it). If it fails, we use theqemu-imgmethod instead.
Practical Recommendation
- No extra space is required if we avoid creating a
.dmg. - If
qemu-nbdon Debian refuses sparsebundles directly, then we need to either:- use
tmfs(FUSE Time Machine driver) to mount them directly, or - temporarily create the
.dmgif enough free space exists.
- use
I can rewrite the script to mount directly without extra space and automatically detect partitions for you.
Do you want me to rewrite the script this better way so you don’t need free space?
You said:
just fyi. i cant resize it with gparted, and the unallocated free space at the end of the disk is only 128MB. but thats fine. I'm not interested in resizing fro now, i cant even mount yet root@laptop:~# fdisk -l /dev/nbd0 fdisk: cannot open /dev/nbd0: No such file or directory root@laptop:~# apt install qemu-utils nbd-client hfsprogs -y Package hfsprogs is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source Error: Package 'hfsprogs' has no installation candidate root@laptop:~# fdisk -l /dev/sdb Disk /dev/sdb: 1.82 TiB, sectors Disk model: Disk Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 3685014E-F9D1-44CF-B2A0-4E97B1973259 Device Start End Sectors Size Type /dev/sdb1 40 200M EFI System /dev/sdb2 1.8T Apple HFS/HFS+ root@laptop:~#
ChatGPT said:
Ah, that clears things up — thanks for the details.
Here’s what’s going on:
- Your drive
/dev/sdbhas:/dev/sdb1→ 200 MB EFI partition/dev/sdb2→ 1.8 TB HFS+ partition (this is the Time Machine backup)
- There’s no real unallocated free space, just 128 MB at the end, which is way too small for a new partition. So resizing is off the table for now.
- On Debian 13,
hfsprogshas been deprecated — now you usehfsutilsorhfsplustools for read-only mounting.
And your fdisk -l /dev/nbd0 error means the NBD device wasn’t set up because qemu-nbd never ran or failed earlier.
Plan for Mounting
We need to:
- Install correct tools for Debian 13 (no
hfsprogs). - Mount directly without creating a
.dmgfile. - Use read-only mode to avoid risking the backup.
1. Install the Right Packages
Run:
apt update
apt install qemu-utils nbd-client hfsutils hfsplus -y
hfsutilsgives basic HFS toolshfsplusprovides read-only HFS+ support
2. Load the NBD Kernel Module
modprobe nbd max_part=16
Check that /dev/nbd0 now exists:
ls /dev/nbd*
You should see /dev/nbd0, /dev/nbd1, etc.
3. Connect the Sparsebundle to NBD
qemu-nbd --connect=/dev/nbd0 /media/adam/G-DRIVE/JOHN’s\ iMac\ \(2\).sparsebundle
If this fails, it’s because qemu-nbd doesn’t support sparsebundles directly — in that case, we’ll use tmfs instead.
4. Check Partitions in the Virtual Disk
fdisk -l /dev/nbd0
Look for something like /dev/nbd0p1 (HFS+).
5. Mount HFS+ Read-Only
mkdir -p /mnt/timemachine
mount -t hfsplus -o ro,force /dev/nbd0p1 /mnt/timemachine
If this still doesn’t work because qemu-nbd can’t read sparsebundles directly, then the best Linux approach is to use tmfs, a FUSE driver made specifically for Time Machine backups, so no big .dmg files are needed.
I can give you the exact commands for tmfs so you can browse the backup immediately without extra space or converting anything.
Do you want me to prepare the tmfs method next? It’s the most reliable on Linux.
You said:
Error: Package 'hfsutils' has no installation candidate
ChatGPT said:
Thanks for sticking with this! Here's the updated picture based on your latest details:
What’s Going On With the HFS Packages on Debian 13?
hfsutilsis not installable on Debian 13 and primarily targets the older HFS filesystem—not HFS+. It doesn’t support the newer format .- The real package you’ll want is
hfsplus, which contains the necessary tools for HFS+ support. However,hfsprogs—which includesfsck.hfsplus—is only available in Debian sid (unstable) or non-free repositories .
What to Do Next
1. Install hfsplus Tools
Run:
sudo apt update
sudo apt install hfsplus
This gives you the filesystem tools but does not provide kernel support for mounting HFS+ volumes.
2. Kernel Support for HFS+
Debian’s kernel usually includes HFS+ module support, but not always by default. You can check if it’s enabled:
grep hfsplus /proc/filesystems
If no output appears, your kernel may not support mounting HFS+ directly. That’s a roadblock on Debian.
Alternative: No Exploding the Backup
Since conventional tools are unreliable or unavailable, here are your best options:
A. Use tmfs (Time Machine FUSE)
This is a FUSE-based tool tailored for Time Machine sparsebundles. It doesn’t rely on kernel support and works without needing to create a full .dmg file.
Would you like me to walk you through installing and using tmfs to mount your backup directly?
B. Use Java Tool: HFSExplorer
This cross-platform, read-only Java app can access HFS+ volumes (including sparsebundles) without kernel or package dependencies . Not the slickest, but it’s reliable when other tools aren’t available.
TL;DR Summary
Package/Tool |
Availability on Debian 13 |
Supports HFS+ |
Kernel Support Needed |
|---|---|---|---|
|
Not available |
No |
— |
|
Available |
Yes |
Yes (kernel module) |
|
Only via sid/non-free |
Yes |
Yes |
|
Independently installable |
Yes |
No |
HFSExplorer |
Java-based, platform-agnostic |
Yes |
No |
What Should You Do Now?
Let me know if you’d prefer:
- A step-by-step guide for
tmfs, which is probably the smoothest way to access your Time Machine backup on Debian. - Instructions for using HFSExplorer for quick, GUI-based reading of your sparsebundle.
- Or exploring other avenues (like adding sid/non-free sources—but beware that complicates your system and may carry risks).
Once I know which path you'd like, I’ll get you moving!
You said:
root@laptop:~# grep hfsplus /proc/filesystems hfsplus root@laptop:~#
ChatGPT said:
Perfect — that means your Debian kernel already supports HFS+, so we don’t need extra kernel modules.
Now we just need to get your sparsebundle mounted properly using what you already have. Since your kernel supports HFS+, we can mount it read-only for safety once we have a device mapping from the sparsebundle to a virtual block device.
Here’s the clean approach that avoids creating a giant .dmg file:
1. Install Needed Tools
Make sure you have these installed:
apt update
apt install qemu-utils nbd-client -y
2. Load the NBD Kernel Module
modprobe nbd max_part=16
ls /dev/nbd*
You should see /dev/nbd0, /dev/nbd1, etc.
3. Try Mapping the Sparsebundle Directly
Unfortunately, qemu-nbd itself can’t read the banded sparsebundle format directly.
So two choices here:
- Use tmfs (FUSE driver for Time Machine) → best option for Linux, no extra space required
- Or concatenate bands into a full disk image → requires as much free space as the backup size
Because free space is limited, tmfs is the right tool here.
4. Installing tmfs
tmfs mounts Apple Time Machine backups directly:
apt install build-essential libfuse-dev git -y
git clone https://github.com/abique/tmfs.git
cd tmfs
make
mkdir -p /mnt/timemachine
./tmfs /mnt/timemachine /media/adam/G-DRIVE/JOHN’s\ iMac\ \(2\).sparsebundle
If successful, you’ll be able to browse the backup inside /mnt/timemachine.
5. When Done
Unmount with:
fusermount -u /mnt/timemachine
I can make you a single automated script that installs tmfs, compiles it, and mounts your sparsebundle in one go so you don’t have to do this manually.
Do you want me to prepare that script for you?
You said:
hit a snag at make root@laptop:~# apt update apt install qemu-utils nbd-client -y Installing: nbd-client qemu-utils Installing dependencies: ibverbs-providers libgfapi0 libglusterfs0 librados2 liburing2 libaio1t64 libgfrpc0 libibverbs1 librbd1 qemu-block-extra libblkio1 libgfxdr0 libiscsi7 librdmacm1t64 Summary: Upgrading: 0, Installing: 16, Removing: 0, Not Upgrading: 113 Download size: 22.2 MB Space needed: 54.2 MB / 56.1 GB available root@laptop:~# modprobe nbd max_part=16 ls /dev/nbd* /dev/nbd0 /dev/nbd10 /dev/nbd12 /dev/nbd14 /dev/nbd2 /dev/nbd4 /dev/nbd6 /dev/nbd8 /dev/nbd1 /dev/nbd11 /dev/nbd13 /dev/nbd15 /dev/nbd3 /dev/nbd5 /dev/nbd7 /dev/nbd9 root@laptop:~# apt install build-essential libfuse-dev git -y build-essential is already the newest version (12.12). Upgrading: git git-man libpcre2-16-0 libpcre2-32-0 libpcre2-8-0 Installing: libfuse-dev Installing dependencies: libpcre2-dev libpcre2-posix3 libselinux1-dev libsepol-dev Summary: Upgrading: 5, Installing: 5, Removing: 0, Not Upgrading: 108 Download size: 14.4 MB Space needed: 12.5 MB / 56.1 GB available root@laptop:~# git clone https://github.com/abique/tmfs.git Cloning into 'tmfs'... remote: Enumerating objects: 229, done. remote: Counting objects: 100% (61/61), done. remote: Compressing objects: 100% (46/46), done. remote: Total 229 (delta 36), reused 28 (delta 15), pack-reused 168 (from 1) Receiving objects: 100% (229/229), 50.98 KiB | 1023.00 KiB/s, done. Resolving deltas: 100% (117/117), done. root@laptop:~# cd tmfs root@laptop:~/tmfs# make make: *** No targets specified and no makefile found. Stop. root@laptop:~/tmfs# make mkdir -p /mnt/timemachine ./tmfs /mnt/timemachine /media/adam/G-DRIVE/JOHN’s\ iMac\ \(2\).sparsebundle make: *** No targets specified and no makefile found. Stop. -bash: ./tmfs: No such file or directory root@laptop:~/tmfs#
ChatGPT said:
Ah, I see exactly what’s going on.
The problem is the tmfs project you cloned does not include a Makefile. That means you can’t just run make because there’s no build system defined. Instead, this project is built using CMake, so you need to build it differently.
Here’s the correct way to build and install tmfs on Debian/Ubuntu:
Step 1: Install dependencies
You already installed most packages, but let’s add CMake:
apt install cmake pkg-config -y
Step 2: Build tmfs with CMake
From inside the tmfs folder:
cd ~/tmfs
mkdir build && cd build
cmake ..
make
If everything compiles correctly, you’ll get a tmfs binary in the build folder.
Step 3: Test the binary
./tmfs --help
You should see usage instructions.
Step 4: Mount your Time Machine sparsebundle
Assuming your sparsebundle is at /media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle, run:
mkdir -p /mnt/timemachine
./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle"
The quotes are important because of spaces in the path.
Step 5: Access the files
Once mounted, go to:
cd /mnt/timemachine
ls
You should see your backup contents.
If you want, I can give you a one-shot script to build and run tmfs so you don’t have to remember all the steps each time.
Do you want me to write that script for you?
You said:
root@laptop:~/tmfs# apt install cmake pkg-config -y cmake is already the newest version (3.31.6-2). pkg-config is already the newest version (1.8.1-4). Summary: Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 108 root@laptop:~/tmfs# cd ~/tmfs mkdir build && cd build cmake .. make – The CXX compiler identification is GNU 14.2.0 – Detecting CXX compiler ABI info – Detecting CXX compiler ABI info - done – Check for working CXX compiler: /usr/bin/c++ - skipped – Detecting CXX compile features – Detecting CXX compile features - done – Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") – Checking for module 'fuse' – Found fuse, version 2.9.9 – Configuring done (0.4s) – Generating done (0.0s) – Build files have been written to: /root/tmfs/build [ 14%] Building CXX object CMakeFiles/tmfs.dir/src/main.cc.o [ 28%] Building CXX object CMakeFiles/tmfs.dir/src/readdir.cc.o [ 42%] Building CXX object CMakeFiles/tmfs.dir/src/read.cc.o [ 57%] Building CXX object CMakeFiles/tmfs.dir/src/readlink.cc.o [ 71%] Building CXX object CMakeFiles/tmfs.dir/src/getattr.cc.o [ 85%] Building CXX object CMakeFiles/tmfs.dir/src/get_real_path.cc.o [100%] Linking CXX executable tmfs [100%] Built target tmfs root@laptop:~/tmfs/build# ./tmfs --help Usage: ./tmfs: <HFS+ mount point> <Time Machine mount point> [FUSE options] root@laptop:~/tmfs/build# mkdir -p /mnt/timemachine ./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle" fuse: mountpoint is not empty fuse: if you are sure this is safe, use the 'nonempty' mount option root@laptop:~/tmfs/build# cd /mnt/timemachine ls root@laptop:/mnt/timemachine# ls root@laptop:/mnt/timemachine#
ChatGPT said:
Okay, good — you successfully built tmfs and ran it, but the issue you hit now is with FUSE refusing to mount on a non-empty directory.
Even though /mnt/timemachine looks empty, FUSE insists the directory be completely empty unless you explicitly tell it otherwise.
Here’s how to fix it:
Option 1: Use the nonempty option
./tmfs -o nonempty /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle"
Option 2: Make sure the directory is really empty
umount /mnt/timemachine 2>/dev/null
rm -rf /mnt/timemachine
mkdir /mnt/timemachine
./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle"
Verify the mount worked
ls /mnt/timemachine
You should now see the Time Machine backup contents.
If you plan to use this regularly, I can give you a mount_tm_backup.sh script that automatically builds, mounts, and unmounts Time Machine sparsebundles safely, so you don’t have to remember all these commands.
Do you want me to make that script for you?
You said:
root@laptop:~/tmfs/build# mkdir -p /mnt/timemachine ./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle" fuse: mountpoint is not empty fuse: if you are sure this is safe, use the 'nonempty' mount option root@laptop:~/tmfs/build# cd /mnt/timemachine ls root@laptop:/mnt/timemachine# ls root@laptop:/mnt/timemachine# umount /mnt/timemachine 2>/dev/null rm -rf /mnt/timemachine mkdir /mnt/timemachine ./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle" -bash: ./tmfs: No such file or directory root@laptop:/mnt/timemachine# ls /mnt/timemachine root@laptop:/mnt/timemachine# ls root@laptop:/mnt/timemachine#
ChatGPT said:
Ah — I see exactly what’s happening now.
The problem is you changed directories. You ran:
rm -rf /mnt/timemachine
mkdir /mnt/timemachine
./tmfs /mnt/timemachine ...
but your current directory is /mnt/timemachine. When you use ./tmfs, the shell looks inside the current directory for the binary — and obviously it’s not there. That’s why you get:
-bash: ./tmfs: No such file or directory
Correct Way
Stay in the build directory (where tmfs binary was built):
cd ~/tmfs/build
mkdir -p /mnt/timemachine
./tmfs -o nonempty /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle"
Notes:
- Use the
-o nonemptyoption because FUSE insists on it. - Do not be inside
/mnt/timemachinewhen calling./tmfs.
Verify Mount
ls /mnt/timemachine
You should now see the contents of your Time Machine backup.
If you want, I can now provide a full one-shot script that:
- Builds
tmfsif needed - Creates the mount point safely
- Mounts the sparsebundle with the correct options
- Gives a cleanup/unmount function
That way you just run one command next time.
Do you want me to make that script?
You said:
root@laptop:/mnt/timemachine# cd ~/tmfs/build mkdir -p /mnt/timemachine ./tmfs -o nonempty /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle" /root/tmfs/build/-o: No such file or directory root@laptop:~/tmfs/build#
ChatGPT said:
Ah! The problem now is the position of the -o option. tmfs does not use standard FUSE option syntax when called directly — -o is being interpreted as part of the filename. That’s why you got:
/root/tmfs/build/-o: No such file or directory
On tmfs, the correct syntax is:
./tmfs <HFS+ mount point> <Time Machine sparsebundle path> [FUSE options]
So the nonempty option must go after the sparsebundle path, like this:
./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle" -o nonempty
Step-by-Step Correct Command
cd ~/tmfs/build
mkdir -p /mnt/timemachine
./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle" nonempty
nonemptygoes as the third argument (or after the sparsebundle path).- Do not run the command from
/mnt/timemachine.
After that, check:
ls /mnt/timemachine
You should see the Time Machine backup contents.
If you want, I can write a ready-to-run script that handles all this safely for you, so mounting the backup becomes just one command.
You said:
please, there is something seems you are not understanding. looks closely root@laptop:~/tmfs/build# cd ~/tmfs/build mkdir -p /mnt/timemachine ./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle" nonempty fuse: invalid argument nonempty'root@laptop:~/tmfs/build# ls /mnt/timemachine root@laptop:~/tmfs/build#
ChatGPT said:
Ah! Now I fully understand — thanks for your patience. The key point is: tmfs itself does not support the nonempty FUSE option at all. It’s not like fusermount or other FUSE-based mounts. That’s why passing nonempty gives:
fuse: invalid argument `nonempty'
What’s Happening
tmfsrefuses to mount on a directory that already exists and is “non-empty” according to FUSE.- Even if
lsshows it as empty, the mountpoint can contain hidden files (like.Trash-1000or residual mount info) or FUSE thinks it’s not empty. tmfsrequires an actually empty, newly created mount directory.
Safe Steps to Mount
- Make sure you are outside the mountpoint:
cd ~
- Remove any previous mountpoint and recreate it:
umount /mnt/timemachine 2>/dev/null || true
rm -rf /mnt/timemachine
mkdir /mnt/timemachine
- Run
tmfs:
cd ~/tmfs/build
./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle"
- Do not pass
-oornonempty. - Make sure nothing else is mounted on
/mnt/timemachine.
Verify Mount
ls /mnt/timemachine
You should now see the Time Machine backup contents.
✅ Once this works, I can create a one-shot script that handles:
- Creating a clean mountpoint
- Building
tmfsif needed - Mounting your sparsebundle safely
- Unmounting and cleanup
This will avoid all the “nonempty” errors and path issues you’ve been hitting.
Do you want me to make that script for you?
You said:
you keep going around in circles, please verify this situation root@laptop:~# umount /mnt/timemachine 2>/dev/null || true rm -rf /mnt/timemachine mkdir /mnt/timemachine root@laptop:~# root@laptop:~# cd ~/tmfs/build ./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle" fuse: mountpoint is not empty fuse: if you are sure this is safe, use the 'nonempty' mount option root@laptop:~/tmfs/build# ls /mnt/timemachine root@laptop:~/tmfs/build#
ChatGPT said:
Ah — now I see clearly what’s actually happening. Thank you for showing the exact steps.
This is not a user error. The issue is that tmfs on Linux cannot mount the sparsebundle at all if the HFS+ partition inside is not actually mounted or visible. The “mountpoint is not empty” message is misleading here; it’s what tmfs prints when it cannot find a valid HFS+ volume inside the sparsebundle to present via FUSE.
On Linux, tmfs requires the HFS+ filesystem inside the sparsebundle to be mounted first, because it cannot natively parse HFS+ sparsebundles alone. In other words:
- Your sparsebundle contains bands of an HFS+ disk image.
tmfscannot read the bands directly unless the HFS+ image is already assembled and mountable.
Two Ways Forward
Option 1: Mount the sparsebundle on macOS
- The easiest, 100% working method: attach the drive to a Mac.
- macOS will mount the sparsebundle automatically as a virtual HFS+ volume.
- Then you can copy files directly or even read the backup contents over network.
Option 2: Assemble the sparsebundle manually on Linux
- You have to concatenate all the bands into a single
.dmgor.imgfile. - Then mount that HFS+ image read-only.
Example:
cd "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle/bands"
cat * > ~/JOHN_iMac_backup.dmg
mkdir -p /mnt/timemachine
mount -t hfsplus -o ro ~/JOHN_iMac_backup.dmg /mnt/timemachine
Notes:
- This requires as much free disk space as the total size of the backup.
- Once mounted, you can browse
/mnt/timemachinenormally.
Bottom line:
On pure Linux, tmfs cannot mount Apple sparsebundles unless the HFS+ disk image inside can be seen. The misleading “mountpoint not empty” is a generic error in this situation.
If you want, I can write you a step-by-step Linux method to assemble the bands and mount the backup safely, taking into account disk space and read-only safety.
Do you want me to do that?
You said:
yes
ChatGPT said:
Perfect — here’s a safe, step-by-step method to assemble your Time Machine sparsebundle on Linux and mount it read-only, so you can browse the backup without a Mac.
Important: You need free disk space equal to the size of the backup (the sum of all bands). From your earlier message, the drive is 1.8 TB and only ~32% used, so you may need ~600 GB of free space somewhere on your Debian system to assemble the .dmg file.Step 1: Confirm disk space
df -h ~
Make sure you have enough free space in your home directory (or wherever you plan to assemble the image).
Step 2: Assemble the sparsebundle into a single disk image
cd "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle/bands"
cat * > ~/JOHN_iMac_backup.dmg
- This concatenates all 8 MB band files in order into a single HFS+ disk image.
- Do not interrupt this process; it can take a long time depending on the backup size.
Optional: monitor progress with pv if installed:apt install pv -y
cat * | pv > ~/JOHN_iMac_backup.dmg
Step 3: Create a mount point
mkdir -p /mnt/timemachine
Step 4: Mount the HFS+ disk image read-only
mount -o loop,ro -t hfsplus ~/JOHN_iMac_backup.dmg /mnt/timemachine
looptreats the file as a block deviceroensures nothing is written to the backup
Step 5: Browse the backup
cd /mnt/timemachine
ls
You should see folders like:
Users/
Volumes/
System/
...
From here, you can copy out any files you need.
Step 6: Unmount when done
umount /mnt/timemachine
Notes / Tips
- This method is read-only safe — the original backup on your G-Drive remains intact.
- You only need as much space as the total backup to assemble it. If you don’t have enough space, you must either:
- Use a Mac to mount the sparsebundle natively, or
- Mount it in smaller pieces by copying specific bands (advanced, not recommended).
- Once mounted, you can copy files to your Linux or Windows backup partition freely.
If you want, I can write a ready-to-run Bash script that:
- Checks available space
- Concatenates bands into a
.dmgsafely - Mounts it read-only
- Provides cleanup/unmount commands
This would make the whole process one command.
Do you want me to do that?