modify vold.fstab in rfs file - Samsung Galaxy SL i9003

Hello, I have an i9003 which only has external memory (sd card), I removed the nand as it was faulty and caused the phone to loop restart and stuff.
I had to root it and modify the vold.fstab file to make use of the SD card as internal phone memory. My question is: is there a way to modify the content of the vold.fstab directly in the .rfs image before flashing? I read mounting on linux there are problems with permissions and this is a read only file.

chriz74 said:
Hello, I have an i9003 which only has external memory (sd card), I removed the nand as it was faulty and caused the phone to loop restart and stuff.
I had to root it and modify the vold.fstab file to make use of the SD card as internal phone memory. My question is: is there a way to modify the content of the vold.fstab directly in the .rfs image before flashing? I read mounting on linux there are problems with permissions and this is a read only file.
Click to expand...
Click to collapse
sudo mkdir /mnt/sys
sudo mount -o loop system.rfs /mnt/sys
sudo gedit /mnt/sys/etc/vold.fstab
sudo umount /mnt/sys

ganeshbiyer said:
sudo mkdir /mnt/sys
sudo mount -o loop system.rfs /mnt/sys
sudo gedit /mnt/sys/etc/vold.fstab
sudo umount /mnt/sys
Click to expand...
Click to collapse
Thanks, the problem is that I get an error writing to file. I believe vold.fstab is read only. Solution?
** (gedit:2599): WARNING **: Hit unhandled case 0 (Error writing to file: Input/output error) in parse_error.
I got this error logged in as root.

chriz74 said:
Thanks, the problem is that I get an error writing to file. I believe vold.fstab is read only. Solution?
** (gedit:2599): WARNING **: Hit unhandled case 0 (Error writing to file: Input/output error) in parse_error.
I got this error logged in as root.
Click to expand...
Click to collapse
Don't login as root.
use sudo command instead.

the result is the same with sudo. The system can't write file to rfs.

Related

using the internal memory as a virtual sdcard

