Auto Mount Iso Image Via /etc/fstab

written by Arief Bayu Purwanto on October 10, 2008 in Tips N Trick with 6 comments

So, you have a cd image and want to mount automatically every time you start your linux? Here, I’ll show you how to do it.

  1. First step is, put your file at some place where you will not move it again. Why? Because you’ll have to adjust your /etc/fstab entry if you move the file. For this tutorial, we will call it /home/cd_images/some_cd.iso
  2. Then, create a folder where you want it mounted. Let’s call it /home/m_images/mounted.
  3. Next step, open up /etc/fstab. Issue this command on terminal: sudo gedit /etc/fstab.
  4. Add this line to /etc/fstab:
    /home/cd_images/some_cd.iso  /home/m_images/mounted  udf,iso9660  user,loop  0  0
    
  5. Save your file and restart your PC to see it in action.


Now, you have your cd image automatically mounted when your PC is started.