Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
Im trying to mount a img file on my Fedora linux distribution. Is there a command to find out what fs the img file is. Because im trying to mount the img file and the only fs what works is tmpfs, debugfs and proc. But the files in the mount directory are useless.
No luck.. its not mounting with iso9660,
i tried also with CD-Burner tools.. What possibilities exist to create a img File? My "pc" what i am working with have two img files , the first one (r1.img) i can mount with ext3, in this image i find startup files like grub, bzImage. The other image file r2.img I cannot mount. I tried to unzip the file too, but I get the message: r2.img not in gzip format.
Any Suggestions?
I don't know if this'll work, but when you mount it, if you do so with read-write permissions, perhaps you'll be able to modify it:
Code:
mount -o loop,rw -t squashfs r2.img testdir
I'm not at a linux machine, so I can't test that to see if it's right, but I think it is...
edit: your cp command is trying to copy xxx.sh to the current directory, which is presumably in the mounted image, in which case cp xxx.sh ~/test.sh will copy (and rename it to test.sh) into your home directory, if all you want to do is modify it. If not, the above should work. Again, I've not tried this, so I'm not sure.
No, with this option I still cannot create a file in the image. For example if I try to create a directory, I get the error message:
mkdir: cannot create directory 'test': Read-only file system
squashfs is not designed to be modified. If you want to add a file to a squashfs, I think you have to extract the existing files to a regular filesystem, add your new file, and use the mksquashfs tool to generate a new .img file containing the old files and your new file.
I think you'd only need to install it if you wanted to create a new squashfs file afterwards. If you just wanted to stick it on a CD, I presume you could extract the contents using the cp command and then remake an iso from the extracted files.
I'd try running
Code:
yum search squashfs
to see if you've got anthing in your repositories that'll install it for you. It's been a while since I used fedora and yum, so that command might not be correct.
I mounted now the r2.img in testdir, then copied the content with cp * -r in a new directory, changed the files and then created with
mksquashfs a new img file. Then I copied the img files to the Terminal, but after a while a get following error message:
SQUASHFS error: Unable to read page, block baa198b, size 97a7
Zlib_fs returned unexpected result 0xfffffffd
request module: runaway loop modeprobe binfmt_0000
What I did:
Code:
mount -o loop -t squashfs old.img tmpold
cd /tmpold
cp * -r ../test
cd ../test
mksquashfs etc home opt .. /home/new.img
mksquashfs version: 2.1R
Old files used version 2.0
Distribution: OpenSUSE 11.3 KDE, PCLinuxOS 2010 KDE
Posts: 29
Rep:
Can you clarify at what stage it goes wrong: The copying, the changing of the files or the creation of the new image?
aren't you supposed to put 'cp -r * <folder>' instead of 'cp * -r <folder>'? Also note that "if any directories are created by the cp command during the copying process, the newly created directory will have the same mode as the corresponding source directory." This means that if you use cp to make a new directory and the directory you copy from is read-only, the destination directory will also be read only, you have to do some chmod stuff to change that
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.