I managed to break my micro sd card in half today and I wasn't able to pickup a class 10 or 6 replacement locally so I thought I could use some of the 6gb of internal memory as a virtual filesystem to get me out of trouble.
So, after quickly looking at the android docs and the supported busybox commands I created a 2gb sdcard.img in /data and mounted to /sdcard. I copied some files to it with astro filemanager and fired up raging thunder 2 and it went ahead and downloaded the game data to /sdcard/ and worked correctly.
But, a few apps won't recognise it as an sdcard (Motorola SD card and phone storage settings applet) as well as things like PlayPro (states I have no sdcard present). I thought perhaps I could modify the /etc/vold.fstab file to auto mount the sdcard.img I created using vi but I'm a bit clueless as to what I should change on the dev_mount /sdcard line to get it automounted at boot and hopefully fool the rest of the apps into thinking it is a physical sdcard.
Can anyone possibly point me in the right direction? Not sure how to invoke cmd mode in vi using the milestone qwerty either but I'll keep digging.
What I did (roughly), maybe I'm going about it wrong but any advice would be appreciated.
1. rooted device
2. installed the free terminal app from the market
3. fired up the terminal shell
4. su
5. dd if/dev/zero of=/data/sdcard.img bs=1024 count=1 seek=2000000
6. busybox mkfs.vfat /data/sdcard.img (didn't seem to support -F 32)
7. busybox mount -o loop /data/sdcard.img /sdcard/
+ 1 for this, it would be great to can use internal storage for user data
Why do you let this nice post die.. so "flibbulator" found anything more out?.. I'd like to know more.. like if you got it to work with Music Players and Video players??
Try to mount /data/sdcard.img to /mnt/sdcard (/sdcard is a link to /mnt/sdcard)
or try "export EXTERNAL_STORAGE /sdcard"
I made in a different way: created a 4GB storage.img in /data and mounted it in /sdcard/storage, so internal storage is finally usable for user data
the problem was to set mount point on boot, I can't find a way to execute a script on boot (you can't permanently modify init.rc)
flibbulator said:
What I did (roughly), maybe I'm going about it wrong but any advice would be appreciated.
1. rooted device
2. installed the free terminal app from the market
3. fired up the terminal shell
4. su
5. dd if/dev/zero of=/data/sdcard.img bs=1024 count=1 seek=2000000
6. busybox mkfs.vfat /data/sdcard.img (didn't seem to support -F 32)
7. busybox mount -o loop /data/sdcard.img /sdcard/
Click to expand...
Click to collapse
I have actually tried this on my Droid2Global, and I get the error "unknown operand if/dev/zero" I feel like I am missing the point or do not fully understanding how to use the "dd" command?
the correct syntax is:
dd if=/dev/zero of=/data/sdcard.img bs=1024 count=4194340
4194340 --> 4GB
patton82 said:
the correct syntax is:
dd if=/dev/zero of=/data/sdcard.img bs=1024 count=4194340
4194340 --> 4GB
Click to expand...
Click to collapse
Thank you bro.
Quick question I keep getting these errors. I do have a folder in "/" named "sdcard-int"
Better Terminal Emulator Pro
/ # busybox mount -o loop /data/sdcard.img /sdcard-int/
mount: can't setup loop device: No such file or directory
/ # busybox mount -o /data/sdcard.img /sdcard-int
mount: can't read /etc/fstab: No such file or directory
/ #
Sent from my DROID2 GLOBAL using Tapatalk
you can't place anything in root folder, /sdcard is a link to /mnt/sdcard and is created by init.rc (you can't edit init.rc, it's provided by boot.img, so need to extract from boot.img and repack)
I made in this way but I have to manually execute a script or a command from terminal after every boot to mount storage.img
mkdir /sdcard/storage
su
dd if=/dev/zero of=/data/storage.img bs=1024 count=4194340
busybox mkfs.vfat /data.storage.img
mount -o loop -t vfat /data/storage.img /sdcard/storage
Will be lost anything after reboot when use this storage?
Sent from my MotoA953 using XDA App
all the stuff in img file will not be lost, as long as you put it in /data/
on the contrary the mount point must be restored after reboot
patton82 said:
you can't place anything in root folder, /sdcard is a link to /mnt/sdcard and is created by init.rc (you can't edit init.rc, it's provided by boot.img, so need to extract from boot.img and repack)
I made in this way but I have to manually execute a script or a command from terminal after every boot to mount storage.img
mkdir /sdcard/storage
su
dd if=/dev/zero of=/data/storage.img bs=1024 count=4194340
busybox mkfs.vfat /data.storage.img
mount -o loop -t vfat /data/storage.img /sdcard/storage
Click to expand...
Click to collapse
Thank you, I will use the Thank you button when I login via PC.
I still get the same error, I know that I'm doing something incorrectly or maybe I don't understand "mount" comment correctly?
/ $ su
/ # mkdir /sdcard/storage
/ # dd if=/dev/zero of=/data/storage.img bs=1024 count=41943404194340+0 recordsn
4194340+0 records out
4295004160 bytes (4.0GB) copied, 339.823883 seconds, 12.1MB/s
/ # busybox mkfs.vfat /data/storage.img
/ # mount -o loop -t vfat /data/storage.img /sdcard/storage
mount: can't setup loop device: No such file or directory
/ #
I am using my sdcard also, I'm not too sure if that makes any difference?
Sent from my DROID2 GLOBAL using Tapatalk
Better terminal pro uses BASH shell, I presume
try to switch to android shell, in preferences
or to use terminal emulator (free) from market
Okay, I tried Android Terminal Emulator, and this is a new error.
export PATH=/data/local/bin:$PATH
$ $ su
# mount -o loop -t vfat /data/storage.img /sdcard/storage
ioctl LOOP_SET_FD failed: Device or resource busy
#
Not too sure where to go now. I thank you again for all your help, and time.
Sent from my DROID2 GLOBAL using Tapatalk
resource busy, you have to reboot the phone
I use Gscript lite, add a script with the string
mount -o loop -t vfat /data/storage.img /sdcard/storage
and create a shortcut to homescreen, so when I reboot, I can mount the img file in one click
Cool mod for my ROM. Could I take it??
sure, they are simple shell commands
the best would be to do what happen with Samsung Galaxy S: internal storage mounted as sdcard and physical sdcard mounted in a folder /sdcard/sd
storage.img is 3-4 times faster than my peak 8GB class 6
There is an application "Autostart" in the market, which can automatially execute a script with root after boot up.
I up because I'm now also interested in making profit of the huge internal storage. I'd like to put my wikipedia data from wikidroyd to the internal storage. Hopefully I'm skilled enough to follow the given steps...I doubt that though
fKngFtd said:
Okay, I tried Android Terminal Emulator, and this is a new error.
export PATH=/data/local/bin:$PATH
$ $ su
# mount -o loop -t vfat /data/storage.img /sdcard/storage
ioctl LOOP_SET_FD failed: Device or resource busy
#
Not too sure where to go now. I thank you again for all your help, and time.
Click to expand...
Click to collapse
Guys, I need your help! I have exactly. The same problem:
Every time I try to mount my storage.img I get
Ioctl LOOP_SET_FD failed: Device or resource busy.
I rebooted several times and also tried to mount smaller images (first I tried 3gb then I tried 1mb).
Any solution?
Edit: I solved it myself. I always forgot to punch in busybox before the command. Now it worked for me!!
I do have a question now. With help of Gscript I made a shortcut to mount the storage.img to my sdcard. But my pc wont recognise the sdcard as long as the image is mounted. What is the command to unmount the partition so I wouldnt have to reboot my phone before connecting it to the pc...?
Any help is much appreciated! Thx
(Something like busybox unmount -o loop -t vfat...?)
Sent from my MotoA953 using XDA App

how can i get full ubuntu??

there are some problem with my webtop when i want get full ubuntu....like this
tar: ./usr: Cannot change mode to rwxr-xr-x: Read-only file system
tar: .: Cannot utime: Read-only file system
tar: .: Cannot change ownership to uid 0, gid 0: Read-only file system
tar: .: Cannot change mode to rwxr-xr-x: Read-only file system
tar: Error exit delayed from previous errors
unmounting your sdcard from the temp mount, now that we are done copying all the
files.
Now we will mount the sdcard with webtop copied over to it, to the correct place
, so we can patch it, and remove the FACLs and MACLs. These are what prevent you
accessing application and making changes in the ubuntu install.
help me
You need to mount the system as read/write.
In adb type.
su
mount -o remount, rw
Sent from my Atrixperia using xda premium
z652366 said:
there are some problem with my webtop when i want get full ubuntu....like this
tar: ./usr: Cannot change mode to rwxr-xr-x: Read-only file system
tar: .: Cannot utime: Read-only file system
tar: .: Cannot change ownership to uid 0, gid 0: Read-only file system
tar: .: Cannot change mode to rwxr-xr-x: Read-only file system
tar: Error exit delayed from previous errors
unmounting your sdcard from the temp mount, now that we are done copying all the
files.
Now we will mount the sdcard with webtop copied over to it, to the correct place
, so we can patch it, and remove the FACLs and MACLs. These are what prevent you
accessing application and making changes in the ubuntu install.
help me
Click to expand...
Click to collapse
Hi,
I assume you are using my how-to?
I have a few questions, and need you to get me a few things as well, before I can be of more help.
1) I assume you are already rooted? Are you already rooted?
2) Do you have busybox installed? And have it in /system/bin, and not /system/xbin?
3) Did you run my script as root?
I am thinking that it is either just that you are not running this as root, or that your root install did not work.
Can you run the following commands from the command line on your computer, with your phone connected and post them back in here?
Code:
adb shell
su
cd /data/local
id
busybox df -h
ls -l
mount -o remount, rw /system
touch /system/bin/test
rm /system/bin/test
exit
exit
Post the output back in here, and we will see if there is an issue with your root access.
Each line is a single command, and you must ONLY copy one line and paste it to one command line, do NOT copy all of the commands and paste them to your command line window, it will not work.

