psx2rip is a lightweight Bash utility for Unix-like systems to pull PSX (PlayStation 1) and PS2 games from disc into compressed CHD format. It was built and tested on macOS (Apple Silicon).
The utility will should work on Linux using Homebrew and with replacement of diskutil, but has not been tested.
PSX ripping is fully supported. Automatic game name detection is supported via DuckStation’s database gamedb.yaml. This is not foolproof and not all games are listed. If you find a game that isn't listed, you should contribute upstream.
Both CD and DVD based PS2 titles are supported. The utility pulls GameIndex.yaml from PCSX2 in order to identify game titles from their serial. This is not foolproof and not all games are listed. If you find a game that isn't listed, you should contribute upstream.
The installation script requires brew which is available on macOS and Linux:
git clone https://github.com/thebillington/psx2rip
bash install.shThe install script:
- Moves the
psx2ripscript to/usr/local/bin - Downloads:
- DuckStation gamedb.yaml (PSX)
- PCSX2 GameIndex.yaml (PS2)
- Install requires tools via Homebrew
rom-toolsforchdman- used to compress the imagepv- used to calculate percentage of rip for DVD based PS2 gamescdrdao- used to rip CD based PSX and PS2 games
bash uninstall.shRemoves installed files and dependencies.
The script automates:
disc detection → identification → ripping → compression
for cmd in diskutil grep awk sed dd; do
command -v "$cmd" >/dev/null || { echo "$cmd not found"; exit 1; }
donepsxdb="$HOME/.psx2rip/gamedb.yaml"
ps2db="$HOME/.psx2rip/GameIndex.yaml"gamedb.yaml→ PSX (DuckStation)GameIndex.yaml→ PS2 (PCSX2)
drive=$(diskutil list | awk '/^\/dev\/disk/ {d=$1} /\(external, physical\)/ {print d; exit}')diskutil mountDisk "$drive"
serial=$(grep -o 'S[A-Z]\{3\}_[0-9]\{3\}\.[0-9]\{2\}' /Volumes/*/SYSTEM.CNF | head -n1)Normalize format:
id=$(echo "$serial" | sed 's/_/-/; s/\.//')PSX database:
name=$(grep -A1 "^$id:" "$psxdb" | grep 'name:' | sed 's/.*name:[[:space:]]*"\?\(.*\)"\?/\1/' | head -n1)Fallback to PS2:
name=$(grep -A1 "$id" "$ps2db" | grep 'name:' | sed 's/.*name: "\(.*\)"/\1/')Fallback to manual input if not found.
media=$(diskutil info "$drive" | awk -F': ' '/Optical Media Type/ {print $2}')- CD → PSX or CD-based PS2
- DVD → PS2
diskutil unmountDisk "$drive"cdrdao read-cd --read-raw --datafile "$bin" "$toc"
input="$toc"Produces:
.bin.toc
dd if="$drive" of="$iso" bs=4M status=progress
input="$iso"(Uses pv if available for progress.)
chdman createcd -i "$input" -o "$chd"
rm -f "$iso" "$bin" "$toc"If chdman is unavailable, raw output is kept.
- Preferred:
.chd - Fallback:
.toc/.iso
Compatible with:
- DuckStation (PSX)
- PCSX2 (PS2)
- Requires a compatible optical drive
- Read errors may occur on damaged discs
- Not all games exist in upstream databases
- Manual naming fallback is always available