Sharing a CD-ROM via NFS

Tutorial written by Joey Kelly
July 18, 2006

1. Insert CD-ROM into drive (in this case, I'm using the DVD drive, your mileage may vary).

2. Mount the disk, as root:

  [root@moses etc]# mount /mnt/cdrom1

Note that this works because /etc/fstab has existing entries for my CD-ROM drives. If yours isn't listed, you'd have to do something like "mount /dev/device-name /mnt/device".

  [root@moses etc]# cat /etc/fstab | grep cdrom
  /dev/cdrom              /mnt/cdrom              udf,iso9660 noauto,owner,kudzu,ro 0 0
  /dev/cdrom1             /mnt/cdrom1             udf,iso9660 noauto,owner,kudzu,ro 0 0

3. Edit /etc/exports with vi (or your favorite editor) and add the following lines:

  [root@moses etc]# cat /etc/exports
  # Do not forget to run /etc/rc.d/init.d/nfs reload after changing this file
  #/mnt/cdrom      *(ro)
  /mnt/cdrom1     *(ro)

As you can see, the first entry is commented out, in case I need to also share that drive at some point.

4. Restart (or start) the NFS server:

  [root@moses etc]# /etc/init.d/nfs restart

5. The contents of the CD should now be accessible from another workstation. You can now mount the volume:

  [root@samson mnt]# mkdir /mnt/CD
  [root@samson mnt]# mount moses:/cdrom1 /mnt/CD

6. Once you're finished using the CD-ROM, you need to unmount it on the client workstation:

  [root@samson mnt]# umount /mnt/CD

7. Now you need to unmount it locally. Comment out the entry in /etc/exports that you created earlier, then restart the NSF server:

  [root@moses etc]# cat /etc/exports
  # Do not forget to run /etc/rc.d/init.d/nfs reload after changing this file
  #/mnt/cdrom     *(ro)
  #/mnt/cdrom1    *(ro)
  [root@moses etc]# /etc/init.d/nfs restart

8. Finally, unmount the CD-ROM:

  [root@moses etc]# umount /mnt/cdrom1

...and eject the CD.


Copyright (c) 2006, Joey Kelly.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is located at