CentOS DVD/CD Permission Denied Errors

You build yourself a virtual (or real, come to that) CentOS server, on which you plan to install Oracle. You have prepared your Oracle DVD ISO in the manner I described In an earlier post here. You insert that DVD (or get the virtual machine manger to present the ISO as though a physical DVD had been inserted) and CentOS helpfully auto-mounts it. You become the oracle user and invoke the runInstaller script… and you get told

 −bash: /media/CDROM/runInstaller: /bin/sh: bad interpreter: Permission denied

What’s wrong? Well, CentOS (like a lot of distros before it) has ‘broken’ auto-mount by ensuring that “noexec” permissions are set for auto-mounted CDs and DVDs. The idea is that ordinary users can’t run executables from removable media -and, in most circumstances, that might be a sensible security measure to have in place. But not in this case! In this case, the oracle user (who counts, in this context, as decidedly ‘ordinary’!) must be able to execute that runInstaller script. How then to allow that? Easy:

umount /media/CDROM
mount -o loop /dev/hdc /media

Those two commands (both issued as root) first dismount the automounted CD or DVD and then re-mount it as a loop device. Manually mounting the drive causes the “exec” permission to be set… and thereafter, the oracle user will be able to run the installation script without a problem.

Of course, the specifics of those commands will need to be changed to suit your local circumstances. The DVD drive might not be /dev/hdc, for example, and you might want to mount the contents of your ISO image somewhere other than /media. But hopefully, you get the idea.

Incidentally: if you don’t know what device name identifies your DVD drive, try mounting it after the drive has already auto-mounted. For example, when I ‘insert’ my ISO image, it gets mounted as /media/CDROM. So if I then try, as root, to mount /media/CDROM again, I get told:

mount: /dev/hdc already mounted on /media/CDROM

…and right at the beginning of that error message, there’s your proper device identifier.

(Note: this post was transferred from the old Dizwell dokuwiki website. Its content may no longer be relevant).

Oracle DVD Creation on Linux

If you get your free OTN copies of Oracle 11g from here, then you’ll be the proud owner of a zip file called something like linux.x64_11gR1_database.zip. That’s perfectly fine if you don’t mind unzipping the files on your hard disk and installing Oracle from there. But if I create a virtual machine to run Oracle, I would usually prefer to be able to install Oracle from a DVD (or, at least, a DVD image in the form of an ISO), because that way I needn’t consume nearly 4GB of virtual disk space by copying the zip file to it and then unpacking it. So the question then arises, how do you turn that downloaded zip file into a functional DVD image?

Well, one thing you can’t do is use Brasero (the default Ubuntu/Gnome CD and DVD creation tool) to simply create a disk image of the extracted zip file! That’s because Oracle uses a lot of nested directories, and Brasero doesn’t let you configure the necessary extensions to the ISO standard to allow all those directories to be read properly from the finished DVD image. You’ll just get execution errors the minute you try using a DVD image that’s been constructed that way.

I am sure various GUI tools could be employed to get around this problem (and if I was a KDE user, I know that K3B can do the job with ease), but the simplest thing is for confirmed Gnome users is to issue the following command in a terminal window:

genisoimage -o Desktop/ora11gx64.iso -R -J -U -N -iso-level 4 Desktop/database

What all that means is that you’re using the program genisoimage (which should be installed by default in Ubuntu 9.04: if not, use aptitude or the Synaptic Package Manager to install it) to output a file called (in my case) ora11gx64.iso in my home’s Desktop directory. The image should use the Rockridge and Joilet extensions (which is what lets those multiple nested sub-directories work OK). The -N switch means ‘don’t append version numbers to files’, which would screw things up badly. And the -U means ‘please be relaxed about filenames which violate ISO9660 standards’. Finally, the -iso-level is set to 4, which allows very long file names. Note that the source of the entire DVD image is to be the Desktop/database directory (which will only exist, of course, if I’ve already extracted my downloaded zip file on my desktop).

The output from that lot takes just a few moments to create, but it will be usable in an Oracle installation. You can use the ISO output file directly if installing Oracle in a virtual machine; or you can use Brasero to burn it to a physical DVD.

Update: The 11g Release 2 OTN downloads come in two parts. That is, there are two separate zip files, each about 1GB in size. Those need to be unzipped into a single directory (called database) before the genisoimage command can be pointed at it. So, for that release of Oracle, you have to do the following:

  • Download both zip files to your desktop
  • Open a command prompt and unzip the linux_11gR2_database_1of2.zip file. That will create a database directory.
  • Now unzip the linux_11gR2_database_2of2.zip file. The contents of this file will be extracted and merged into the already-existing database directory.
  • Now you can create your ISO image from the Desktop/database directory, using the command shown above.

(Note: this post was transferred from the old Dizwell dokuwiki website. Its content may no longer be relevant).