Mount Time Machine Backup
user: 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
assistant: 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.
- 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.
---
### 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.plist` will mention something about `Encryption` or `com.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)**
1. Copy the **entire sparsebundle folder** from your Debian system to a macOS system or directly mount the drive on macOS.
2. On macOS, double-click the `.sparsebundle` → It mounts as a virtual disk.
3. Browse inside → `Backups.backupdb` → then the hostname folder → then dated folders → standard files/folders appear.
This is the **offic…
user: Linux mounting method right away on my Debian 13 laptop
assistant: 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.
```bash
apt update
apt install qemu-utils nbd-client hfsprogs -y
```
---
## **2. Load the NBD Kernel Module**
```bash
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:
```bash
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:
```bash
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**
```bash
qemu-nbd --connect=/dev/nbd0 /media/adam/G-DRIVE/backup.dmg
```
---
## **6. Find Partitions in the Disk Image**
```bash
fdisk -l /dev/nbd0
```
Look for a partition (likely HFS+) such as `/dev/nbd0p1`.
---
## **7. Create a Mount Point and Mount HFS+ Partition**
```bash
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**
```bash
umount /mnt/timemachine
qemu-nbd --disconnect /dev/nbd0
```
---
### **Quick Notes**
- This method works **only if the backup is unencrypted**.
- If `mount` complains about journaling, we can try mounting as read-only with `-o ro,force`.
- If it was encrypt…
user: 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$
assistant: 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:
1. Assembles the bands into one disk image
2. Maps it with `qemu-nbd`
3. Finds the HFS+ partition
4. Mounts it read-only for browsing
5. Cleans up when done
Here’s the script you can use on your Debian 13 system:
---
### **Script: mount_tm_backup.sh**
```bash
#!/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:
```bash
chmod +x mount_tm_backup.sh
```
Run it with:
```bash
./mount_tm_backup.sh "/media/adam/G-DR…
user: 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?
assistant: 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:
1. **Check the current partition table** so we see how the disk is structured.
2. Use a tool like **`gparted`** (graphical) or **`parted`**/**`fdisk`** (CLI) to create a **new partition in the unallocated space** without touching the existing one.
3. Format the new partition in a **cross-platform filesystem** (like `NTFS` or `exFAT`) so both Debian and Windows can use it easily.
---
## Step 1: Identify the Disk Layout
Run:
```bash
lsblk -f
```
and
```bash
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:
```bash
apt update
apt install gparted -y
```
Then run:
```bash
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:
```bash
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 `rsync`…
user: 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?
assistant: 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 `.dmg` separately.
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:
1. **Install required tools**:
```bash
apt install qemu-utils nbd-client hfsprogs -y
modprobe nbd max_part=16
```
2. **Connect the sparsebundle directly** using `qemu-nbd`'s backing file mode:
```bash
qemu-nbd --connect=/dev/nbd0 /media/adam/G-DRIVE/JOHN’s\ iMac\ \(2\).sparsebundle
```
> This requires `qemu-nbd` with sparsebundle support (some builds have it). If it fails, we use the `qemu-img` method instead.
3. **List partitions**:
```bash
fdisk -l /dev/nbd0
```
4. **Mount the partition**:
```bash
mkdir -p /mnt/timemachine
mount -t hfsplus -o ro /dev/nbd0p1 /mnt/timemachine
```
---
### Practical Recommendation
- **No extra space** is required if we avoid creating a `.dmg`.
- If `qemu-nbd` on Debian refuses sparsebundles directly, then we need to either:
- use `tmfs` (FUSE Time Machine driver) to mount them directly, or
- temporarily create the `.dmg` if enough free space exists.
---
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?
user: 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, 2000398934016 bytes, 3907029168 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 409639 409600 200M EFI System
/dev/sdb2 409640 3906766983 3906357344 1.8T Apple HFS/HFS+
root@laptop:~#
assistant: Ah, that clears things up — thanks for the details.
Here’s what’s going on:
- Your drive `/dev/sdb` has:
- `/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, `hfsprogs` has been deprecated — now you use **`hfsutils`** or **`hfsplus`** tools 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:
1. Install correct tools for Debian 13 (no `hfsprogs`).
2. Mount directly without creating a `.dmg` file.
3. Use read-only mode to avoid risking the backup.
---
### **1. Install the Right Packages**
Run:
```bash
apt update
apt install qemu-utils nbd-client hfsutils hfsplus -y
```
- `hfsutils` gives basic HFS tools
- `hfsplus` provides read-only HFS+ support
---
### **2. Load the NBD Kernel Module**
```bash
modprobe nbd max_part=16
```
Check that `/dev/nbd0` now exists:
```bash
ls /dev/nbd*
```
You should see `/dev/nbd0`, `/dev/nbd1`, etc.
---
### **3. Connect the Sparsebundle to NBD**
```bash
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**
```bash
fdisk -l /dev/nbd0
```
Look for something like `/dev/nbd0p1` (HFS+).
---
### **5. Mount HFS+ Read-Only**
```bash
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.
…
user: Error: Package 'hfsutils' has no installation candidate
assistant: 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?
- **`hfsutils`** is 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 includes `fsck.hfsplus`—is only available in Debian sid (unstable) or non-free repositories.
---
### What to Do Next
#### **1. Install `hfsplus` Tools**
Run:
```bash
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:
```bash
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 |
|----------------------|----------------------------|---------------|------------------------|
| `hfsutils` | Not available | No…
user: root@laptop:~# grep hfsplus /proc/filesystems
hfsplus
root@laptop:~#
assistant: 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:
```bash
apt update
apt install qemu-utils nbd-client -y
```
---
## **2. Load the NBD Kernel Module**
```bash
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:
```bash
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:
```bash
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?
user: 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#
assistant: 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:
```bash
apt install cmake pkg-config -y
```
---
### **Step 2: Build tmfs with CMake**
From inside the `tmfs` folder:
```bash
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**
```bash
./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:
```bash
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:
```bash
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?
user: 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#
assistant: 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**
```bash
./tmfs -o nonempty /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle"
```
---
### **Option 2: Make sure the directory is really empty**
```bash
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**
```bash
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?
user: 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#
assistant: Ah — I see exactly what’s happening now.
The problem is **you changed directories**. You ran:
```bash
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):
```bash
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 nonempty` option because FUSE insists on it.
- Do **not** be inside `/mnt/timemachine` when calling `./tmfs`.
---
### **Verify Mount**
```bash
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:
1. Builds `tmfs` if needed
2. Creates the mount point safely
3. Mounts the sparsebundle with the correct options
4. Gives a cleanup/unmount function
That way you just run one command next time.
Do you want me to make that script?
user: 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#
assistant: 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:
```bash
./tmfs <HFS+ mount point> <Time Machine sparsebundle path> [FUSE options]
```
So the **`nonempty` option** must go **after** the sparsebundle path, like this:
```bash
./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle" -o nonempty
```
---
### Step-by-Step Correct Command
```bash
cd ~/tmfs/build
mkdir -p /mnt/timemachine
./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle" nonempty
```
- `nonempty` goes as the **third argument** (or after the sparsebundle path).
- Do **not** run the command from `/mnt/timemachine`.
---
After that, check:
```bash
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.
user: 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#
assistant: 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**
- `tmfs` refuses to mount on a directory that already exists and is “non-empty” according to FUSE.
- Even if `ls` shows it as empty, the mountpoint can contain hidden files (like `.Trash-1000` or residual mount info) or FUSE thinks it’s not empty.
- `tmfs` **requires an actually empty, newly created mount directory**.
---
### **Safe Steps to Mount**
1. Make sure you are **outside** the mountpoint:
```bash
cd ~
```
2. Remove any previous mountpoint and recreate it:
```bash
umount /mnt/timemachine 2>/dev/null || true
rm -rf /mnt/timemachine
mkdir /mnt/timemachine
```
3. Run `tmfs`:
```bash
cd ~/tmfs/build
./tmfs /mnt/timemachine "/media/adam/G-DRIVE/JOHN’s iMac (2).sparsebundle"
```
- Do **not** pass `-o` or `nonempty`.
- Make sure nothing else is mounted on `/mnt/timemachine`.
---
### **Verify Mount**
```bash
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 `tmfs` if 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?
user: 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#
assistant: 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.
- `tmfs` cannot 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 `.dmg`** or `.img` file.
- Then mount that HFS+ image read-only.
Example:
```bash
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/timemachine` normally.
---
**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.
D…
user: yes
assistant: 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**
```bash
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**
```bash
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:
```bash
apt install pv -y
cat * | pv > ~/JOHN_iMac_backup.dmg
```
---
## **Step 3: Create a mount point**
```bash
mkdir -p /mnt/timemachine
```
---
## **Step 4: Mount the HFS+ disk image read-only**
```bash
mount -o loop,ro -t hfsplus ~/JOHN_iMac_backup.dmg /mnt/timemachine
```
- `loop` treats the file as a block device
- `ro` ensures nothing is written to the backup
---
## **Step 5: Browse the backup**
```bash
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**
```bash
umount /mnt/timemachine
```
---
### **Notes / Tips**
1. This method is **read-only safe** — the original backup on your G-Drive remains intact.
2. 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 …
user: make an infographic on this subject
assistant: {
"prompt": "Create an infographic showing how to access an Apple Time Machine sparsebundle backup on Linux. Include steps: 1) Check free disk space, 2) Assemble sparsebundle bands into a single .dmg file, 3) Create mount point, 4) Mount the HFS+ disk image read-only, 5) Browse files, 6) Unmount when done. Use clear icons for disk space, file concatenation, mount point, folder browsing, and unmount. Include arrows showing the sequence and color-coded sections for each step.",
"size": "1024x1024",
"n": 1
}
Showing first 32 of 37 messages. View the full conversation at https://mcwai.org/ai-conversation/mount-time-machine-backup