LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 06-01-2004, 09:50 AM   #1
Burgin
Member
 
Registered: Apr 2004
Posts: 54

Rep: Reputation: 15
Simple Utility for viewing/extracting contents in ISO files


Sounds like a stupid question but I canīt seem to find what Iīm looking for by googling.

I just want see and extract whatīs inside an ISO image file without burning a CD. Iīd like a simple tool that runs on Linux OR Windows.

Youīd think there would be a plugin for Winzip or the KDE Archiving tool that would let you do this.

Last edited by Burgin; 06-01-2004 at 10:00 AM.
 
Old 06-01-2004, 10:17 AM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
I think rar can extract the contents of an iso, and you could always simply Mount the image and access what's inside the iso without a problem . Needless to say, if you extract the contents of the iso with rar, it will no longer be a bootable image...

As Windows lacks the "mount" command, you could use a third part program as Daemon Tools to mount iso images... If you have good free space on your HD it's always good practice to convert a CD (specially games) into iso, then "mount" them and run everything from the HD for better performance, plus you don't need to look after the CD's all the time you want to play a game
 
Old 06-01-2004, 10:37 AM   #3
Burgin
Member
 
Registered: Apr 2004
Posts: 54

Original Poster
Rep: Reputation: 15
Ah, you can just mount it! I should have thought of that. No need to install anything special.

Thanks Xander...
 
Old 06-01-2004, 10:38 AM   #4
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
mount -o loop -t iso9660 iso_name.iso /mnt/mount_point_desired
 
Old 06-01-2004, 10:53 AM   #5
Burgin
Member
 
Registered: Apr 2004
Posts: 54

Original Poster
Rep: Reputation: 15
Thanks guys, now the next logical step might be to do all this on the fly with a script that takes the name of an ISO file as an arg and then creates a subdir under under /mnt of the same name and then runs that Ļmount -o loop....Ļ

but I havenīt quite got that far yet in my studies.
 
Old 06-01-2004, 11:26 PM   #6
jspenguin
Member
 
Registered: Feb 2003
Location: Wichita, KS
Distribution: Heavily modified Redhat
Posts: 194

Rep: Reputation: 30
Put this script in your ~/bin directory as 'whatson':

Code:
#!/bin/bash

sdir=${1:-cdrom}


if [ $sdir == cdimg ]; then
    if [ `id -u` != '0' ]; then
	export WHATSON_CDIMG_FILE=$2
	echo "You must become root to mount an image"
	exec su -c "$0 cdimg"
    fi
    file=$2
    [ -z $file ] && file=$WHATSON_CDIMG_FILE
    dir=/mnt/tmp-whatson-$$
    mkdir $dir
    mount="mount -t iso9660 -o loop $file $dir"
    remove=1
else
    dir=/mnt/$sdir
    eject=1
    mount="mount $dir"
    
fi
echo "$mount"
if [ x$TERM == xxterm ]; then
    PROMPT_COMMAND='echo -ne "\033]0;[whatson '$sdir'] ${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
    export PROMPT_COMMAND
fi
[ -z $eject ] || eject -t $dir &> /dev/null
if $mount; then
    cd $dir
    echo 'Contents:'
    ls --color=tty -Fhp 
    echo 'Starting subshell...'
    bash
    cd ~
    umount $dir
fi
[ -z $eject ] || eject $dir &> /dev/null
[ -z $remove ] || rm -rf $dir
This is a script I first wrote a long time ago to help me sort out a bunch of unlabeled CDRs I had laying around.

To use it for physical media (cds, floppies, etc.), run it as 'whatson [directory]' where directory is the subdirectory of /mnt where the medium is mounted (e.g. floppy for /mnt/floppy, cdrom for /mnt/cdrom). If the directory is omitted, it defaults to 'cdrom'. It will automatically close the tray (on cdroms and dvdroms), mount it, start a shell, and will unmount and eject on exit.

For images, use the command 'whatson cdimg image-file' where image-file is the file name of the image to be mounted. If you are not running as root, the script will prompt you for the password before mounting. It will then run the same as for physical media (except it cannot eject or close the tray).

Example:
Code:
$ whatson
mount /mnt/cdrom
Contents:
ANNOUNCE.9_0   CHECKSUMS.md5      COPYRIGHT.TXT      FILELIST.TXT  kernels/      RELEASE_NOTES    SPEAK_INSTALL.TXT
BOOTING.TXT    CHECKSUMS.md5.asc  CRYPTO_NOTICE.TXT  GPG-KEY       PACKAGES.TXT  slackware/       SPEAKUP_DOCS.TXT
ChangeLog.txt  COPYING            FAQ.TXT            isolinux/     README90.TXT  Slackware-HOWTO  UPGRADE.TXT
Starting subshell...
$ exit


$ whatson dvd
mount /mnt/dvd
Contents:
AUIDO_TS/    VIDEO_TS/
$ exit

$ whatson cdimg tmp.iso
You must become root to mount an image
Password:
mount -t iso9660 -o loop tmp.iso /mnt/tmp-whatson-2042
Contents:
foo/   bar/
# exit
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting an ISO image logosys Linux - Newbie 1 08-04-2005 06:37 PM
Viewing networked file contents with ftp linuxhippy Slackware 1 05-08-2005 08:11 AM
Extracting ISO-files The Karl Linux - Software 8 03-23-2005 03:01 AM
extracting iso image lil213 Linux - Software 2 01-04-2004 03:06 AM
viewing contents of CD drive aymbpc Linux - Newbie 2 08-31-2003 05:55 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 02:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration