ATTENTION: THIS HOWTO IS SEVERLY OUTDATED. SEE THIS POST
old Howto follows:
Heya,
Basicly, CDemu is a software that allows you to mount CD-images. 0.7 supported cue/bin, while the new 0.8 has support for:
.cue (CDRWin)
.iso (ISO9660)
.mds (Alchol 120%)
.ccd (CloneCD)
.nrg (Nero Burning ROM)
Sure, you can mount isos with a loop device and convert other images to iso, but that just sucks.
Sadly, the new version needs a kernel >=2.6.16, so it won't work with Dapper unless you compiled your own newer kernel!
Since you need Edgy or need to compile your own kernel, I'm assuming you have some basic knowledge of Linux. If not, feel free to post questions!
Also feel free to post improvements or errors I made!
We're going to set CDemu up. I also have some scripts to mount them from Nautilus with just a right-click.
1. Get CDemu:
http://prdownloads.sourceforge.net/c...mu-0.8.tar.bz2
2. Extract it somewhere, open a console and cd to the directory you extracted it to
3. Type make, this should compile CDemu - or not.
If it complains about missing stuff, try searching Synaptic for packages that end with -dev and have parts of the name needed by make. Repeat 3.
I would provide a package that can easily be installed, but CDemu seems to be the only app not working with checkinstall :/
4. Type make install. This installs CDemu on your system. To uninstall it again, type make uninstall from this folder.
5. CDemu doesn't like udev and the device-creation script supplied screws everything up. Type gksu gedit /usr/bin/create_cdemu_devs.sh and replace everything in that file with this:
Code:
#!/bin/bash
#if [ -e /dev/.devfs ] ; then
# echo "You have devfs, nodes will be created automagically"
# exit 0
#fi
#if [ -e /dev/.udev ] || [ -e /dev/.udev.tdb ] ; then
# echo "You have udev, nodes will be created automagically"
# exit 0
#fi
#if [ ! -z "${DESTDIR}" ] ; then
# echo "Creating a package, nodes should be created later"
# exit 0
#fi
# find out cdemu device major number
if [ ! -r /proc/devices ]; then
echo "Can't open /proc/devices, make sure /proc is mounted"
exit 0
fi
modprobe cdemu
if [ -z "$(lsmod | grep ^cdemu)" ]; then
echo "Can't load module"
exit 0
fi
cdemumajor=$(grep "^[[:space:]]*[0-9]\+[[:space:]]\+cdemu$" /proc/devices | grep -o "[0-9]\+")
if [ -z "$cdemumajor" ]; then
echo "Can't find cdemu device number in /proc/devices"
exit 0
fi
#modprobe -r cdemu
#
if [ -e /dev/cdemu ]; then
rm -rf /dev/cdemu
fi
if [ -b /dev/cdemu0 ]; then
rm -f /dev/cdemu*
fi
mkdir /dev/cdemu
for drivenumber in `seq -w 0 7` ; do
mknod /dev/cdemu/${drivenumber} b ${cdemumajor} ${drivenumber}
done
#echo "if no error did show up device files created ;-)"
Save the file and exit. This step is important. If you don't edit this file, the CDEMU module will be unloaded every time the file gets executed!
Now type gksu gedit /etc/rc.local and add this to the bottom of the file but before any "exit 0" you may encounter:
Code:
echo " Creating CDemu devices..."
create_cdemu_devs.sh
Save and exit. This will make your system create all the devices at startup.
6. Activate CDemu for a test run. Type sudo create_cdemu_devs.sh to create the devices and load the kernel module.
If no errors showed up, everything is fine.
You don't need to do this everytime you want to mount an image, just this time.
Get this file and extract it somewhere.
then type cdemu 0 /path/to/file/mini.cue followed by a sudo mkdir /media/cdemu0 and sudo mount -t iso9660 -o ro /dev/cdemu/0 /media/cdemu0
This should mount the test file to /media/cdemu0. If this works, move on.
Information about mounting images with CDemu in text mode will appear when typing cdemu in console. Basicly, it's cdemu X /path/to/image to load an image into cdemu-drive X, whereas X is 0-7. It will be loaded into the device /dev/cdemu/X ready to be mounted. To unload the image (after unmounting first), type cdemu -u X
7. If you want to be able to mount images without root rights, do this:
Code:
sudo mkdir /media/cdemu0
sudo mkdir /media/cdemu1
sudo mkdir /media/cdemu2
sudo mkdir /media/cdemu3
sudo mkdir /media/cdemu4
sudo mkdir /media/cdemu5
sudo mkdir /media/cdemu6
sudo mkdir /media/cdemu7
Then do gksu gedit /etc/fstab and add this to the end of the file:
Code:
/dev/cdemu/0 /media/cdemu0 iso9660 ro,user,noauto 0 0
/dev/cdemu/1 /media/cdemu1 iso9660 ro,user,noauto 0 0
/dev/cdemu/2 /media/cdemu2 iso9660 ro,user,noauto 0 0
/dev/cdemu/3 /media/cdemu3 iso9660 ro,user,noauto 0 0
/dev/cdemu/4 /media/cdemu4 iso9660 ro,user,noauto 0 0
/dev/cdemu/5 /media/cdemu5 iso9660 ro,user,noauto 0 0
/dev/cdemu/6 /media/cdemu6 iso9660 ro,user,noauto 0 0
/dev/cdemu/7 /media/cdemu7 iso9660 ro,user,noauto 0 0
Now, after loading the image into CDemu, you just need to do a mount /media/cdemuX to mount the corresponding drive.
8. If you want to be able to mount images in Gnome's Nautilus with just a few clicks, create 2 files in /home/*USER*/.gnome2/nautilus-scripts
cd-mount:
Code:
#!/bin/bash
# Mount CD images
# Get filename extension and make it lower-case
EXT=`echo $1 | sed -e 's/.*\.//'`
EXT_LOW=`echo $EXT | tr 'A-Z' 'a-z'`
# Main
if [ $EXT_LOW == "cue" -o $EXT_LOW == "iso" -o $EXT_LOW == "mds" -o $EXT_LOW == "ccd" -o $EXT_LOW == "nrg" ]; then
# Find a free DEV to mount
DEV=$((`cdemu -s | cut -f 8 -d " " | grep 0 -n -m 1 | cut -c 1`-2))
if [ $DEV -lt "0" ]; then
zenity --info --text "You can not mount any more images."; exit 1
fi
# Only allow mounting an image once
MOUNTED="`cdemu -s | grep "$1" | cut -f11- -d " "`"
DEVMOUNTED="`cdemu -s | grep "$1" | cut -f3 -d " " | sed -e 's@:@@'`"
if [ "$MOUNTED" == "$1" ]; then
zenity --info --text "Image already mounted on cdemu$DEVMOUNTED."; exit 1
fi
# DEV needs to be between 0 and 7
if [ $DEV -ge "0" -a $DEV -le "7" ]; then
cdemu $DEV "$1" &&
mount "/media/cdemu${DEV}" &&
gnome-open "/media/cdemu${DEV}"
fi
# If directory is empty, then release cdemu
sleep 0.5
if [ "$(ls -A /media/cdemu${DEV})" ]; then
echo
else umount "/media/cdemu${DEV}"
cdemu -u $DEV
zenity --info --text "Mount failed."; exit 1
fi
else zenity --info --text "Selected file is no image."; exit 1
fi
cd-unmount:
Code:
#!/bin/bash
# Unmount CD images
# Get filename extension and make it lower-case
EXT=`echo $1 | sed -e 's/.*\.//'`
EXT_LOW=`echo $EXT | tr 'A-Z' 'a-z'`
# Main
if [ $EXT_LOW == "cue" -o $EXT_LOW == "iso" -o $EXT_LOW == "mds" -o $EXT_LOW == "ccd" -o $EXT_LOW == "nrg" ]; then
# Get the cdemu device-number and filename
DEV="`cdemu -s | grep "$1" | cut -f3 -d " " | sed -e 's@:@@'`"
MOUNTED="`cdemu -s | grep "$1" | cut -f11- -d " "`"
# Check if mounted
if [ "$MOUNTED" == "$1" ]; then
umount /media/"cdemu${DEV}"
if [ $DEV -ge "0" -a $DEV -le "7" ]; then
cdemu -u $DEV
fi
sleep 0.5
if [ "$(ls -A /media/cdemu${DEV})" ]; then
zenity --info --text "Unmount failed. Is device busy?"; exit 1
else zenity --info --text "Image unmounted."; exit 0
fi
else zenity --info --text "Image does not appear to be mounted."; exit 1
fi
else zenity --info --text "Selected file is no image."; exit 1
fi
And if you like to be able to create cue-sheets from files missing one:
create-cuesheet
Code:
#!/bin/bash
# Create CUE for BIN
# Isolate the filename without the extension.
BASE=`echo "$1" | sed 's/\.[^.]*$//'`
cat << EOF > "${BASE}.cue"
FILE "$1" BINARY
TRACK 01 MODE1/2352
INDEX 01 00:00:00
EOF
Make all 2/3 files executable! Now right click onto a CD-image in Nautilus, select Scripts and select cd-mount or cd-unmount. Easier than Daemon Tools!
Credits for about half of the script and a few "templates" I worked from goes to adamkane. I wouldn't have been able to pull this off without using his scripts.
Bugs/Todo:
- fixed -- Mounting the same image 2 times renders you unable to unmount them again with those scripts. I'm gonna fix this later. -- fixed
- fixed -- Unmount didn't work for files with spaces -- fixed
- Make a working deb-package.
- .cue files that point to uppercase files which are lowercase in reality won't work and vice versa. You can just open the cuesheet in a text-editor to correct that.
Have fun!
Bookmarks