0

I want to modify some files in my system partition of the phone. It's EXT4. I plan to flash it later on my phone. I tried:

mount -w -t ext4 -o loop /storage/sdcard1/system.img /mnt/njz

and got this:

open backing file failed: Permission denied

Also, the phone is rooted, and the shell says it's rooted. I also tried using su command before that command. Also tried adding additional options after "loop", like

nosuid,nodev,default_permissions,user_id=0,group_id=0,gid=0,uid=0

Why no permissions? Also tried file_mode=0777,dir_mode=0777, and still same result.

I tried mounting this on Linux (Tiny Core Linux), and no problems. I used: sudo mount -t ext4 -o loop system.img /mnt/. In that case, my system.img was mounted from NTFS partition.

1 Answer 1

1

Apparently, my file was read-only, which I set up in Windows. That's a problem with "permission denied". For some reason, Android cannot change this, I had to use Windows or Symbian OS to unmark read-only property. Xplore doesn't show the permissions option for any files except if they are on some EXT partition. Root Explorer shows, and that's how I first noticed my problem, accidentally. I've seen all other files had different permissions in detailed view in Root Explorer. I tried changing permissions to 0777 using Root Explorer or Total Commander, and although they say it set it up, it didn't. This can't be done on the FAT32 partition. Of course, when I changed it using Windows, it showed the same permissions as other files. I remember I set this file to read-only a month ago to avoid accidental modification.

Later, I experienced an additional problem with mount, that is when I use -o loop only, it says 'device or resource busy'. But when I found where are my loop devices by searching for 'loop' using Xplore, I found there are files loop0 to loop7 in '/dev/block/'. So when I used -o loop=/dev/block/loop0, it again said the same problem message. But when I used -o loop=/dev/block/loop1 it finally mounted. I didn't have to use '-w' option to make it writable, just skipped any letter.

And forgot to say, we can mount it to any folder, but that folder has to exist. So, I made folder njz or nijaz or sistem in the root folder of my device using Xplore (set in settings superuser + mount writable, so it can make these things) and mounted it there. Note that that folder disappears after reset. Also, umount worked for unmounting: umount /njz/.

Also, that's what caused my original firmware to not work. It is always boot-looped just because the file is read-only. This is a huge problem in Linux. Need to contact Linux, Xplore, Total Commander, Root Explorer developers. SP Flash Tool was used to flash files, but the problem was in the file property.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .