Edit a file on an ISO

Peter Garrett peter.garrett at optusnet.com.au
Mon Feb 25 10:57:18 UTC 2008


On Mon, 25 Feb 2008 10:18:20 +0000
Tony Arnold <tony.arnold at manchester.ac.uk> wrote:

> Leo,
> 
> Leo Cacciari wrote:
> > Il giorno lun, 25/02/2008 alle 00.58 +0000, Tony Arnold ha scritto:
> >> You can mount an iso file as a file system using the mount command, e.g.,
> >>
> >> 	sudo mount -o loop somefile.iso /mnt
> >>
> >> You will then find all the files in the iso image in /mnt where you can
> >> edit away and the iso file will be modified directly.
> >>
> > No, it is not so:
> > 
> > $ mount -o loop,rw /opt/iso/ubuntu-7.10-desktop-i386.iso /mnt
> > $ mount
> > .... [omitted]
> > 
> > /opt/iso/ubuntu-7.10-desktop-i386.iso on /mnt type iso9660
> > (rw,loop=/dev/loop0)
> > 
> > $ sudo touch /mnt/foobar
> > touch: cannot touch `/mnt/foobar': Read-only file system
> > 
> > Either I'm doing something wrong, or your idea does not work. I faced
> > the same problem a little while ago, and I was _sure_ it could be done
> > as you suggest, but no look. I resorted to isomaster and I was going to
> > suggest it, only NoOp did it before me:)
> 
> You are right, the file system cannot be written to! I should really
> test my ideas fully before posting! Apologies for misleading everyone.

~/peter/iso $ sudo mount -o loop feisty-mini.iso /mnt
 mkdir feisty-mini-dump
cp -a /mnt feisty-mini-dump/
sudo touch feisty-mini-dump/foobar
ls -l feisty-mini-dump/foobar 
-rw-r--r-- 1 root root 0 2008-02-25 21:47 feisty-mini-dump/foobar

But to make it back into an iso again you need to use mkisofs - and in
addition, you will see that an Ubuntu CD has only a few directories,
because it uses squashfs and Casper. To get at the squashfs part you need
squashfs tools too, (to unsquash and re-squash), and you need to create a
chroot to work in. 

It's a bit more than just editing a file, sadly :)

See for example:
https://help.ubuntu.com/community/LiveCDCustomization

Peter


-- 
"INX Is Not X" Live CD based on Ubuntu 7.04 : http://inx.maincontent.net
Screenshots slideshow: http://inx.maincontent.net/album/1.png.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080225/4af174ac/attachment.sig>


More information about the ubuntu-users mailing list