Print

So, you downloaded a torrent expecting a nice AVI- or MPG-file for instant-action AV entertainment, and all you got was a big .bin file and a funny little .cue file? Here's the Linux-way of how to extract the content from them:

Overview

.bin and .cue files are binary and metadata file tuples for storing optical storage data in its rawest form. More on this type of raw data type in Wikipedia.

Solutions

There at least 3 approaches available for making this type of file usable:

Use the bin2iso utility

# emerge bin2iso
# bin2iso myfile.cue

This creates the output file myfile-01.iso from your myfile.bin and also obliterates the myfile.bin file.

# mkdir /mnt/image
# mount -o loop -t iso9660 myfile-01.iso /mnt/image
# ls /mnt/image

... and collect your files from the /mnt/image directory.

Use the bchunk utility

# emerge bchunk
# bchunk infile.bin infile.cue outfile

This creates the output file outfile.iso, which you can mount.

# mkdir /mnt/image
# mount -o loop -t iso9660 outfile.iso /mnt/image
# ls /mnt/image

Use the cdemu kernel module

Note that release cdemu-0.8  does not work from Kernel 2.6.17 onwards.

# uname -a
Linux dappy 2.6.20-gentoo-r1 #1 PREEMPT Thu Mar 8 18:41:41 GMT 2007 i686 AMD Athlon(tm) XP 1700+ AuthenticAMD GNU/Linux
# ls -l /usr/src
lrwxrwxrwx  1 root root   23 Jun 11 10:55 linux -> linux-2.6.20-gentoo-r1/
drwxr-xr-x 20 root root 1328 Mar 13 18:27 linux-2.6.20-gentoo-r1
# emerge cdemu
# modprobe cdemu

A cdemu device should have been created in your /dev directory:

# ls /dev/cdemu*
/dev/cdemu0
/dev/cdemu1
. . .
/dev/cdemu8

You can also check if it was loaded with the command:

# lsmod
Module                  Size  Used by
cdemu                  11532 0
. . .

# cdemu 0 infile.cue

# mount /dev/cdemu0 /mnt/cdrom