Unix Technical Forum

iso loop mount

This is a discussion on iso loop mount within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Is there any way to loop mount an iso in rw mode? currently i have this: alex@athlon:~/iso$ cat mnt ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 07:19 PM
alex49201
 
Posts: n/a
Default iso loop mount

Is there any way to loop mount an iso in rw mode?

currently i have this:

alex@athlon:~/iso$ cat mnt
/bin/mount -t iso9660 -o loop $1 /home/alex/iso/loop

then just run
#sudo ./mnt image.iso

if i need to make changes inside the iso, i cp it to a tmp dir

#cp ./loop ./tmp

then make the changes in ./tmp then run mkisofs to make a new iso image
of ./tmp

But, to speed things up, is there any way to make changes 'inside' the
original iso image?



--
-alex49201
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-18-2008, 07:19 PM
Thomas Overgaard
 
Posts: n/a
Default Re: iso loop mount

alex49201 wrote:

> But, to speed things up, is there any way to make changes 'inside' the
> original iso image?
>

No. A ISO9660 iso-file is a fixed-size filesystem and theres no way you
can make any change inside.
--
Thomas O.

This area is designed to become quite warm during normal operation.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-18-2008, 07:19 PM
Lew Pitcher
 
Posts: n/a
Default Re: iso loop mount

alex49201 wrote:
> Is there any way to loop mount an iso in rw mode?
>
> currently i have this:
>
> alex@athlon:~/iso$ cat mnt
> /bin/mount -t iso9660 -o loop $1 /home/alex/iso/loop
>
> then just run
> #sudo ./mnt image.iso
>
> if i need to make changes inside the iso, i cp it to a tmp dir
>
> #cp ./loop ./tmp
>
> then make the changes in ./tmp then run mkisofs to make a new iso image
> of ./tmp
>
> But, to speed things up, is there any way to make changes 'inside' the
> original iso image?


I believe that, by definition, the ISO9660 file format doesn't support /any/
alteration. I cannot find any evidence of "write" or "delete" operations in
the iso9660 support code in the kernel; it looks like iso9660 is read-only
by design.

Having said that, I'd have to guess that there is no way to make changes
'inside' an iso image through a loopback mount.


--

Lew Pitcher, IT Consultant, Application Architecture
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-18-2008, 07:19 PM
/dev/rob0
 
Posts: n/a
Default Re: iso loop mount

In article <LMQnb.6435$P%1.5052940@newssvr28.news.prodigy.com >,
alex49201 wrote:
> Is there any way to loop mount an iso in rw mode?


Others have already answered about the lack of write support in iso9660.
You might consider using ext2, however. ISO-9660 is necessary for
interoperability with OS's which don't support Linux filesystems. Some
may be hard-coded to expect ISO-9660 filesystems on CD's, but that's not
the case with Linux. There's no reason why you can't have any supported
fs on a CD. (I would stay away from journalling filesystems, though.)
--
/dev/rob0 - preferred_email=i$((28*28+28))@softhome.net
or put "not-spam" or "/dev/rob0" in Subject header to reply
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-18-2008, 07:19 PM
alex49201
 
Posts: n/a
Default Re: iso loop mount

Thanks for the responses.. I didn't think it was possible, but i
couldn't give myself a definitive no, so i thought i'd ask.

thanks again.

--
-alex49201
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-18-2008, 07:19 PM
alex49201
 
Posts: n/a
Default Re: iso loop mount

/dev/rob0 wrote:

> In article <LMQnb.6435$P%1.5052940@newssvr28.news.prodigy.com >,
> alex49201 wrote:
>> Is there any way to loop mount an iso in rw mode?

>
> Others have already answered about the lack of write support in
> iso9660. You might consider using ext2, however. ISO-9660 is necessary
> for interoperability with OS's which don't support Linux filesystems.
> Some may be hard-coded to expect ISO-9660 filesystems on CD's, but
> that's not the case with Linux. There's no reason why you can't have
> any supported fs on a CD. (I would stay away from journalling
> filesystems, though.)


