Reformatting old Time Machine drive for Linux and Windows
user: I have this older model 2TB backup drive from an apple ecosystem. G-Technology by Hitachi. I was formerly an apply time machine and still has the old apple filesystem which we don't need anymore.
now I want to use this entire drive as a backup for both my Debian 13 laptop and Windows PC. Before you mentioned a couple backup tools for Debian. Can you tell me the best course of action. It is currently mounted. Note all these nbd appeared after you had me run commands earlier. I would like to get rid of that if we are not using nbd
sdb
├─sdb1 vfat FAT32 EFI 70D6-1701
└─sdb2 hfsplus G-DRIVE 7fa64f02-bf79-3346-b81f-5f8d4c10a3aa 1.2T 32% /media/adam/G-DRIVE
nbd0
nbd1
nbd2
nbd3
nbd4
nbd5
nbd6
nbd7
nbd8
nbd9
nbd10
nbd11
nbd12
nbd13
nbd14 …
assistant: Got it! Let’s break this down carefully. You have an older Apple Time Machine drive (HFS+), mounted, with a small EFI partition and a larger HFS+ partition. You want to wipe it clean and make it usable for **both Debian 13** and **Windows**. You also want to clean up all those `nbd` devices we saw. Here’s the step-by-step plan.
---
### 1️⃣ Stop/cleanup `nbd` devices
The `nbd0–nbd15` devices are Network Block Devices (usually from testing something with `qemu-nbd` or `tmfs`). If we are **not using them**, we can safely disconnect them:
```bash
# Unmount any mounted nbd devices first (if any are mounted)
umount /dev/nbd* 2>/dev/null || true
# Disconnect all nbd devices
for i in {0..15}; do
qemu-nbd -d /dev/nbd$i 2>/dev/null || true
done
```
Check with:
```bash
lsblk
```
You should see the `nbd` devices disappear if they are no longer in use.
---
### 2️⃣ Wipe the old HFS+ drive
Since you want **Windows + Linux compatibility**, we’ll use **exFAT** (supports >4GB files, readable/writable on both OSes) or **NTFS** (better for large files, also works on Linux with `ntfs-3g`). exFAT is simpler for cross-platform.
> WARNING: This will erase the entire drive. Make sure there’s nothing you want to keep.
```bash
# Unmount the drive first
umount /media/adam/G-DRIVE
# Wipe old partitions
sgdisk --zap-all /dev/sdb # wipes GPT/MBR completely
```
---
### 3️⃣ Create a single exFAT partition for backup
```bash
# Create a new GPT and a single exFAT partition
parted /dev/sdb -- mklabel gpt
parted /dev/sdb -- mkpart primary exfat 0% 100%
# Format it
mkfs.exfat -n BACKUP /dev/sdb1
```
Now `/dev/sdb1` is a clean exFAT volume named `BACKUP`.
---
### 4️⃣ Make the drive mountable on Debian & Windows
On Debian:
```bash
# Install exFAT support if not already
apt update
apt install exfatprogs exfat-utils -y
# Mount for testing
mkdir -p /mnt/backup
mount /dev/sdb1 /mnt/backup
```
Windows will see it automatically as a standard drive.
---
### 5️⃣ Recommended ba…
user: nbd zero thru fifteen is still there
root@laptop:~/tmfs/build# # Unmount any mounted nbd devices first (if any are mounted)
umount /dev/nbd* 2>/dev/null || true
# Disconnect all nbd devices
for i in {0..15}; do
qemu-nbd -d /dev/nbd$i 2>/dev/null || true
done
/dev/nbd0 disconnected
/dev/nbd1 disconnected
/dev/nbd2 disconnected
/dev/nbd3 disconnected
/dev/nbd4 disconnected
/dev/nbd5 disconnected
/dev/nbd6 disconnected
/dev/nbd7 disconnected
/dev/nbd8 disconnected
/dev/nbd9 disconnected
/dev/nbd10 disconnected
/dev/nbd11 disconnected
/dev/nbd12 disconnected
/dev/nbd13 disconnected
/dev/nbd14 disconnected
/dev/nbd15 disconnected
root@laptop:~/tmfs/build# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 238.5G 0 disk
├─sda1 8:1 0 100M 0 part /boot/efi
├─sda2 8:2 0 16M 0 part
├─sda3 8:3 0 140.1G 0 part
├─sda4 8:4 0 642M 0 part
└─sda5 8:5 0 97.7G 0 part /
sdb 8:16 0 1.8T 0 disk
├─sdb1 8:17 0 200M 0 part
└─sdb2 8:18 0 1.8T 0 part /media/adam/G-DRIVE
nbd0 43:0 0 0B 0 disk
nbd1 43:32 0 0B 0 disk
nbd2 43:64 0 0B 0 disk
nbd3 43:96 0 0B 0 disk
nbd4 43:128 0 0B 0 disk
nbd5 43:160 0 0B 0 disk
nbd6 43:192 0 0B 0 disk
nbd7 43:224 0 0B 0 disk
nbd8 43:256 0 0B 0 disk
nbd9 43:288 0 0B 0 disk
nbd10 43:320 0 0B 0 disk
nbd11 43:352 0 0B 0 disk
nbd12 43:384 0 0B 0 disk
nbd13 43:416 0 0B 0 disk
nbd14 43:448 0 0B 0 disk
nbd15 43:480 0 0B 0 disk
root@laptop:~/tmfs/build#
assistant: Ah, I see exactly what’s happening. Those `nbd0–nbd15` devices **aren’t processes themselves**, they’re just device nodes created by the kernel. Even after you disconnect them with `qemu-nbd -d`, they still appear in `lsblk` because the `/dev/nbd*` block devices exist by default — that’s normal.
You **don’t need to worry about them** if nothing is mounted or connected to them. They are just “available slots” for Network Block Devices. The important part is that they’re all disconnected (`size 0B` and not in use), which your `lsblk` confirms.
✅ So in short:
- They are not using any disk space or resources.
- They are just persistent device nodes in `/dev/`.
- You can ignore them entirely.
---
If you want, for a perfectly clean `lsblk` view, you **could hide them temporarily** by unplugging or blacklisting the `nbd` module:
```bash
# Check if nbd module is loaded
lsmod | grep nbd
# Remove the module temporarily (all devices disconnected)
rmmod nbd
```
After this, `lsblk` won’t show `nbd0–nbd15` at all. They will reappear after reboot if the module loads automatically.
---
If your goal is just **preparing the G-Drive for cross-platform backup**, we can move on to wiping it and formatting it as exFAT/NTFS next.
Do you want me to give the full ready-to-run commands for that now?
user: yes
assistant: Perfect. Here’s a **full, ready-to-run sequence** to wipe your old Apple HFS+ drive and make it a **cross-platform backup drive** (exFAT) for Debian and Windows.
> ⚠️ **WARNING:** This will erase **everything** on `/dev/sdb`. Make absolutely sure it’s the correct drive.
---
### 1️⃣ Unmount the drive
```bash
umount /dev/sdb* 2>/dev/null || true
```
---
### 2️⃣ Optionally remove `nbd` clutter (temporary)
```bash
# Disconnect any connected nbd devices
for i in {0..15}; do
qemu-nbd -d /dev/nbd$i 2>/dev/null || true
done
# Unload nbd kernel module (optional, hides devices in lsblk)
rmmod nbd 2>/dev/null || true
```
---
### 3️⃣ Wipe the old partitions
```bash
# Completely erase old partition table
sgdisk --zap-all /dev/sdb
# Create a new GPT label
parted /dev/sdb -- mklabel gpt
```
---
### 4️⃣ Create a single exFAT partition
```bash
# Create one partition covering the whole disk
parted /dev/sdb -- mkpart primary exfat 0% 100%
# Format it as exFAT
mkfs.exfat -n BACKUP /dev/sdb1
```
> Now the drive has a single **exFAT partition** called `BACKUP`.
---
### 5️⃣ Mount and test
```bash
mkdir -p /mnt/backup
mount /dev/sdb1 /mnt/backup
# Check available space
df -h /mnt/backup
```
On Windows, it will appear automatically as a normal drive.
---
### 6️⃣ Backup strategy suggestions
**Debian:**
- **rsync (simple, incremental):**
```bash
rsync -avh --progress /home/adam/ /mnt/backup/linux_home_backup/
```
- **BorgBackup (encrypted + deduplicated):**
```bash
apt install borgbackup -y
borg init --encryption=repokey /mnt/backup/borgrepo
borg create /mnt/backup/borgrepo::$(date +%F) /home/adam
```
**Windows:**
- **FreeFileSync** (GUI, incremental, multiple versions)
- **Windows File History** (built-in, simple)
> exFAT does **not preserve Linux permissions**, so if you need full Linux ownership/mode preservation, consider an additional ext4 partition for Linux-only backups. For cross-platform, exFAT is the easiest.
---
If you want, I can also mak…
user: actually, I want to use half the disk for my Debian Linux backups and the other half for Windows backups.
assistant: Perfect — we can do a **dual-partition scheme**. Here’s the plan:
- `/dev/sdb1` → **Linux-only** (ext4) → ~50% of the disk
- `/dev/sdb2` → **Windows + Linux** (exFAT) → ~50% of the disk
This gives you:
- Linux backups with proper **permissions, symlinks, and ownership** on ext4
- Windows backups on exFAT that are readable/writable on both OSes
---
### 1️⃣ Unmount the drive
```bash
umount /dev/sdb* 2>/dev/null || true
```
---
### 2️⃣ Optionally clean up nbd devices
```bash
for i in {0..15}; do
qemu-nbd -d /dev/nbd$i 2>/dev/null || true
done
rmmod nbd 2>/dev/null || true
```
---
### 3️⃣ Wipe the old partitions
```bash
sgdisk --zap-all /dev/sdb
parted /dev/sdb -- mklabel gpt
```
---
### 4️⃣ Create dual partitions
```bash
# ext4 for Linux - first half
parted /dev/sdb -- mkpart primary ext4 0% 50%
# exFAT for Windows - second half
parted /dev/sdb -- mkpart primary exfat 50% 100%
```
---
### 5️⃣ Format partitions
```bash
# Linux backup partition
mkfs.ext4 -L LINUX_BACKUP /dev/sdb1
# Windows + Linux backup partition
mkfs.exfat -n WIN_BACKUP /dev/sdb2
```
---
### 6️⃣ Mount and test
```bash
# Linux backup
mkdir -p /mnt/linux_backup
mount /dev/sdb1 /mnt/linux_backup
# Windows backup
mkdir -p /mnt/win_backup
mount /dev/sdb2 /mnt/win_backup
df -h /mnt/linux_backup /mnt/win_backup
```
---
### 7️⃣ Backup suggestions
**Linux (ext4 partition):**
- `rsync` (preserves permissions):
```bash
rsync -avh --progress /home/adam/ /mnt/linux_backup/
```
- **BorgBackup** (encrypted + deduplicated):
```bash
borg init --encryption=repokey /mnt/linux_backup/borgrepo
borg create /mnt/linux_backup/borgrepo::$(date +%F) /home/adam
```
**Windows (exFAT partition):**
- Use **FreeFileSync** or **Windows File History**.
- Linux can still write here, but Linux permissions **won’t be preserved** (exFAT limitation).
---
If you want, I can make a **single copy-paste script** that wipes the drive, sets up the two partitions, formats them correctly, and mou…
user: yes
assistant: Perfect! Here’s a **ready-to-run script** for your setup. It will:
1. Clean up `nbd` devices.
2. Wipe the entire drive `/dev/sdb`.
3. Create **two partitions**: ext4 for Linux (~50%) and exFAT for Windows (~50%).
4. Format the partitions.
5. Create mount points and mount them.
> ⚠️ **WARNING:** This will erase **everything** on `/dev/sdb`. Make sure it’s the correct drive.
```bash
#!/bin/bash
set -e
DRIVE="/dev/sdb"
EXT4_LABEL="LINUX_BACKUP"
EXFAT_LABEL="WIN_BACKUP"
MOUNT_LINUX="/mnt/linux_backup"
MOUNT_WIN="/mnt/win_backup"
echo "=== Step 1: Unmount existing partitions ==="
umount ${DRIVE}* 2>/dev/null || true
echo "=== Step 2: Disconnect any nbd devices ==="
for i in {0..15}; do
qemu-nbd -d /dev/nbd$i 2>/dev/null || true
done
rmmod nbd 2>/dev/null || true
echo "=== Step 3: Wipe old partitions ==="
sgdisk --zap-all $DRIVE
parted $DRIVE -- mklabel gpt
echo "=== Step 4: Create new partitions ==="
parted $DRIVE -- mkpart primary ext4 0% 50%
parted $DRIVE -- mkpart primary exfat 50% 100%
echo "=== Step 5: Format partitions ==="
mkfs.ext4 -L $EXT4_LABEL ${DRIVE}1
mkfs.exfat -n $EXFAT_LABEL ${DRIVE}2
echo "=== Step 6: Create mount points and mount ==="
mkdir -p $MOUNT_LINUX $MOUNT_WIN
mount ${DRIVE}1 $MOUNT_LINUX
mount ${DRIVE}2 $MOUNT_WIN
echo "=== Step 7: Show mounted partitions ==="
df -h $MOUNT_LINUX $MOUNT_WIN
echo "=== Done! ==="
echo "Linux backups: $MOUNT_LINUX"
echo "Windows backups: $MOUNT_WIN"
```
---
### ✅ Notes
- **Linux partition** preserves ownership and permissions. Use `rsync` or `BorgBackup` here.
- **Windows partition** (exFAT) works for both Linux and Windows, but **no Linux permissions**.
- To **automount** at boot, you can add entries to `/etc/fstab` after testing the mounts.
---
If you want, I can also prepare the **`rsync` + `BorgBackup` commands** to immediately start backing up your Debian home folder to the Linux partition.
Do you want me to do that next?
user: why is mklabel gpt or any reason GPT is there? what is gpt?
assistant: Ah, perfect question — let’s break it down carefully.
---
### **1️⃣ What GPT is**
GPT stands for **GUID Partition Table**. It’s a modern way of organizing partitions on a disk, replacing the older **MBR (Master Boot Record)** scheme. Think of it like a table of contents for the disk: it tells the system where each partition starts, ends, and what type it is.
**Key points:**
| Feature | GPT | MBR |
|---------|-----|-----|
| Max disk size | Very large (up to ~9.4 ZB) | 2 TB |
| Max partitions | 128 (typical in OSes) | 4 primary partitions |
| Redundancy | Stores backup partition table at the end of disk | No backup |
| Data safety | CRC32 checksums for partition table | None |
| Compatibility | Modern Linux, Windows (64-bit), macOS | Very old systems, BIOS-only |
---
### **2️⃣ Why we use GPT here**
- Your drive is **2 TB**, which is just at the old MBR limit. GPT is safer and future-proof.
- GPT lets us create **more than 4 partitions** if needed in the future.
- It stores a backup partition table at the end of the disk, so even if something gets corrupted, you can recover.
- Modern Debian and Windows fully support GPT, so no compatibility issues here.
> Basically: GPT is **modern, reliable, and safer** for large disks. MBR is mostly legacy now.
---
### **3️⃣ Why `parted $DRIVE -- mklabel gpt`**
This command **wipes the old partition table** and creates a new GPT label at the beginning of the disk. It ensures:
- Clean slate for new partitions.
- Compatibility with both Linux and Windows (both understand GPT).
- No leftover Apple HFS+ metadata from Time Machine.
---
So in your case: GPT is **perfectly suited** for a 2 TB cross-platform backup drive.
---
If you want, I can also **explain why exFAT on GPT is better than NTFS on GPT** for your dual-partition setup and cross-platform use. Do you want me to?
user: yes
assistant: Great — let’s compare **exFAT vs NTFS on a GPT disk** for your specific dual-use scenario.
---
### **1️⃣ exFAT**
**Pros:**
- Fully **read/write** on Linux (with `exfatprogs`) and Windows without extra drivers.
- Supports **large files** (>4 GB), which FAT32 cannot.
- Simple structure, minimal overhead.
**Cons:**
- **No Linux permissions:** ownership, user/group, and execute bits are ignored.
- No journaling → slightly higher risk of corruption if unplugged during writes.
**Best for:**
- Cross-platform drives where Windows compatibility is needed.
- Large files like ISOs, videos, or Windows backups.
---
### **2️⃣ NTFS**
**Pros:**
- Supported natively on Windows (read/write).
- Linux can read/write via `ntfs-3g` (slightly slower than ext4 or exFAT).
- Supports file permissions and journaling (safer against crashes).
**Cons:**
- Permissions may behave inconsistently on Linux; UID/GID mapping can be tricky.
- Writing to NTFS on Linux is generally reliable, but **slightly slower** than exFAT.
**Best for:**
- Windows backups that may include system files or require NTFS features.
- If Linux users want minimal risk with journaling, but cross-platform simplicity is less important.
---
### **3️⃣ Recommendation for your setup**
- **Linux partition:** `ext4` — keeps permissions, symlinks, fast, reliable.
- **Windows + Linux partition:** `exFAT` — simple, universally writable, works out-of-the-box on Windows and Linux.
> NTFS could work instead of exFAT, but for cross-platform ease, exFAT is usually better. You only sacrifice Linux permissions (which aren’t important for Windows backups anyway).
---
If you want, I can also make a **diagram showing your 2 TB drive layout** with `ext4` and `exFAT` partitions and their intended use — it makes it really clear.
Do you want me to do that?
user: yes
assistant: {
"prompt": "Infographic showing a 2TB backup drive layout. The drive is split into two equal partitions. The first half (left side) is labeled 'Linux Backups' formatted as ext4, with notes: 'Preserves Linux permissions, symlinks, ownership.' The second half (right side) is labeled 'Windows Backups' formatted as exFAT, with notes: 'Readable/writable on Windows and Linux, supports large files, no Linux permissions.' Include arrows pointing to each partition, and a top title 'Dual-Partition Backup Drive Layout'. Clean, modern infographic style.",
"size": "1024x1024",
"n": 1
}
Showing first 16 of 19 messages. View the full conversation at https://mcwai.org/ai-conversation/reformatting-old-time-machine-drive-for-linux