how to edit a file in a mounted file system in LINUX

I have a iso image in /exports/ under linux.
I mounted it to /exports/softImage/ using mount  -o loop  <iso file>   <target directory>.
Now in a subfolder under that target-directory i want to edit a file. When i try to save the file after editing it i get the error E212: Cant open file for writing
when i press df -ah to see how th efile system is configured:
/exports/myiso file        148M 148M    0 100%    /exports/softImage
Who is Participating?
medveddConnect With a Mentor Commented:
The iso9660 filesystem is read-only. You will need to copy the files to another directory tree, make your changes and then burn a new image.
pvinodpAuthor Commented:
If I try to change the permission of the file system [/exports/softimage] or the particular file i get this error Read only file system
Remount the filesystem as read-write (it will affect your ISO though).

mount -o remount,rw /exports/softImage

Open in new window

Then back read-only

mount -o remount,ro /exports/softImage

Open in new window

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

I tried the same thing a few months back.

You have to copy all the contents, edit the file you want and recreate the ISO again.

I didn't like this solution, but apparently this is the only way it can be done-- as I found after a lot of research.
Please checkout my question a few months ago
mccrackyConnect With a Mentor Commented:
You are wanting to edit an image of a CD.  If you edit it, the image will change.  So, you need to copy the contents, edit the file, and then use mkisofs to create the new ISO image.
Duncan RoeSoftware DeveloperCommented:
You need to make a copy of the entire iso file system. Then make your changes. Then create a new iso image using mkisofs.
The following commands will make a copy of softimage in your home directory (you may want to put it elsewhere - adjust the below commands to suit)
mkdir ~/softimage_copy
cd /exports/softimage
tar -cf - . | tar -C ~/softimage_copy -xpUf -

Open in new window

pvinodpAuthor Commented:
Thanks for the solution
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.