this post was submitted on 02 Mar 2026
14 points (85.0% liked)

Linux

63438 readers
509 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

I have some old HFS formatted burned CDs burning in toast on a classic mac. A friend needs his stuff moved off these backups onto his NAS but his modern mac cannot read these CDs. I can mount them in linux manually but the filenames have illegal characters so I cannot copy them over to anything without losing like half of them.

How to I copy these files off the CDs?

you are viewing a single comment's thread
view the rest of the comments
[–] tla@lemmy.world 7 points 21 hours ago
#!/bin/bash

#
***
Configuration
***
SOURCE_DEV="/dev/sr0"
MOUNT_POINT="/mnt/mac_legacy_cd"
DEST_DIR="$HOME/Desktop/mac_recovered_files"

# 1. Ensure the system is ready
echo "Checking for HFS support..."
sudo modprobe hfs 2>/dev/null
sudo modprobe hfsplus 2>/dev/null

# Create directories
sudo mkdir -p "$MOUNT_POINT"
mkdir -p "$DEST_DIR"

# 2. Attempt to mount
# We try HFS first with MacRoman to UTF-8 translation
echo "Attempting to mount $SOURCE_DEV..."
sudo mount -t hfs -o ro,iocharset=utf8 "$SOURCE_DEV" "$MOUNT_POINT" 2>/dev/null

if [ $? -ne 0 ]; then
    echo "HFS mount failed, trying HFS+ (Mac OS Extended)..."
    sudo mount -t hfsplus -o ro "$SOURCE_DEV" "$MOUNT_POINT"
fi

# 3. Verify mount and Copy
if mountpoint -q "$MOUNT_POINT"; then
    echo "Mount successful. Copying files to $DEST_DIR..."
    # -a: archive mode (preserves symlinks, permissions, times)
    # -v: verbose
    # -z: compress (not really needed for local, but good practice)
    # -P: show progress
    rsync -avzP "$MOUNT_POINT/" "$DEST_DIR/"
    
    echo "---"
    echo "Copy complete. Unmounting..."
    sudo umount "$MOUNT_POINT"
    echo "Done. You can find your files in $DEST_DIR"
else
    echo "Error: Could not mount the disc. Ensure the CD is inserted and $SOURCE_DEV is the correct path."
    exit 1
fi