Solved

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

Posted on 2011-03-03
8
501 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:pvinodp
8 Comments
 

Author Comment

by:pvinodp
Comment Utility
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
0
 
LVL 3

Expert Comment

by:mwiercin
Comment Utility
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

0
 
LVL 16

Accepted Solution

by:
medvedd earned 350 total points
Comment Utility
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.
0
 
LVL 31

Expert Comment

by:farzanj
Comment Utility
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.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 31

Expert Comment

by:farzanj
Comment Utility
Please checkout my question a few months ago
http://www.experts-exchange.com/OS/Linux/Q_26685553.html
0
 
LVL 12

Assisted Solution

by:mccracky
mccracky earned 150 total points
Comment Utility
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.
0
 
LVL 34

Expert Comment

by:Duncan Roe
Comment Utility
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

0
 

Author Closing Comment

by:pvinodp
Comment Utility
Thanks for the solution
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now