个人工具

“UbuntuHelp:ManageDiscImages”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/ManageDiscImages}}
 
{{From|https://help.ubuntu.com/community/ManageDiscImages}}
 
{{Languages|UbuntuHelp:ManageDiscImages}}
 
{{Languages|UbuntuHelp:ManageDiscImages}}
== Convert CloneCD Images to ISO ==
+
== Introduction ==
=== Installation ===
+
For an introductory explanation of ISO images, instructions for creating and also burning them see [[UbuntuHelp:IsoImage|IsoImage]].
Download the latest version from [http://sourceforge.net/projects/ccd2iso/ ccd2iso homepage]
+
== Mounting ISO Files ==
extract the archive files
+
For instructions on how to mount an ISO, see [[UbuntuHelp:MountIso#Mounting_ISO_Files|MountIso]].
 +
== Manipulating Other Formats ==
 +
There are many other formats of archives that have been created over the years for numerous reasons. To mount them, it is usually necessary to convert them to ISO and then use your preferred means. Unless otherwise specified, these programs are available in the '''Universe''' [[UbuntuHelp:Repositories/Ubuntu|repository]] and can be installed by [[UbuntuHelp:InstallingSoftware#installing-a-package|numerous means]]. For convenience apturl links have been made, click the package names and they will install as long as the [[UbuntuHelp:AptURL|protocol]] is supported. None of these programs are installed by default.
 +
The following exclusively deals with CLI, there are no graphical equivalents at this time.
 +
=== CloneCD/IMG Images ===
 +
This category covers images created primarily by CloneCD. There are usually several files: a IMG (.img) archive of the dics content, the SUB (.sub) file containing subchannel data and the CCD (.ccd) text descriptor a file used only by CloneCD for storing information about an image. The IMG file is the primary container of data, and as such the only one required for conversion with '''[[UbuntuHelp:apt:ccd2iso|ccd2iso]]''' and mounting.
 +
* '''To Convert'''
 
<pre><nowiki>
 
<pre><nowiki>
tar xvfz ccd2iso-x.x.tar.gz
+
ccd2iso /path/to/example.img /path/to/example.iso
 
</nowiki></pre>
 
</nowiki></pre>
enter the new directory
+
* '''To Mount'''
 +
<pre><nowiki>
 +
sudo mkdir /media/example </nowiki></pre>
 
<pre><nowiki>
 
<pre><nowiki>
cd ccd2iso
+
sudo mount -o loop example.img /media/example </nowiki></pre>
</nowiki></pre>
+
=== CUE/BIN Images ===
You need aclocal-1.6, therefore we have to install automake1.6
+
CUE/BIN (.cue/.bin) files must be converted to be of use. This can be done using the program '''[[UbuntuHelp:apt:bchunk|bchunk]]'''. To use the program, it is necessary to note the path of both the bin and cue files, then the output file.
 +
* '''To Convert'''
 
<pre><nowiki>
 
<pre><nowiki>
sudo apt-get install automake1.6
+
bchunk /path/to/example.bin /path/to/example.cue /path/to/example.iso </nowiki></pre>
</nowiki></pre>
+
=== MDF Images ===
configure and compile it
+
MDF (.mdf) files are primarily created by Alcohol 120%. These can either be converted to ISO using '''[[UbuntuHelp:apt:mdf2iso|mdf2iso]]''' or mounted directly.
 +
* '''To Convert'''
 
<pre><nowiki>
 
<pre><nowiki>
./configure
+
mdf2iso /path/to/example.mdf /path/to/example.iso </nowiki></pre>
make
+
* '''To Mount'''
</nowiki></pre>
+
<pre><nowiki>
install it
+
sudo mkdir /media/example </nowiki></pre>
 
<pre><nowiki>
 
<pre><nowiki>
sudo make install
+
sudo mount -o loop=/dev/loop0 /path/to/example.iso /media/example </nowiki></pre>
</nowiki></pre>
+
=== NRG Images ===
or to install it via a deb file ([[UbuntuHelp:CheckInstall|CheckInstall]])
+
Nero image (.nrg) files can either be converted to ISO using '''[[UbuntuHelp:apt:nrg2iso|nrg2iso]]''' or can be mounted directly.
 +
* '''To Convert''' 
 
<pre><nowiki>
 
<pre><nowiki>
sudo make checkinstall
+
nrg2iso /path/to/example.nrg /path/to/example.iso </nowiki></pre>
</nowiki></pre>
+
* '''To Mount'''
=== Usage ===
+
Normally you would have 3 file from CloneCD image, they are .ccd, .img, and .sub
+
general usage:
+
 
<pre><nowiki>
 
<pre><nowiki>
ccd2iso <.img filename> <.iso filename>
+
sudo mkdir /media/example </nowiki></pre>
</nowiki></pre>
+
for example:
+
 
<pre><nowiki>
 
<pre><nowiki>
ccd2iso myimage.img myimage.iso
+
sudo mount -o loop,offset=307200 /path/to/example.nrg /media/example </nowiki></pre>
</nowiki></pre>
+
== DMG Images ==
== Convert BIN/CUE Images to ISO ==
+
DMG (.dmg) images are primarily used by Apple, conversion of these files will allow data to be accessed. It will not allow the running of OSX programs on Linux without considerable effort not outlined in this guide. The following process will first convert to IMG and then to ISO, you may however stop at the first step if you wish and mount or burn.
 
=== Installation ===
 
=== Installation ===
 +
For instructions on installation, see [[UbuntuHelp:DMG2IMG|DMG2IMG]].
 +
=== To Convert to IMG ===
 +
The following command will convert the example file from DMG to IMG.
 
<pre><nowiki>
 
<pre><nowiki>
sudo apt-get install bchunk
+
dmg2img /path/to/example.dmg /path/to/example.img </nowiki></pre>
</nowiki></pre>
+
Do '''NOT''' follow the instructions for mounting the file at the end of the conversion. It is not advisable to mount to the <code><nowiki>/mnt</nowiki></code> directory.
=== Usage ===
+
=== To Mount ===
As the name implies, a BIN/CUE CD image has two files.
+
As always a directory will be created in <code><nowiki>/media</nowiki></code>, the next step will ensure hfsplus support is available, lastly the IMG file mounted to the directory.
BIN being a binary of the raw CD data, and CUE being an ASCII file of CD layout.
+
general usage:
+
 
<pre><nowiki>
 
<pre><nowiki>
bchunk <image.bin> <image.cue> <basename>
+
sudo mkdir /media/example </nowiki></pre>
</nowiki></pre>
+
for example:
+
 
<pre><nowiki>
 
<pre><nowiki>
bchunk myimage.bin myimage.cue myimage
+
sudo modprobe hfsplus</nowiki></pre>
</nowiki></pre>
+
Where basename(myimage) is myimage.iso of the produced file.
+
== Convert DMG (compressed z-lib) to ISO ==
+
==== Notes ====
+
I noticed a lot of people having difficulties with the old method, using the deprecated PERL script, so this method is a two step method. Convert to img, mount, then use Brasero to create an ISO. This way will also let you just mount the image if you don't want to take the last step of converting and creating an ISO from it. The old method has been preserved on the Wiki for the case that this way does not work.
+
=== New Method ===
+
==== Installation ====
+
For this method we'll be using dmg2img, written by Jean-Pierre Demailly. Follow the [[UbuntuHelp:DMG2IMG|DMG2IMG]] installation instructions to get it installed.
+
==== Usage ====
+
Pretending we're working with 'MyDMG.dmg' we'll do the following (Example output shown).
+
<pre><nowiki>
+
ubuntuer@(fridge)[~/myDMGs]$ dmg2img MyDMG.dmg newImage.img
+
 
+
dmg2img v1.1 is derived from dmg2iso by vu1tur ([email protected])
+
 
+
MyDMG.dmg --> newImage.img
+
 
+
reading property list, 175755 bytes from address 712400386 ...
+
 
+
decompressing:
+
opening partition 0 ...  0.00 %  ok
+
opening partition 1 ...  0.00 %  ok
+
opening partition 2 ... 100.00 %  ok
+
Archive successfully decompressed as  newImage.img
+
 
+
Linux users should be able to mount the archive [as root] by :
+
 
+
modprobe hfsplus
+
mount -t hfsplus -o loop newImage.img /mnt
+
</nowiki></pre>
+
You'll not want to follow their instructions exactly. Mounting to /mnt could cause problems, or just be messy. A better idea is to make a temporary folder and mount the image there
+
<pre><nowiki>
+
ubuntuer@(fridge)[~/myDMGs]$ mkdir -p /tmp/images/myImage
+
ubuntuer@(fridge)[~/myDMGs]$ sudo modprobe hfsplus
+
ubuntuer@(fridge)[~/myDMGs]$ sudo mount -t hfsplus -o loop newImage.img /tmp/images/myImage
+
</nowiki></pre>
+
At this point the image is available for browsing under the /tmp/images/myImage directory. If that's all you need then you don't need to go any further. If you would like to create an ISO you'll need to keep on reading
+
==== Creating the ISO ====
+
If you're using GNOME then you can run Brasero from the 'Applications -> Sound & Video' menu. Brasero provides an option called 'Create a New Data Project' which is accessible from either the main Brasero screen, or through 'Project -> New Project -> New Data Project'. In the left panel you will browse to where you mounted the img (/tmp/images/myImage in this example). Select all the files that are in that directory and drag them to the panel on the right side of the screen. As you add more and more files you will see a bar graph fill up indicating how much space you have used and have remaining. You can change what kind of disk it's checking your space against by selecting the icon to the left of the bar graph and choosing an option from there.
+
When you're finished just press "Burn" on the bottom of the right panel, to the right of the bar graph. A new screen will come up where you will be able to "Select a disc to write to". Select "Image File" if you have multiple options to chose from. If you press the "Properties" button on the right you can chose where to save the iso and what it will be named.
+
Next to "Label of the disk" You chose anything you'd like that you think adequately describes your disk.
+
Selecting "Increase compatibility with Windows systems" is entirely your decision, the specifics of what that option does is out side of the scope of this Wiki.
+
=== Old Method ===
+
==== Installation ====
+
Download the latest version from [http://vu1tur.eu.org/tools/ here]
+
and move the perl script for example into the directory: <code><nowiki>/usr/local/bin/</nowiki></code>
+
<pre><nowiki>
+
sudo mv dmg2iso.pl /usr/local/bin/
+
</nowiki></pre>
+
=== Usage ===
+
dmg2iso.pl <filename.dmg> <filename.iso>
+
=== Example ===
+
dmg2iso.pl disc1.dmg disc1.iso
+
<<Anchor(MountISOFiles)>>
+
== Mount ISO Files ==
+
Create the directory for mount point:
+
<pre><nowiki>
+
sudo mkdir -p /mnt/iso
+
</nowiki></pre>
+
Use mount command as follows (assumes that your ISO file name is disk1.iso):
+
<pre><nowiki>
+
sudo mount -o loop disk1.iso /mnt/iso
+
</nowiki></pre>
+
Now your ISO is mounted on <code><nowiki>/mnt/iso/</nowiki></code>
+
== 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
+
<pre><nowiki>
+
sudo apt-get install fuseiso nautilus-actions
+
</nowiki></pre>
+
Add permitted users to the fuse group (run once for each user who should be able to mount using fuse).
+
<pre><nowiki>
+
sudo usermod -a -G fuse username
+
</nowiki></pre>
+
Logout and back in to have the current logged in user get the fuse group permissions.
+
Download the userisomount.sh script from [http://thefrys.com/userisomount.sh here].  Copy the script to /usr/local/bin/ and make it executable.
+
<pre><nowiki>
+
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
+
</nowiki></pre>
+
*note: ~/Desktop is the default firefox download location.  If you saved the file elsewhere, adjust as necessary.
+
Download the Nautilus Actions Schemas for [http://thefrys.com/mount.schemas MOUNTING] and [http://thefrys.com/umount.schemas 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.
+
'''Note:''';
+
''For Jaunty Jackalope, the nautilus-actions package was updated. mount.shemas and umount.schemas needs to be edited or else you wont be able to import them. After downloading the files, edit them with your favorite text-editor and replace''
+
<pre><nowiki>
+
<default>1.1</default>
+
</nowiki></pre>
+
''with''
+
<pre><nowiki>
+
<default>2.0</default>
+
</nowiki></pre>
+
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) 
+
<pre><nowiki>
+
/usr/local/bin/userisomount.sh clean
+
</nowiki></pre>
+
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:
+
<pre><nowiki>
+
userisomount.sh clean
+
</nowiki></pre>
+
Vote for this to be included in upcoming versions of Ubuntu!: [http://brainstorm.ubuntu.com/idea/11275/]
+
=== Troubleshooting ===
+
<pre><nowiki>
+
cat /etc/group |grep fuse
+
</nowiki></pre>
+
should return something like: "fuse:x:###:yourusername".  If not, rerun the usermod command above.
+
<pre><nowiki>
+
ls -al ~ |grep .mymounts
+
</nowiki></pre>
+
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:
+
 
<pre><nowiki>
 
<pre><nowiki>
sudo userisomount.sh clean ; sudo rm -r ~/.mymounts ; sudo chown username:username ~/.gtk-bookmarks
+
sudo mount -t hfsplus -o loop example.img /media/example
 
</nowiki></pre>
 
</nowiki></pre>
 +
At this point, the image is available for browsing under the <code><nowiki>/media/example</nowiki></code> directory. These files can now be transferred to hard drive or elsewhere for storage. If you want an ISO file, continue to the next section.
 +
=== Creating the ISO ===
 +
The IMG file we now have is still an hfsplus archive, which cannot simply be converted into an ISO. As such, we will have to use an intermediary step to convert the data from its stored format to an ISO. Since we've already mounted it to a directory, the easiest way is simply to create a new ISO with any disc authoring program you are familiar with. Brasero, [[UbuntuHelp:GnomeBaker|GnomeBaker]] and K3b are just a few options for this.
 +
Simply open your software of choice and start a new data disc. Then add the files from the mounted archive to this new data disc project. Once satisfied, select '''Burn''' and instead of recording a CD or DVD, choose to make an ISO file.
 +
For most users, Brasero will be available, for those inexperienced in it's use the following is a guide.
 +
If you're using GNOME then you can run Brasero from '''Applications''' -> '''Sound & Video''' -> '''Brasero'''. Start a new data disc by selecting '''Data Project''' from the main Brasero window, or through the menu '''Project''' -> '''New Project'''. Ensure the side panel is enabled from '''View''' -> '''Enable Side Panel'''. From the side panel, navigate to the directory where the IMG was mounted, usually the name of the IMG will be listed in the Places pane. In our example, the location in Places would be called '''example''' located in the <code><nowiki>/media/example</nowiki></code> directory. Simply drag all the files and folders you want to the project.
 +
Once ready, push '''Burn...''' and ensure you select to create '''Image File:''' at the new window so it creates an ISO. If you wish to change the default name or the location it is created, select '''Properties'''. Once satisfied, push '''Burn''' and the ISO will be created. Leave ''Increase compatibility with Windows systems'' checked unless you know better.
 +
== Disc Image Integration for Nautilus ==
 +
=== Archive Mounter ===
 +
By default in GNOME, Nautilus has support for mounting ISOs by simply right clicking on the file and selecting Open with '''Archive Mounter'''. This option still appears limited, mainly designed for archives and ISOs. This feature is still under development, thus the following guide will be preserved.
 +
== See Also ==
 +
* '''cdemu''' is a kernel module for mounting Cue/Bin files directly. To install it you would have to setup linux headers, compile the module and modprobe it in. This is out of the scope of this page. There is a script under development in the Ubuntu forums for automating the building of '''cdemu''' [http://www.ubuntuforums.org/showthread.php?t=149963 Located Here] (Use this at your own risk.)
 +
* [http://www.debianadmin.com/mount-and-unmout-iso-images-without-burning-them.html "Mount and Unmount ISO images without burning them"] has a nice step-by-step explanation (with screen shots) showing how to mount and unmount ISO images.
 
----
 
----
[[category:CategoryCleanup]]
 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2009年11月17日 (二) 19:55的最新版本


Introduction

For an introductory explanation of ISO images, instructions for creating and also burning them see IsoImage.

Mounting ISO Files

For instructions on how to mount an ISO, see MountIso.

Manipulating Other Formats

There are many other formats of archives that have been created over the years for numerous reasons. To mount them, it is usually necessary to convert them to ISO and then use your preferred means. Unless otherwise specified, these programs are available in the Universe repository and can be installed by numerous means. For convenience apturl links have been made, click the package names and they will install as long as the protocol is supported. None of these programs are installed by default. The following exclusively deals with CLI, there are no graphical equivalents at this time.

CloneCD/IMG Images

This category covers images created primarily by CloneCD. There are usually several files: a IMG (.img) archive of the dics content, the SUB (.sub) file containing subchannel data and the CCD (.ccd) text descriptor a file used only by CloneCD for storing information about an image. The IMG file is the primary container of data, and as such the only one required for conversion with ccd2iso and mounting.

  • To Convert
 ccd2iso /path/to/example.img /path/to/example.iso
  • To Mount
 
sudo mkdir /media/example 
sudo mount -o loop example.img /media/example 

CUE/BIN Images

CUE/BIN (.cue/.bin) files must be converted to be of use. This can be done using the program bchunk. To use the program, it is necessary to note the path of both the bin and cue files, then the output file.

  • To Convert
bchunk /path/to/example.bin /path/to/example.cue /path/to/example.iso 

MDF Images

MDF (.mdf) files are primarily created by Alcohol 120%. These can either be converted to ISO using mdf2iso or mounted directly.

  • To Convert
mdf2iso /path/to/example.mdf /path/to/example.iso 
  • To Mount
 
sudo mkdir /media/example 
sudo mount -o loop=/dev/loop0 /path/to/example.iso /media/example 

NRG Images

Nero image (.nrg) files can either be converted to ISO using nrg2iso or can be mounted directly.

  • To Convert
nrg2iso /path/to/example.nrg /path/to/example.iso 
  • To Mount
sudo mkdir /media/example 
sudo mount -o loop,offset=307200 /path/to/example.nrg /media/example 

DMG Images

DMG (.dmg) images are primarily used by Apple, conversion of these files will allow data to be accessed. It will not allow the running of OSX programs on Linux without considerable effort not outlined in this guide. The following process will first convert to IMG and then to ISO, you may however stop at the first step if you wish and mount or burn.

Installation

For instructions on installation, see DMG2IMG.

To Convert to IMG

The following command will convert the example file from DMG to IMG.

dmg2img /path/to/example.dmg /path/to/example.img 

Do NOT follow the instructions for mounting the file at the end of the conversion. It is not advisable to mount to the /mnt directory.

To Mount

As always a directory will be created in /media, the next step will ensure hfsplus support is available, lastly the IMG file mounted to the directory.

sudo mkdir /media/example 
sudo modprobe hfsplus
sudo mount -t hfsplus -o loop example.img /media/example

At this point, the image is available for browsing under the /media/example directory. These files can now be transferred to hard drive or elsewhere for storage. If you want an ISO file, continue to the next section.

Creating the ISO

The IMG file we now have is still an hfsplus archive, which cannot simply be converted into an ISO. As such, we will have to use an intermediary step to convert the data from its stored format to an ISO. Since we've already mounted it to a directory, the easiest way is simply to create a new ISO with any disc authoring program you are familiar with. Brasero, GnomeBaker and K3b are just a few options for this. Simply open your software of choice and start a new data disc. Then add the files from the mounted archive to this new data disc project. Once satisfied, select Burn and instead of recording a CD or DVD, choose to make an ISO file. For most users, Brasero will be available, for those inexperienced in it's use the following is a guide. If you're using GNOME then you can run Brasero from Applications -> Sound & Video -> Brasero. Start a new data disc by selecting Data Project from the main Brasero window, or through the menu Project -> New Project. Ensure the side panel is enabled from View -> Enable Side Panel. From the side panel, navigate to the directory where the IMG was mounted, usually the name of the IMG will be listed in the Places pane. In our example, the location in Places would be called example located in the /media/example directory. Simply drag all the files and folders you want to the project. Once ready, push Burn... and ensure you select to create Image File: at the new window so it creates an ISO. If you wish to change the default name or the location it is created, select Properties. Once satisfied, push Burn and the ISO will be created. Leave Increase compatibility with Windows systems checked unless you know better.

Disc Image Integration for Nautilus

Archive Mounter

By default in GNOME, Nautilus has support for mounting ISOs by simply right clicking on the file and selecting Open with Archive Mounter. This option still appears limited, mainly designed for archives and ISOs. This feature is still under development, thus the following guide will be preserved.

See Also

  • cdemu is a kernel module for mounting Cue/Bin files directly. To install it you would have to setup linux headers, compile the module and modprobe it in. This is out of the scope of this page. There is a script under development in the Ubuntu forums for automating the building of cdemu Located Here (Use this at your own risk.)
  • "Mount and Unmount ISO images without burning them" has a nice step-by-step explanation (with screen shots) showing how to mount and unmount ISO images.