User startup script location in system partition_how to enable init.d support?

I am working on a startup script to allow browser2RAM to work with other browsers that don't use the android.browser.com agent (Chrome, Firefox) and don't know where to put this 00script file I wrote in the system. This device has no etc/init.d directory. Where should this go to get executed on boot?
Sent from my ASUS Transformer Pad TF700T using xda app-developers app
Re: User startup script location in system partition?
elfaure said:
I am working on a startup script to allow browser2RAM to work with other browsers that don't use the android.browser.com agent (Chrome, Firefox) and don't know where to put this 00script file I wrote in the system. This device has no etc/init.d directory. Where should this go to get executed on boot?
Click to expand...
Click to collapse
If you have a custom ROM like CleanROM Inheritance, you should have a (/system)/etc/init.d - which ROM are you running?
Re: User startup script location in system partition?
_that said:
If you have a custom ROM like CleanROM Inheritance, you should have a (/system)/etc/init.d - which ROM are you running?
Click to expand...
Click to collapse
Hi-
Thanks for your reply. I am locked and rooted on stock ROM.
Sent from my ASUS Transformer Pad TF700T using xda app-developers app
elfaure said:
I am locked and rooted on stock ROM.
Click to expand...
Click to collapse
OK, that means no support for init.d by the kernel's init.rc. You can try the following:
Create a shell script named "/system/etc/install-recovery.sh" with the following content:
Code:
#!/system/bin/sh
/system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
Remember to make it executable and to create the /system/etc/init.d directory. Put your init script there and make it executable.
If you have busybox installed in /system/xbin and a little luck, this could enable support for running init.d scripts with the stock ROM. Tell us if it worked.
_that said:
OK, that means no support for init.d by the kernel's init.rc. You can try the following:
Create a shell script named "/system/etc/install-recovery.sh" with the following content:
Code:
#!/system/bin/sh
/system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
Remember to make it executable and to create the /system/etc/init.d directory. Put your init script there and make it executable.
If you have busybox installed in /system/xbin and a little luck, this could enable support for running init.d scripts with the stock ROM. Tell us if it worked.
Click to expand...
Click to collapse
I thank you for the method but I'm a newb (nOOb) and this looks a little scary. I found two market apps that can do it (execute a script as root on boot): Autostart-Root and ROM Toolbox (Lite or Pro). I'm using the latter's Scripter tool to execute this script on boot as root. Seems to be working. (Appended the .txt extension to the filename in order to upload the file)
Here's another thead i found here on the subject
http://forum.xda-developers.com/showthread.php?t=690564
_That
Using your method above, how would you run the script as root (su)? This script needs to run as root to properly mount the /data partition.
elfaure said:
Using your method above, how would you run the script as root (su)? This script needs to run as root to properly mount the /data partition.
Click to expand...
Click to collapse
It should run as root because it's started by init - /data is already mounted at that time. If I understand your intention correctly, you don't need to (re)mount /data anyway, just /data/data/<whatever_directory_your_browser_uses>.
_that said:
It should run as root because it's started by init - /data is already mounted at that time. If I understand your intention correctly, you don't need to (re)mount /data anyway, just /data/data/<whatever_directory_your_browser_uses>.
Click to expand...
Click to collapse
If I run my script as normal user (not as root ie su) then I get script /data mount errors.
exec /system/bin/sh '/Removable/MicroSD/Scripts/autostart.sh'
[email protected]:/ $ exec /system/bin/sh '/Removable/MicroSD/Scripts/autostart.sh'
failed: Invalid argument
rm failed for -rf, No such file or directory
mount: Operation not permitted
failed: Invalid argument
rm failed for -rf, No such file or directory
mount: Operation not permitted
failed: Invalid argument
rm failed for -rf, No such file or directory
mount: Operation not permitted
failed: Invalid argument
rm failed for -rf, No such file or directory
mount: Operation not permitted
But when I run it as root user
exec /system/bin/sh '/Removable/MicroSD/Scripts/autostart.sh'
failed: Invalid argument
rm failed for -rf, No such file or directory
failed: Invalid argument
rm failed for -rf, No such file or directory
failed: Invalid argument
rm failed for -rf, No such file or directory
failed: Invalid argument
rm failed for -rf, No such file or directory
The rm failed for -rt really isn't an error, just an indication there was no cache file to delete, correct?
elfaure said:
If I run my script as normal user (not as root ie su) then I get script /data mount errors.
Click to expand...
Click to collapse
I don't see where "/data" is mentioned in your error messages. You get "invalid argument" from umount because there is nothing mounted on that directory, and "operation not permitted" from mount because only root is allowed to mount filesystems.
elfaure said:
The rm failed for -rt really isn't an error, just an indication there was no cache file to delete, correct?
Click to expand...
Click to collapse
Correct.
_that said:
I don't see where "/data" is mentioned in your error messages. You get "invalid argument" from umount because there is nothing mounted on that directory, and "operation not permitted" from mount because only root is allowed to mount filesystems.
Correct.
Click to expand...
Click to collapse
Thanks very much for that explaination. Sorry, I'm just getting started with scripts. In fact, this is my first one. Another question:
I added: (got the idea from this post, pg 2 http://forum.xda-developers.com/showthread.php?t=690564)
>/data/opt/autostart.out 2>/data/opt/autostart.err​to the end of the script.
The original call is shown here:
"I simulate it by the following contents in /system/etc/init.d/20autostart :
/system/bin/sh /data/opt/autostart.sh >/data/opt/autostart.out 2>/data/opt/autostart.err
which not only calls /data/opt/autostart.sh at boot time, but
also dumps its stdout to /data/opt/autostart.out
and dumps its stderr to /data/opt/autostart.err
which is very helpful for debugging the commands in /data/opt/autostart.sh
Note that you need to enter recovery mode before you can write to /system/etc/init.d/" ​Now when it runs it dumps the two files, which are sucessfully created. But both files are blank, no data, and autostart.err does not have any error messages like I show above. What's wrong with this call statement? Can't it be executed from within this same script, or do I have to use another script to call this one to make that work?
_that said:
OK, that means no support for init.d by the kernel's init.rc. You can try the following:
Create a shell script named "/system/etc/install-recovery.sh" with the following content:
Code:
#!/system/bin/sh
/system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
Remember to make it executable and to create the /system/etc/init.d directory. Put your init script there and make it executable.
If you have busybox installed in /system/xbin and a little luck, this could enable support for running init.d scripts with the stock ROM. Tell us if it worked.
Click to expand...
Click to collapse
From that another post, he calls:
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot
which looks quite similar. Can you describe the differences between them? Is this one only for CWM?
Is this even possible on stock ROM?
_that said:
OK, that means no support for init.d by the kernel's init.rc. You can try the following:
Create a shell script named "/system/etc/install-recovery.sh" with the following content:
Code:
#!/system/bin/sh
/system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
Remember to make it executable and to create the /system/etc/init.d directory. Put your init script there and make it executable.
If you have busybox installed in /system/xbin and a little luck, this could enable support for running init.d scripts with the stock ROM. Tell us if it worked.
Click to expand...
Click to collapse
I got a bit educated then got brave and tried it and it doesn't seem to work. I added the file tracer output line, files> /data/opt, to my startup script, made yours executable via "chmod 776 install-recovery.sh", put it where you said, put mine where you said, made mine executable same way except had to mount system R/W to do it (should have done this before I put it there but I am learning), ran your script without error, then rebooted. I see no files in data/oct so my script did not run at boot? I even renamed my script 00autostart1.sh and still didn't work.
Also, both other methods failed to run my script at boot. Any other ideas on stock ROM or is this just not possible?
elfaure said:
>/data/opt/autostart.out 2>/data/opt/autostart.err​to the end of the script.
Click to expand...
Click to collapse
You need to add these redirections to each command whose output you want to redirect, not to the end of the script. So to capture the output of your script, write another script that calls your original one with these redirections, as suggested by that other person.
elfaure said:
From that another post, he calls:
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot
which looks quite similar. Can you describe the differences between them? Is this one only for CWM?
Click to expand...
Click to collapse
The above is the block that needs to be added to /init.rc, but this is part of the kernel's ramdisk which you can only modify on an unlocked device.
elfaure said:
I got a bit educated then got brave and tried it and it doesn't seem to work.
Click to expand...
Click to collapse
Post the output of:
su
ls -l /etc/install-recovery.sh
cat /etc/install-recovery.sh
ls -ld /etc/init.d
ls -l /etc/init.d
ls -l /system/xbin/busybox
_that said:
You need to add these redirections to each command whose output you want to redirect, not to the end of the script. So to capture the output of your script, write another script that calls your original one with these redirections, as suggested by that other person.
The above is the block that needs to be added to /init.rc, but this is part of the kernel's ramdisk which you can only modify on an unlocked device.
Post the output of:
su
ls -l /etc/install-recovery.sh
cat /etc/install-recovery.sh
ls -ld /etc/init.d
ls -l /etc/init.d
ls -l /system/xbin/busybox
Click to expand...
Click to collapse
I created a script called that_script.sh that contains your command set above. I make it executable and run it (as root) and:
****************************************
There is no output because the script never completes execution? Just runs forever (Script Manager) or times out (ROM Toolbox Lite Scripter). Some kind of script-loop is created?? Upon break (exit) I get the following output:
exec sh -c '/Removable/MicroSD/Scripts/that_script.sh '
exit
-rw-rw-r-- root sdcard_rw 90 2013-03-19 18:28 install-recovery.sh
#!/system/bin/sh
/system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.ddrwx------ root root 2013-03-19 18:45 init.d
-rwxrwxrw- root root 938 2013-03-19 18:35 00autostart1.sh
-rwsr-xr-x root root 497964 2013-03-03 17:59 busybox
elfaure said:
I created a script called that_script.sh that contains your command set above. I make it executable and run it (as root) and:
****************************************
There is no output because the script never completes execution? Just runs forever (Script Manager) or times out (ROM Toolbox Lite Scripter). Some kind of script-loop is created??
Click to expand...
Click to collapse
I don't know what strange tools you are using, the commands were meant to simply type into an interactive shell (adb or a local terminal app).
However, the original problem why your script doesn't run at boot is obvious from your output:
Code:
-rw-rw-r-- root sdcard_rw 90 2013-03-19 18:28 install-recovery.sh
You forgot to make install-recovery.sh executable (or you forgot to become root first).
I use these script tools so I can copy all the text into a file and run the file (script) rather than typing each line individually into the terminal. My tools show the script is executable (I ran "chmod 776 filename.ext" = "chmod +x filename.ext" on the script file) and ran it as root? I'll try it again and post back. I'll also try it from the terminal app.
Thks
_that said:
It should run as root because it's started by init - /data is already mounted at that time. If I understand your intention correctly, you don't need to (re)mount /data anyway, just /data/data/<whatever_directory_your_browser_uses>.
Click to expand...
Click to collapse
I'm not (re)mounting /data.
So the mount is still needed, that's the key to the whole process. *The mount isn't (re)mounting the data partition, it's creating a mount point inside the data partition for the RAM cache.
What the script is doing is creating a tmpfs filesystem where the browsers expect to put their cache files. This filesystem is actually fully in memory (RAM), and never backed by any permanent storage. The -t tmpfs option tells mount to create a tmpfs filesystem, and -o size=50m tells it to reserve 50 MB of memory. The unmount is for when I use a different browser (one that doesn't use the com.android.browser agent like chrome, firefox, naked, etc.) and need to create a new mount point but want to reuse the 50MB already allocated for the existing mount point. Hope this clarifies my intent with creating this script and how it is supposed to work.
elfaure said:
I'm not (re)mounting /data.
So the mount is still needed, that's the key to the whole process. *The mount isn't (re)mounting the data partition, it's creating a mount point inside the data partition for the RAM cache.
What the script is doing is creating a tmpfs filesystem where the browsers expect to put their cache files. This filesystem is actually fully in memory (RAM), and never backed by any permanent storage. The -t tmpfs option tells mount to create a tmpfs filesystem, and -o size=50m tells it to reserve 50 MB of memory. The unmount is for when I use a different browser (one that doesn't use the com.android.browser agent like chrome, firefox, naked, etc.) and need to create a new mount point but want to reuse the 50MB already allocated for the existing mount point. Hope this clarifies my intent with creating this script and how it is supposed to work.
Click to expand...
Click to collapse
Assumed that you script is working, you could use "script manager - SManager" from the market. This app will allow yours to run as root and during start up. All you need is root. The script can be at any location (even on sdcard if you like). I used to use this with my cell phone.
elfaure said:
I'm not (re)mounting /data.
Click to expand...
Click to collapse
Well, you originally wrote:
This script needs to run as root to properly mount the /data partition.
Click to expand...
Click to collapse
Does it work now as it should?
Be sure to read also this thread about mounting in Android 4.2:
http://forum.xda-developers.com/showthread.php?t=2227123

[Q][Help] unpacking ext.img lose data

hello i tryed yesterday to unpack system.ext4.img but the problem is the file was 467 miga and become 200 miga (i flashed it in my mobile but no hope ) "" so it lose data ""
what system i can install in my computer to open ext4.img to edit all data inside it ? read and write
i searched in the other topics but i didnt understand good so i make it dirct
to know why i want to edit ext4.img look to my other topic
http://forum.xda-developers.com/showthread.php?p=49175577#post49175577
al2rhabyy said:
hello i tryed yesterday to unpack system.ext4.img but the problem is the file was 467 miga and become 200 miga (i flashed it in my mobile but no hope ) "" so it lose data ""
what system i can install in my computer to open ext4.img to edit all data inside it ? read and write
i searched in the other topics but i didnt understand good so i make it dirct
to know why i want to edit ext4.img look to my other topic
http://forum.xda-developers.com/showthread.php?p=49175577#post49175577
Click to expand...
Click to collapse
This requires linux (Ubuntu) other wise you are out of luck.
And it requires linux knowledge.
You could rename it to system.img then loop mount it under linux.
Code:
sudo mkdir /mnt/sys
sudo mount -o loop system.img /mnt/sys
cd /mnt/sys
nautilus .
Run that in a linux shell.
Then unmount once you are done reading and writing the image.
Code:
sudo umount -R /mnt/sys
Then copy the system.img to a windows machine again and if you have a samsung phone you could flash the image with odin packed into a tar.
Or rename it back to system.ext4.img then flash it how you were going to.
can you make a video please ? :cyclops:
but with my system file

Question No Permissions for /system/ but I have root

I tried
mount -o rw,remount /system/
But
mount: '/system/' not in /proc/mounts
system-as-root = system is mounted as /, not /system
Permissions are fine.
DavidxxxD said:
system-as-root = system is mounted as /, not /system
Permissions are fine.
Click to expand...
Click to collapse
I can't write to / still
Are you root?
What is output of
Bash:
id
Bash:
su -c mount -o remount,rw /
Also try this to find out more
Bash:
mount | grep "/ "
DavidxxxD said:
Are you root?
What is output of
Bash:
id
Bash:
su -c mount -o remount,rw /
Also try this to find out more
Bash:
mount | grep "/ "
Click to expand...
Click to collapse
Bash:
berlna:/ $ id
uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),1078(ext_data_rw),1079(ext_obb_rw),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc),3011(uhid),3012 context=u:r:shell:s0
Bash:
berlna:/ $ su -c mount -o remount,rw /
'/dev/block/dm-8' is read-only
Bash:
berlna:/ $ mount | grep "/ "
/dev/block/dm-8 on / type ext4 (ro,seclabel,relatime,discard)
And yes I have root
I've never seen this output from trying to remount. Could be a permanent read-only attribute somewhere. /dev/block/dm-8 looks like your system is on an encrypted partition, this could have something to do with the error. You can try using the busybox version of mount command. Also, does your device have a super partition? That could explain it.
DavidxxxD said:
I've never seen this output from trying to remount. Could be a permanent read-only attribute somewhere. /dev/block/dm-8 looks like your system is on an encrypted partition, this could have something to do with the error. You can try using the busybox version of mount command. Also, does your device have a super partition? That could explain it.
Click to expand...
Click to collapse
This is the same error i also face in oneplus os12 and yes my dev dm-x also is ro even after root
Its super.img and also i try with busybox
But useless
The only way now i can see is unpack backup super
Unpack edit repack and flash back
But its not possible for me
Rewriting the super partition every time, seems to be the only way in your case.
The lpflash tools are used to work with super partitions.
I've attatched a statically linked 64-bit ARM version that can run on the device, built from this source.
Extract the system image using
Bash:
./lpunpack -p system super.img
Note: This can also be run directly on the block device, it only reads.
From there, you can modify the system and add it to a super image (the firmware usually has sparse ones that need to be decompressed first). You could also flash the new system image directly via fastbootd mode.
Note: Ignore any "invaild sparse header" messages from fastboot.
Don't flash unsparse images on Samsung devices! They will not like it!
Hope this is helpful.
DavidxxxD said:
Rewriting the super partition every time, seems to be the only way in your case.
The lpflash tools are used to work with super partitions.
I've attatched a statically linked 64-bit ARM version that can run on the device, built from this source.
Extract the system image using
Bash:
./lpunpack -p system super.img
Note: This can also be run directly on the block device, it only reads.
From there, you can modify the system and add it to a super image (the firmware usually has sparse ones that need to be decompressed first). You could also flash the new system image directly via fastbootd mode.
Note: Ignore any "invaild sparse header" messages from fastboot.
Don't flash unsparse images on Samsung devices! They will not like it!
Hope this is helpful.
Click to expand...
Click to collapse
Its a super.img thx

Categories

Resources