ISO Images -- Changing contents

Discuss Applications

ISO Images -- Changing contents

Postby agent007 » Sat Apr 19, 2003 3:40 am

Hi..

Can i add a file to a iso image and changing contents etc?? i want to add a file to an image which i have. i cant copy it to the hdd and back agin to cd as then i lose the booting ability the cd has..

thanks,
007
agent007
administrator
administrator
 
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Postby Void Main » Sat Apr 19, 2003 6:19 am

Not if you copy it right. You want to copy the CD to your hard drive as an ISO:

$ cat /dev/cdrom > cdfile.iso

Now to change the contents you need to mount the image but when making changes just make sure you don't go over the maximum size that your CD can hold.

# mkdir /mnt/cdfile
# mount cdfile.iso /mnt/cdfile -o loop
# cd /mnt/cdfile

make changes then

# cd
# umount /mnt/cdfile

If you have the mkcd script installed stick a blank CDR in your burner and:

# mkcd cdfile.iso
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby agent007 » Sat May 31, 2003 10:53 am

This doesnt work.......since the mounted ISO is mounted in read-only.

007
agent007
administrator
administrator
 
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Postby Tux » Sat May 31, 2003 11:09 am

Did the ISO file have read-only permissions before you mounted it on the loopback?
Tux
guru
guru
 
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Postby agent007 » Sat May 31, 2003 11:16 am

I made sure it had read and write permissions....

007
agent007
administrator
administrator
 
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Postby Tux » Sat May 31, 2003 11:55 am

Is the mountpoint writeable to your user?
Tux
guru
guru
 
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Postby Void Main » Sat May 31, 2003 1:38 pm

What distro are you running? I have been doing this for years and have never had a problem. The only way it will mount the ISO file read/only is if you specify "ro" in the mount options.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby agent007 » Sat May 31, 2003 11:53 pm

I've followed the instructions to the point. Am doing everything under r00t....The image mounts fine, but when deleting a file in the mounted image, this error comes up...

rm: remove write-protected regular file `movie.avi'? y
rm: cannot remove `movie.avi': Read-only file system


This is RedHat 9.....The permissions of the folder /mnt/cdfile is '777' before mounting the image and after mounting it changes to '555'. Changing the permissions to '777' after mounting does not work..Hence, refuses to make changes to the .ISO file.

007
agent007
administrator
administrator
 
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Postby Void Main » Sun Jun 01, 2003 3:52 am

My complete apologies, I have been hallucinating. I do a lot of floppy and other disk images this way and was incorrectly remembering doing CD images this way but iso9660 is a little more difficult. You need to copy the CD to a non-iso9660 format to make the changes then use mkisofs to recreate your ISO image. Here is an example of adding something to the Red Hat CDs:

http://ccrma-www.stanford.edu/planetccr ... droms.html

Again, sorry for the misinformation, now I feel like a real dweeb. :)
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby agent007 » Sun Jun 01, 2003 3:58 am

VoidMain!!

C'mone....No need to apologise!! If u feel like a dweeb, imagine what a newbie like me feels. Thanks for the link...i'm looking into it. :D

007 8)
agent007
administrator
administrator
 
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Postby Void Main » Sun Jun 01, 2003 4:06 am

Yes, but I really try not to talk out of my arse most of the time, this one slipped...
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby agent007 » Sun Jun 01, 2003 10:22 am

The author says to use the following procedure, to copy the stuff to the HDD

copy the cdrom to the hard disk, we can copy everything with a back-to-back tar invocation (this assumes the cdrom is mounted in /mnt/cdrom):

(cd /mnt/; tar cvf - cdrom)|(cd /whatever/image; tar xvpf -)
When this is done you will have a copy of the cdrom in /whatever/image/cdrom.


Instead of this lengthy procedure, I did a simple

cp -Rv <source> <destination>


and got the same results!!

007
agent007
administrator
administrator
 
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Postby Void Main » Sun Jun 01, 2003 6:08 pm

Yeah, actually a "cp -a" is the best way although it really doesn't matter for ISO images.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA


Return to Applications

Who is online

Users browsing this forum: No registered users and 0 guests

cron