Technofunction

Mounting or Extracting files from .iso Image in Linux

If you download a file in .iso extension its an image file of the orginal File. You need to write it to a CD/DVD. But you can directly extract its files without the need of writing it out to a CD/DVD. For this consider the following scenario:

Suppose we have a file named file.iso on Desktop and we need to see all the files under it and even need to copy a file named Server to directory /etc. First login as root or you can even use sudo command if you have been alloted the priviledges:

  • You need to mount the image first so consider creating a iso directory under /mnt with following command

# mkdir /mnt/iso

  • Next mount the image file to this directory

# mount -o /root/Desktop/file.iso /mnt/iso

  • to see the file contents simple change directory to /mnt/iso and follow up with the ls command

    # cd /mnt/iso

    # ls

    • Now you can simply copy any file to your desired destination. Lets say in this scenario we have

    # cp -r Server /etc

    • If you dont want to mount the file again next time when you use simply copy all the files to the desired directory.

    Leave a Reply