These cd's would only be used with linux, so that would be fine. How
would using an ext2 help though? How would i be able to create an iso
image using a fs other than iso9660?

My goal is to eventually write a script, that will take sevaral command
line aruguments, that will loop mount an iso image, and change a few
files in the iso. (changing about 200 bytes of the complete 650MB
iso), then umount the iso, with the changes saved inside waiting to be
burned.

Right now, my script will still work, but it would have to loop mount
the iso, cp it, then edit the files as neccessary, then mkisofs it. It
just seems like a lot of extra disk operations (cp and mkisofs 650MB)
when all that will change is a few hundred bytes.

--
-alex49201
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-18-2008, 07:19 PM
/dev/rob0
 
Posts: n/a
Default Re: iso loop mount

In article <t%Snb.6461$P%1.5079668@newssvr28.news.prodigy.com >,
alex49201 wrote:
> These cd's would only be used with linux, so that would be fine. How
> would using an ext2 help though?


You would be able to do exactly what you want: copy the image to hard
drive, loop-mount the image with read/write support, change a file,
umount it, burn it to CD again.

> How would i be able to create an iso
> image using a fs other than iso9660?


Uh, well, you're NOT. "ISO image" implies iso9660. But we've already
established that you don't need to use iso9660 for this CD. We're
dealing with an ext2 filesystem image rather than an iso9660 image. You
burn an ext2 image to CD rather than iso9660.

It can be done! It HAS been done. But on further thought I'm not sure
you will be able to mount the image directly from CD: there might be a
discrepancy in the IV value from the hard drive to the CD. IIUC the IV
calculation in the generic loop.c code is dependent on that of the
physical device on which the loop file resides.

BTW there are 2 simple patches used in cryptoapi and loop-aes (both
projects hosted at Sourceforge) which force the IV value to one sector,
512 bytes. With that patch[1] your plan should work.


[1] ftp://$KERNEL_ORG_MIRROR/pub/linux/people/hvr/testing - look for a
loop-jari patch.
--
/dev/rob0 - preferred_email=i$((28*28+28))@softhome.net
or put "not-spam" or "/dev/rob0" in Subject header to reply
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-18-2008, 07:19 PM
Lew Pitcher
 
Posts: n/a
Default Re: iso loop mount

/dev/rob0 wrote:

[snip]
> We're
> dealing with an ext2 filesystem image rather than an iso9660 image. You
> burn an ext2 image to CD rather than iso9660.
>
> It can be done! It HAS been done. But on further thought I'm not sure
> you will be able to mount the image directly from CD: there might be a
> discrepancy in the IV value from the hard drive to the CD.


FWIW, some time ago, I burned an ext2 fs to CDROM, and was able to mount and
read it properly.

[snip]

--

Lew Pitcher, IT Consultant, Application Architecture
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-18-2008, 07:20 PM
alex49201
 
Posts: n/a
Default Re: iso loop mount

> FWIW, some time ago, I burned an ext2 fs to CDROM, and was able to
> mount and read it properly.


Exactly what/how did you use to create an ext2 fs image?

--
-alex49201
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-18-2008, 07:20 PM
Lew Pitcher
 
Posts: n/a
Default Re: iso loop mount

alex49201 wrote:

>>FWIW, some time ago, I burned an ext2 fs to CDROM, and was able to
>>mount and read it properly.

>
>
> Exactly what/how did you use to create an ext2 fs image?


IIRC, I used mke2fs on a small partition, which I mounted and populated with
files. I unmounted the partition once I was done, and burnt it to cdrom
using cdrecord (cdrecord -data /dev/mypartition)

I guess I /could/ have
- dd from /dev/zero to create a file of appropriate size
- mke2fs on the file to format it as an ext2 filesystem
- mount the file through a loopback mount
- populate the filesystem
- umount the file
- burn to cdrom


--

Lew Pitcher, IT Consultant, Application Architecture
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:59 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com