个人工具

UbuntuHelp:ManageDiscImages

来自Ubuntu中文

Wikibot讨论 | 贡献2007年11月30日 (五) 20:12的版本

跳转至: 导航, 搜索


Convert CloneCD Images to ISO

Installation

Download the latest version from ccd2iso homepage extract the archive files

tar xvfz ccd2iso-x.x.tar.gz

enter the new directory

cd ccd2iso

You need aclocal-1.6, therefore we have to install automake1.6

sudo apt-get install automake1.6

configure and compile it

./configure
make

install it

sudo make install

or to install it via a deb file (CheckInstall)

sudo make checkinstall

Usage

Normally you would have 3 file from CloneCD image, they are .ccd, .img, and .sub general usage:

ccd2iso <.img filename> <.iso filename>

for example:

ccd2iso myimage.img myimage.iso

Convert BIN/CUE Images to ISO

Installation

sudo apt-get install bchunk

Usage

As the name implies, a BIN/CUE CD image has two files. BIN being a binary of the raw CD data, and CUE being an ASCII file of CD layout. general usage:

bchunk <image.bin> <image.cue> <basename>

for example:

bchunk myimage.bin myimage.cue myimage

Where basename(myimage) is myimage.iso of the produced file.

Convert DMG (compressed z-lib) to ISO

Installation

Download the latest version from here and move the perl script for example into the directory: /usr/local/bin/

sudo mv dmg2iso.pl /usr/local/bin/

Usage

dmg2iso.pl <filename.dmg> <filename.iso>

Example

dmg2iso.pl disc1.dmg disc1.iso

Mount ISO Files

Create the directory for mount point:

sudo mkdir –p /mnt/iso

Use mount command as follows (assumes that your ISO file name is disk1.iso):

sudo mount -o loop disk1.iso /mnt/iso

Now your ISO is mounted on /mnt/iso/

Integrate Disk Image Mounting/Unmounting into Gnome (Nautilus)

The following will allow you to mount disk images (.iso, .img, .bin, .nrg, .mdf) by simply right clicking on the image file and selecting "Mount Disk Image". This solution uses fuse, so it does not require sudo rights or a password! The mounted image will be linked on the desktop, in the Places menu, and on the Places Bar in Nautilus; similar to how removable devices (CD/DVD/USB) appear. To unmount an image, right click it's desktop icon and select "Unmount Disk Image". All disk image mounts will be removed upon a restart of gnome.

  • NOTE: Only disk images that are part of the system hierarchy are supported, images on smb://, nfs://, etc. are not supported unless those remote file systems are mounted to a local folder.

Install fuseiso and nautilus-actions package

sudo apt-get install fuseiso nautilus-actions

Add permitted users to the fuse group (run once for each user who should be able to mount using fuse).

sudo usermod -a -G fuse username

Logout and back in to have the current logged in user get the fuse group permissions. Download the userisomount.sh script from here. Copy the script to /usr/local/bin/ and make it executable.

sudo cp ~/Desktop/userisomount.sh /usr/local/bin/
sudo chown root:fuse /usr/local/bin/userisomount.sh
sudo chmod 754 /usr/local/bin/userisomount.sh
  • note: ~/Desktop is the default firefox download location. If you saved the file elsewhere, adjust as necessary.

Download the Nautilus Actions Schemas for MOUNTING and UNMOUNTING disk images from within nautilus. Import these into the Nautilus Actions Extension, by opening (System Menu -> Preferences -> Nautilus Actions Configuration) and clicking Import/Export. Create an entry named "Clean Disk Image Mounts" in (System Menu -> Preferences -> Sessions -> Startup Programs) that runs the following command at startup. (Place the command below in the command box)

/usr/local/bin/userisomount.sh clean

By default, the images are mounted in the user's home directory in a hidden folder called ".mymounts", and the desktop icon used will be gtk-dev-removable from the current icon theme. Both of these parameters can be modified at the top of the /usr/local/bin/userisomount.sh script. To quickly unmount all of your mounted images, you can press Alt+F2 and execute:

userisomount.sh clean

Troubleshooting

cat /etc/group |grep fuse

should return something like: "fuse:x:###:yourusername". If not, rerun the usermod command above.

ls -al ~ |grep .mymounts

should show you as the owner and group, if it shows root, then you ran the script using sudo and need to run the following command to fix it:

sudo userisomount.sh clean ; sudo rm -r ~/.mymounts ; sudo chmod username:username ~/.gtk-bookmarks