prev next index

Saving a CD-ROM to file and Mounting it on Red Hat Linux 6.0 and Newer
Updated March 20, 2002
Created December 29, 2000


You can actually pull in a copy of a cdrom, then mount it into your file system. You would then be able to traverse the image just as if it was out on a cdrom. Lets bring in a copy of a RedHat 6.0 CD-ROM

copy your cd into an image file:
>     dd if=/dev/cdrom of=RedHat60.img
After you have copied it in, there are several ways to make sure the image is good.
>     sum -r /dev/cdrom
>     sum -r RedHat60.img
Compare the sums.
>     cksum /dev/cdrom
>     cksum RedHat60.img
Compare the checksums.

You can also compare the contents if the above methods give you problems.
>     mount /mnt/cdrom
>     mkdir /tmp/RH60CD
>     mount -t iso9660 RedHat60.img /tmp/RH60CD -o loop
>     diff -r /tmp/RH60CD /mnt/cdrom
You should get a listing of any differences between the files. In the case of the RedHat 6.0 CD, there are several broken links on the distribution media. These show up something like "target not found" for each broken link.

In the above command " mount -t iso9660 RedHat60.img /tmp/RH60CD -o loop" you saw how to manually mount an image so that you can look into it. This method also works for any diskette or image file that has been data dumped to the hard drive.

To make a permanent mount of an image file, you need to make a mount point, then edit your /etc/fstab.
>     mkdir /home/ftp/pub/RedHat60/i386
>     vi /etc/fstab
You should create an entry in /etc/fstab as follows:
/home/ftp/pub/RedHat60/RedHat60.img /home/ftp/pub/RedHat60/i386 iso9660 defaults,loop,ro   0 0
The last two values of "0 0" mean that dump and fsck should ignore dumping (dump is a type of backup) or fscking (fsck is to check the file system) the individual cdrom image. One would normally have dump or fsck work directly on the filesystem that _contains_ your cdrom image.

Once you make your change in /etc/fstab and save the file, your image should be mounted every time that you boot.

All of this assumes you are copying an ISO cdrom image. If you have a HFS (MAC) cdrom, then you would not use "iso9660", but "hfs" instead, like so:
mount -t hfs MYIMAGE /mnt/mymnt -o loop

Updates:
For more information, check the following two locations:

prev next index
NEW! Search this Site!:
Search this site powered by FreeFind
Homepage: http://www.cpqlinux.com
Site Map: http://www.cpqlinux.com/datesort.html





1