Solved

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

Posted on 2011-03-03
8
511 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 

Author Comment

by:pvinodp
ID: 35026989
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
ID: 35027025
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
ID: 35027892
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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
LVL 31

Expert Comment

by:farzanj
ID: 35027916
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
 
LVL 31

Expert Comment

by:farzanj
ID: 35027951
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
ID: 35037300
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
ID: 35047662
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
ID: 35053580
Thanks for the solution
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

688 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