EXT2 not mounted... - G1 Android Development

I have it but apparently it doesnt mount, how do I mount it?

ebadevil said:
I have it but apparently it doesnt mount, how do I mount it?
Click to expand...
Click to collapse
I see that you used the sdsplit script. If you are on JF1.5 it should get mounted on boot. If you are on a lower JF 143,142... you need the config changes that the sdsplit script installs. You can simply run sdsplit -c to install them now (as root).

MartinFick said:
I see that you used the sdsplit script. If you are on JF1.5 it should get mounted on boot. If you are on a lower JF 143,142... you need the config changes that the sdsplit script installs. You can simply run sdsplit -c to install them now (as root).
Click to expand...
Click to collapse
I figured out the problem... LucidRom decided to erase my ext2 partition... I managed to get it reformatted again with your script, ty for help btw, I figured out how to use your thingy finally, it works like magic... now I just gotta get LucidRom to cooperate

Related

Unable to mount loopback

I created a zeroed file with dd and attempted to mount it with:
mount -o loop /sdcard/test.img /data/test
and
losetup /dev/block/loop0 /sdcard/test.img
However, no loopback devices are displayed when I invoke mount. Can anyone clue me in? Feel like i'm missing something basic. By the way, I am running these commands from Saurik's busybox with the losetup /dev/block/loop fix.
p.s. I'd ask on the G1 hackers mailing list, but it's gone a bit bonkers in the past few days.
I'm not sure, but doesn't the image file you're trying to mount have to contain an actual file system?
Yea, I subsequently created a filesystem for it with mke2fs (which is mysteriously missing from busybox for android?). Still no go. Same when I tried to mount other partition-in-a-files like the module.cramfs or recovery.img
If I try to losetup the loop device then mount that, it returns error:
mount: mounting /dev/block/loop0 on /data/test failed: No such device
If I try to mount directly with -o loop, it returns:
mount: cannot setup loop device: No such file or directory
And yet Saurik seems to have been able to loop mount fine. Perhaps it is because I am testing on the qemu instead of hardware?
That might be it. You might try busybox's mount also.
But yeah, It definitely does work on the phone at least.
I've been trying to figure out how to load debian on the emulator, but I can't get the ext2 image mounted. I had to recompile the kernel first so support loadable modules, but even after that, it would not work (can't remember the specific error). Has anyone gotten an ext2 file system mounted on the emulator successfully?
The reason I'm doing this is so I can do native compiles, without actually having to do it on the phone. It has advantages in that I can crank up the clock speed and the RAM.
So I was able to mount loopback just fine on the actual hardware, but i'm having trouble getting it to run from the init.rc file. This is what i'm typing at the shell (it works):
(after insmod ext2.ko)
mount -o loop,noatime,nodiratime,nosuid,nodev -t ext2 /sdcard/loopy/app.img /data/app
It works fine and i'm able to install and run apks from the sdcard (/dev/block/loop2 on /data/app type ext2). Of course this is no good unless it can be mounted before the launcher starts (or it won't see any of our apks). The syntax for init mounting is different from sh, so I tried this (this is in /data/init.rc btw):
on userdata
#mount loopback file from sdcard
insmod /system/modules/2.6.25-01843-gfea26b0/kernel/fs/ext2/ext2.ko
mount ext2 /sdcard/loopy/app.img /data/app noatime nodiratime nosuid nodev loop
I know the script is being run since the ext2.ko module is getting installed. But the mount command isn't being executed. Can anyone shine a light on this? I'm not very familiar with the init daemon.
jashsu said:
So I was able to mount loopback just fine on the actual hardware, but i'm having trouble getting it to run from the init.rc file. This is what i'm typing at the shell (it works):
(after insmod ext2.ko)
mount -o loop,noatime,nodiratime,nosuid,nodev -t ext2 /sdcard/loopy/app.img /data/app
It works fine and i'm able to install and run apks from the sdcard (/dev/block/loop2 on /data/app type ext2). Of course this is no good unless it can be mounted before the launcher starts (or it won't see any of our apks). The syntax for init mounting is different from sh, so I tried this (this is in /data/init.rc btw):
on userdata
#mount loopback file from sdcard
insmod /system/modules/2.6.25-01843-gfea26b0/kernel/fs/ext2/ext2.ko
mount ext2 /sdcard/loopy/app.img /data/app noatime nodiratime nosuid nodev loop
I know the script is being run since the ext2.ko module is getting installed. But the mount command isn't being executed. Can anyone shine a light on this? I'm not very familiar with the init daemon.
Click to expand...
Click to collapse
Try
mount ext2 [email protected]/sdcard/loop/app.img /data/app noatime nodiratime nosuid nodev
JesusFreke said:
Try
mount ext2 [email protected]/sdcard/loop/app.img /data/app noatime nodiratime nosuid nodev
Click to expand...
Click to collapse
Tried that one earlier too. No love.
jashsu said:
Tried that one earlier too. No love.
Click to expand...
Click to collapse
I betcha the sdcard hasn't been mounted yet.
Is there anything in dmesg that looks relevant? Or maybe logcat?
Try temporarily moving the image file to /data, and see if you can get it to mount. That should verify that it has something to do with it being on the sdcard
JesusFreke said:
I betcha the sdcard hasn't been mounted yet.
Is there anything in dmesg that looks relevant? Or maybe logcat?
Click to expand...
Click to collapse
Agh! You're right. The mount daemon runs at line 192, in the services section. Long after the /data/init.rc is parsed.
service mountd /system/bin/mountd
socket mountd stream 0660 root mount
Any way around this short of manually mounting the sdcard in the /data/init.rc?
Edit: dmesg bingo:
<3>[ 1.920368] init: unable to mount [email protected]/sdcard/loopy/app.img to /data/app
as ext2
<6>[ 1.921498] yaffs: dev is 32505860 name is "mtdblock4"
<6>[ 1.922016] yaffs: passed flags ""
<4>[ 1.922322] yaffs: Attempting MTD mount on 31.4, "mtdblock4"
<4>[ 1.927204] yaffs: restored from checkpoint
<4>[ 1.927845] yaffs_read_super: isCheckpointed 1
<3>[ 1.960002] init: unable to mount /system/xbin.cramfs to /system/xbin as c
ramfs
<3>[ 1.965221] init: service 'console' requires console
<4>[ 2.161895] mmc_sd_init_card: Delay 250 ms
<4>[ 2.522535] mmc1: host does not support reading read-only switch. assuming
write-enable.
<6>[ 2.523359] mmc1: new SDHC card at address cd4e
On a side note, it looks like the mount action for xbin.cramfs in the main init.rc is failing because it's redundant with an earlier mount in /system/init.rc. I'm guessing this is a vestige of development on cramfs loopback mounting (mentioned here by Saurik).
6) at Jesus Freke's suggestion, setup /system/xbin (and later /system/modules) to mount from a compressed image
Click to expand...
Click to collapse
Yeah, I had left in an extra mount for xbin.cramfs in the base init.rc. I believe that's fixed in v1.3. I'll check again and make sure
So I gather the reason for wanting to mount a loopback device is to be able to create an ext2 fs as a file on the sdcard fat fs instead of creating 2 separate parittions on the sdcard , one for fat and one for ext2?
If this can be done, this would be a much better solution for getting apps to run on the sdcard than the previous hack which requires creating an ext2 partition on the sdcard.
Yeah that was what I was looking into. However as noted above, the I couldn't mount the image on the sdcard because the point at which /data/init.rc gets parsed occurs before the sdcard service starts up. The partition method doesn't have this problem because it creates a node for paritition #2 in the init.rc
jashsu said:
Yeah that was what I was looking into. However as noted above, the I couldn't mount the image on the sdcard because the point at which /data/init.rc gets parsed occurs before the sdcard service starts up. The partition method doesn't have this problem because it creates a node for paritition #2 in the init.rc
Click to expand...
Click to collapse
so u can't mount the sdcard in /data/init.rc?
dwang said:
so u can't mount the sdcard in /data/init.rc?
Click to expand...
Click to collapse
Not sure, I didn't try mounting partition #1. You could give it a shot by using mknod in /data/init.rc like the parted sdcard method. The sdcard service might not like that the card has already been mounted though.
There are two major reasons I abandoned this concept. The first is I didn't want to figure out how to get permission to mount /sdcard (since / is ro). The second is that making the sdcard available as a usb mass storage device makes it exclusively unaccessible from Android. I suppose that might not be so bad if you are only offloading /data/app, as long as you don't try to execute any new apps while your mass storage connection is going. It's non-ideal.
jashsu said:
Not sure, I didn't try mounting partition #1. You could give it a shot by using mknod in /data/init.rc like the parted sdcard method. The sdcard service might not like that the card has already been mounted though.
There are two major reasons I abandoned this concept. The first is I didn't want to figure out how to get permission to mount /sdcard (since / is ro). The second is that making the sdcard available as a usb mass storage device makes it exclusively unaccessible from Android. I suppose that might not be so bad if you are only offloading /data/app, as long as you don't try to execute any new apps while your mass storage connection is going. It's non-ideal.
Click to expand...
Click to collapse
I don't think the 2nd reason is that big of a deal. If google is planning on implementing the file based method for apps on the sdcard, they could just block access to apps when the sdcard is mounted to a pc. Its a lot better than the alternative of having to create a 2nd ext2 partition on the sdcard. Of course google should have really solved this issue before the g1 came out.
Anyways, I don't see /data/init.rc on my jf rc 1.2 g1. I only see /init.rc and /system/init.rc. Is /data/init.rc something that you created just for the purpose of mounting the file.
dwang said:
I don't think the 2nd reason is that big of a deal. If google is planning on implementing the file based method for apps on the sdcard, they could just block access to apps when the sdcard is mounted to a pc. Its a lot better than the alternative of having to create a 2nd ext2 partition on the sdcard. Of course google should have really solved this issue before the g1 came out.
Anyways, I don't see /data/init.rc on my jf rc 1.2 g1. I only see /init.rc and /system/init.rc. Is /data/init.rc something that you created just for the purpose of mounting the file.
Click to expand...
Click to collapse
Yeah it's referenced in /init.rc Easier to use since unlike /system/init.rc, it's not in a ro folder. You could use /system/init.rc too. Either way really.
jashsu said:
Yeah it's referenced in /init.rc Easier to use since unlike /system/init.rc, it's not in a ro folder. You could use /system/init.rc too. Either way really.
Click to expand...
Click to collapse
Ok.. I'll probably just stick with partitioning the sdcard into fat and ext2. Its working well for me and there really isn't a whole lot of advantages having the ext2 as a file on the fat partition.
I have 41 apps installed on the sdcard now (including some huge games like bonzai blast and brain genius deluxe) and I still have 59 megs of free internal storage. I think everybody that has a rooted g1 should put apps to the sdcard.

ROM Developers: Please switch to ext3 for a2sd!

99% of the problems users are having with Apps2SD are caused by the unclean shutdown of the ext2 filesystem, because Android does not unmount it when rebooting or shutting down the system, and there are no tools on the device to fsck the filesystem on boot. Ext3 is journaled and this isn't an issue because the journal will simply replay on boot.
I'd like to put an end to this.
Attached is e2fsprogs (tune2fs, e2fsck, resize2fs, and mke2fs) built for Android/ARM. You should also use the "-t auto" mount option so that it's still backwards compatible with ext2.
To convert your ext2 to ext3, you can simply run "tune2fs -j /dev/block/mmcblk0p2" after you have these tools on your device, and reboot (assuming your ramdisk allows for mounting as "auto"). You should unmount and e2fsck the partition first, if it's not been checked for errors.
Step by step by neoobs
can we have a noob-friendly guide to this preferably through terminal.
cyanogen said:
99% of the problems users are having with Apps2SD are caused by the unclean shutdown of the ext2 filesystem, because Android does not unmount it when rebooting or shutting down the system, and there are no tools on the device to fsck the filesystem on boot. Ext3 is journaled and this isn't an issue because the journal will simply replay on boot.
I'd like to put an end to this.
Attached is e2fsprogs (tune2fs, e2fsck, resize2fs, and mke2fs) built for Android/ARM. You should also use the "-t auto" mount option so that it's still backwards compatible with ext2.
To convert your ext2 to ext3, you can simply run "tune2fs -j /dev/block/mmcblk0p2" after you have these tools on your device, and reboot (assuming your ramdisk allows for mounting as "auto"). You should unmount and e2fsck the partition first, if it's not been checked for errors.
Click to expand...
Click to collapse
Will this work with ADP JF1.5?
Before I try it, let me get a few things straing. I have to put these files in the corresponding folders, reflash, then type type the commands from terminal on the phone? Or does this have to be done with adb?
Beast84 said:
Will this work with ADP JF1.5?
Before I try it, let me get a few things straing. I have to put these files in the corresponding folders, reflash, then type type the commands from terminal on the phone? Or does this have to be done with adb?
Click to expand...
Click to collapse
its already working for ADP. I have both my phones running on EXT3 and I havent found a problem. Its more reliable and I have gotten a Force Close or Wait screen with all the speed his build has.
cyanogen said:
To convert your ext2 to ext3, you can simply run "tune2fs -j /dev/block/mmcblk0p2" after you have these tools on your device, and reboot (assuming your ramdisk allows for mounting as "auto"). You should unmount and e2fsck the partition first, if it's not been checked for errors.
Click to expand...
Click to collapse
Huh?
Can you explain this in English please?
Henchman said:
Huh?
Can you explain this in English please?
Click to expand...
Click to collapse
I mainly intended this for other ROM makers, so they can incorporate these features into cooked ROMs.
So this basically means all of us with ext2 partitions will have to get a new card or is there anyways for us to convert to ext3?
djdeviance said:
So this basically means all of us with ext2 partitions will have to get a new card or is there anyways for us to convert to ext3?
Click to expand...
Click to collapse
please re-read the first post.
"To convert your ext2 to ext3, you can simply run "tune2fs -j /dev/block/mmcblk0p2" ....
pershoot said:
please re-read the first post.
"To convert your ext2 to ext3, you can simply run "tune2fs -j /dev/block/mmcblk0p2" ....
Click to expand...
Click to collapse
Yes I did read that and tried as well. Was unsuccessful that why I asked.
Premature SD failure from frequent journal commits?
I wondered why this solution wasn't inplemented from the beginning. However, In one of the threads on A2SD, I read that moving /DATA/DATA to SD would negatively affect the longevity of the SD cards because of the frequent write/re-write cycles of files in that directory, particularly sqlite database commits . One contributor suggested that a using a journalled filesystem in this context would have a similar effect in that there would be repeated writes to the specific area of the SD where the journal is stored.
Any thoughts on this?
Once we run the commands in terminal, will that wipe everything off the ext partition? Or will it just convert the ext2 to ext3 & leave all my apps intact?
sir*mez said:
its already working for ADP. I have both my phones running on EXT3 and I havent found a problem. Its more reliable and I have gotten a Force Close or Wait screen with all the speed his build has.
Click to expand...
Click to collapse
I am not on his build. I am on ADP JF1.5
Which is why I asked if it will work on JF's build & not his build. I know it works on his. He's the one who brought it up
arqueware said:
I wondered why this solution wasn't inplemented from the beginning. However, In one of the threads on A2SD, I read that moving /DATA/DATA to SD would negatively affect the longevity of the SD cards because of the frequent write/re-write cycles of files in that directory, particularly sqlite database commits . One contributor suggested that a using a journalled filesystem in this context would have a similar effect in that there would be repeated writes to the specific area of the SD where the journal is stored.
Any thoughts on this?
Click to expand...
Click to collapse
Most Class 6 cards support wear leveling these days.
Beast84 said:
I am not on his build. I am on ADP JF1.5
Which is why I asked if it will work on JF's build & not his build. I know it works on his. He's the one who brought it up
Click to expand...
Click to collapse
aaahhhh... ;p no i dont think jf has made his EXT3 compatable which is why cyangen is asking every dev to use EXT3.
Cyanogen
Can I put these files in my ADP JF1.5 update.zip & flash that? Or does something else need to be done to have it see the ext3 partition? Also your boot.img with the noatime change, can I put that in also? Or could you possibly take the boot.img from JF1.5 & change it for me?
ext3 is built in ;P
Code:
$ adb shell cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev debugfs
nodev sockfs
nodev pipefs
nodev anon_inodefs
nodev tmpfs
nodev inotifyfs
nodev devpts
ext3
ext2
nodev ramfs
vfat
yaffs
yaffs2
Your ramdisk needs to mount the partition with "-t auto" (or "-t ext3" if you don't want backwards compatibility) instead of "-t ext2" for it to be effective. My build is the only one that does this so far AFAIK. In the JF builds, you need to change the "runme.sh" script.
cyanogen said:
Your ramdisk needs to mount the partition with "-t auto" (or "-t ext3" if you don't want backwards compatibility) instead of "-t ext2" for it to be effective. My build is the only one that does this so AFAIK.
Click to expand...
Click to collapse
I'm guessing that wouldn't be an easy change to do? Well I guess I will have to try one of the new roms which supports this since JF doesn't update his releases like the other guys do
Beast84 said:
I'm guessing that wouldn't be an easy change to do? Well I guess I will have to try one of the new roms which supports this since JF doesn't update his releases like the other guys do
Click to expand...
Click to collapse
It requires a little bit of hacking.
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
cyanogen said:
It requires a little bit of hacking.
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
Click to expand...
Click to collapse
Wow all I see is matrix code! Thanks anyway I will read up, see what I can make of it. Thanks for pointing me in the right direction at least

[How to] mount SD card in recovery.

Please add this thread to the sticky!
If you messed up your ROM, and want to just reflash, but don't have your update on the SD card... or you mess up apps2sd and you need to clear them, this thread is for you. I've needed to do this MANY times, and it's a pain in the ass to remember how to do it every time.
Get into the recovery, and ./adb shell (if you can). Otherwise, hit alt + x to drop into the terminal. Then type this:
Code:
echo /dev/block/mmcblk0 > /sys/devices/platform/usb_mass_storage/lun0/file
Then, if you need to unmount:
Code:
echo "" > /sys/devices/platform/usb_mass_storage/lun0/file
This allows you to drag/drop files right from your PC to the sd card.
.... this is why i have card readers.
on another note, if you can get into adb cant you just
Code:
adb push /sdcard/
Simplest way - if you dont`t have update.zip on card simple click Alt-S. Recovery menu mount sdcard and show error (update.zip not found) but don`t unmount card
dbhatesyou said:
.... this is why i have card readers.
on another note, if you can get into adb cant you just
Code:
adb push /sdcard/
Click to expand...
Click to collapse
Because then you'd have to mount the sdcard to the device, it's easier to just do it this way. Although the post below yours does give a good example of how to easily mount it, I often keep updates on the card.
So by using this and mounting it to the PC, I can easily change files/names/etc.
thanks
dude i registered just to thank you for this piece of advice. thanks gary works perfectly
this works for me and is much simpler:
adb shell
mount /sdcard
exit
once you do that you can:
adb push updateofyourchoice.zip /sdcard/update.zip
edit: you can even shorten it to:
adb shell mount /sdcard
Gary13579 said:
Please add this thread to the sticky!
If you messed up your ROM,
Click to expand...
Click to collapse
Learn to speak with out school yard language.
just bookmared this page hahha
agreed, this bit ought to be in the index...added to the "how to" section
mhm
how to access my ext3 partition so i can format it ?? (i'm using vista x64, adb works fine)
alapapa said:
this works for me and is much simpler:
adb shell
mount /sdcard
exit
once you do that you can:
adb push updateofyourchoice.zip /sdcard/update.zip
edit: you can even shorten it to:
adb shell mount /sdcard
Click to expand...
Click to collapse
Yep, I have to agree, this is what I do too... much easier really
Gary13579 said:
Please add this thread to the sticky!
If you messed up your ROM, and want to just reflash, but don't have your update on the SD card... or you mess up apps2sd and you need to clear them, this thread is for you. I've needed to do this MANY times, and it's a pain in the ass to remember how to do it every time.
Get into the recovery, and ./adb shell (if you can). Otherwise, hit alt + x to drop into the terminal. Then type this:
Code:
echo /dev/block/mmcblk0 > /sys/devices/platform/usb_mass_storage/lun0/file
Click to expand...
Click to collapse
First of all, thanks for this thread!
When I get to this point, I get a Permission Denied message.
(The way I typed it was echo /dev/block/mmcblk0 press enter /sys/devices/platform/usb_mass_storage/lun0/file)
Long story short.
I have Hero ROM (2.4). I had the FAT32/Ext2 partition. I used Paragon Partition Manager to complete delete partition and created a new FAT32/Ext3.
After I did this, it said that my SD card was not "formatted". I hit FORMAT button, but it gave me a force close error. I had no other choice but to turn off G1, when I turn on again (since HERO depends on your SD Card FAT32/Ext2,3 to load correctly, not it won't get pass HERO screen, it loops forever).
I will buy a SD card reader today (The way I have been working is thru another Phone (T-Mobile Wing, I removed SD card from G1 and put it on the Wing, but now it won't even read that, so that's another issue), regardless of this outcome. But I wanted to share my story.
I want to format my SD card thru the recovery console, if it's possible.
By the way, I typed also:
adb shell
It says Not found
Thanks in advanced.
thanks
after typing this in i get
"mount: mounting /dev/block/mmcblk0p1 on /sdcard failed: No such file or directory" no matter if my sdcard is inserted or not.
Ya'know, if you have Cyanogen's recovery image (which is awesome, has JF recovery features and more) you can just use:
ums_enable
ums_disable
Click to expand...
Click to collapse
to mount and unmount, works great.
AdrianK said:
Ya'know, if you have Cyanogen's recovery image (which is awesome, has JF recovery features and more) you can just use:
ums_enable
ums_disable
Click to expand...
Click to collapse
to mount and unmount, works great.
Click to expand...
Click to collapse
Wow, thats easier to remember, thanks!!! Now if he could add this into his menu would be even better!
bassbox said:
mhm
how to access my ext3 partition so i can format it ?? (i'm using vista x64, adb works fine)
Click to expand...
Click to collapse
From Terminal:
# mount -o rw /dev/block/mmcblk0p2 /system/sd
# rm -rf /system/sd/*
# reboot recovery
ive gota say top advice from all of you!! it would have been a paper weight untill i got home but all working now..
YOU SIR
Are a lifesaver.
i thought i'd ruined my phone which means my om woulda killed me. but i didnt thanks to your halp!
bassbox said:
mhm
how to access my ext3 partition so i can format it ?? (i'm using vista x64, adb works fine)
Click to expand...
Click to collapse
not the best at unix and assuming 2nd partition is your ext2/3/4 ...
from console or better yet adb shell
mount /dev/block/mmcblk0p2 /system/sd
cd /system/sd
ls -l (to see the contents)
rm [filenames] (to delete the files)
rmdir (to delete empty directories)
.

[SCRIPT] Enabling Darktremor a2sd on Samsung s5830 Galaxy ACE

Hello,
In this guide I will show you how to enable Darktremor's a2sd (i.e. extending your internal memory using SD card, so you can install more applications easily).
This method has been tested on a rooted Galaxy ACE running Android 2.2.1. It might work on other devices, but I don't guarantee.
This guide assumes that your phone is rooted, and you have a basic knowledge in adb shell.
Please note that this script sleeps for 8 seconds at boot time to make sure that the SD card is loaded before mounting (thanks devetle and KoGi77GR).
REMEMBER: The steps below will not extend your phone's internal memory, you still have to install a2sd (link provided below) to complete the job.
1- Backup all data, both on your phone and your SD card.
Click to expand...
Click to collapse
2- Partition your SD card as following: 1st partition FAT32, 2nd partition ext2. I'm not sure about the optimal partition size of ext2, but you can start with 1-2 GB. Make sure that you use ext2 only, as ext3 and ext4 are not supported by the kernel (by default. See Bonus section below). Here's a good guide to help you out.
Click to expand...
Click to collapse
3- Insert your SD card and make sure that your phone recognizes it correctly.
Click to expand...
Click to collapse
4- Connect your phone in Mass Storage mode, then extract the attached script file to your SD card root directory.
Click to expand...
Click to collapse
5- Disconnect mass storage and login to ADB shell as root:
Code:
adb shell
su
Click to expand...
Click to collapse
6- Type in the following commands (try copy-paste each line then hit enter):
Code:
cp /sdcard/a2sd_enabler.sh /data/local/tmp/
chmod 755 /data/local/tmp/a2sd_enabler.sh
/data/local/tmp/a2sd_enabler.sh
If you got any error messages (starting with "ERROR") please post them here. Otherwise, continue to step 7.
Click to expand...
Click to collapse
7- To double check everything, reboot your phone and login again as root through adb, then run the following command, and find a line similar to the highlighted line in the output below:
Code:
su
df
Output
Code:
/dev: 142220K total, 12K used, 142208K available (block size 4096)
/mnt/asec: 142220K total, 0K used, 142220K available (block size 4096)
/cache: 25656K total, 12K used, 25644K available (block size 4096)
/data: 185240K total, 36768K used, 148472K available (block size 4096)
/system: 213376K total, 211520K used, 1856K available (block size 4096)
[B][COLOR="Red"]/system/sd: 1032088K total, 38512K used, 993576K available (block size 4096)[/COLOR][/B]
/mnt/sdcard: 6783016K total, 190356K used, 6592660K available (block size 4096)
/mnt/secure/asec: 6783016K total, 190356K used, 6592660K available (block size 4096)
Click to expand...
Click to collapse
8- Now you're good to go. Follow the directions as described in Darktremor's thread here:
http://forum.xda-developers.com/showthread.php?t=715116
Click to expand...
Click to collapse
Bonus for the experts
Now you can mount ext3 and ext4 partitions too using kernel mods. You can find them here: http://forum.xda-developers.com/showpost.php?p=12845360&postcount=17
I managed to setup a2sd on ext3 successfully, and planning to test ext4.
Thanks peeter123
Click to expand...
Click to collapse
Hi,
the link to script is broken. please upload it again! thanx!
harrythescorpion said:
Hi,
the link to script is broken. please upload it again! thanx!
Click to expand...
Click to collapse
You seem to have trouble downloading files from the forum. Here you go:
http://www.4shared.com/file/zn2vNQrH/a2sd_enablersh.html
Hi majedev,
thank you. I rooted the phone and followed the way in this thread.
I can mount ext2 (2nd partition of sdcard), but my S5830 seems not running install-recovery.sh at start up. I don't know why... Please helppppppppp
Here's what "cat /system/etc/install-recovery.sh" shows:
#!/system/bin/sh
/system/bin/mount -t ext2 /dev/block/mmcblk0p2 /system/sd
/system/bin/sh /system/etc/init.d/dtapp
/system/bin/sh /system/etc/init.d/99complete
I'm wondering is that any issue that can prevent the install-recovery.sh from running at start up...
devetle said:
Hi majedev,
thank you. I rooted the phone and followed the way in this thread.
I can mount ext2 (2nd partition of sdcard), but my S5830 seems not running install-recovery.sh at start up. I don't know why... Please helppppppppp
Here's what "cat /system/etc/install-recovery.sh" shows:
#!/system/bin/sh
/system/bin/mount -t ext2 /dev/block/mmcblk0p2 /system/sd
/system/bin/sh /system/etc/init.d/dtapp
/system/bin/sh /system/etc/init.d/99complete
I'm wondering is that any issue that can prevent the install-recovery.sh from running at start up...
Click to expand...
Click to collapse
It might be permissions issue? Try "chmod 755 /system/etc/install-recovery.sh"
If that didn't help, please run this command as root to copy "init.rc" to your sd card, then post the file here:
Code:
cp /init.rc /sdcard/
majedev said:
It might be permissions issue? Try "chmod 755 /system/etc/install-recovery.sh"
If that didn't help, please run this command as root to copy "init.rc" to your sd card, then post the file here:
Code:
cp /init.rc /sdcard/
Click to expand...
Click to collapse
thanks~
I checked the permission, it is 755 rwxr-xr-x.
the init.rc is attached herewith.
devetle said:
thanks~
I checked the permission, it is 755 rwxr-xr-x.
the init.rc is attached herewith.
Click to expand...
Click to collapse
Hmm, your init.rc seems fine, it executes install-recovery.sh at boot:
Code:
service flash_recovery /system/etc/install-recovery.sh
oneshot
Could you please type "mount" after mounting your ext2 partition and post the output?
By the way I noticed some differences on your init.rc wlan configuration, what's your firmware?
mount says: /dev/block/mmcblk0p2 /system/sd ext2 rw,relatime,errors=continue 0 0
I saw another thread. It adds "sleep 10" before mounting ext2 so that the sdcard is "ready". And someone said that is not necessary.
I'm really confused.
BTW, my firmware is:
Android version
2.2.1
Baseband version
S5830ZCKC1
Kernel version
2.6.32.9-perf
[email protected] #1
Wed Mar 16 19:45:24 KST 2011
Build number
FROYO.ZCKC1
devetle said:
mount says: /dev/block/mmcblk0p2 /system/sd ext2 rw,relatime,errors=continue 0 0
I saw another thread. It adds "sleep 10" before mounting ext2 so that the sdcard is "ready". And someone said that is not necessary.
I'm really confused.
BTW, my firmware is:
Android version
2.2.1
Baseband version
S5830ZCKC1
Kernel version
2.6.32.9-perf
[email protected] #1
Wed Mar 16 19:45:24 KST 2011
Build number
FROYO.ZCKC1
Click to expand...
Click to collapse
Okay, let's check if install-recovery is actually run at boot. Execute the attached script which will add some checks on boot time, and reboot your phone. Then check if the following files exist and post their contents:
/data/local/tmp/test1
/data/local/tmp/test2
Sent from my HTC HD2 using XDA App. Yvyg hggvhbhggbgggggvb vgghbhvggvbvv556r5rrdvvby6t
aaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
devetle said:
From the test script, the install-recovery.sh is running!
However, in the install-recovery.sh, the mount says: mount: No such file or directory.
It really looks like I need to add a sleep 10 here...I'll try.
Click to expand...
Click to collapse
Oh, it seems that I have the same thing "mount: No such file or directory" but it works just fine.
I'll consider adding sleep to my script. Thank you for your feedback
Thank you for your help!
Hi majedev,
i have tried running your script and it just runs fine. but still i am not able to see system/sd after rebooting the phone. i have installed darktremors a2sd(by booting into recovey and running update.zip) and the installation went just fine. but still my phone internal memory is showing the same. so what should i try now? i have tried installing recovery.sh that u posted. still doesnt works. i have tried rooting and unrooting the phone and then again tried all the steps but no go.
so please guide me what should i do next? may be flash the firmware? factory reset?
harrythescorpion said:
Hi majedev,
i have tried running your script and it just runs fine. but still i am not able to see system/sd after rebooting the phone. i have installed darktremors a2sd(by booting into recovey and running update.zip) and the installation went just fine. but still my phone internal memory is showing the same. so what should i try now? i have tried installing recovery.sh that u posted. still doesnt works. i have tried rooting and unrooting the phone and then again tried all the steps but no go.
so please guide me what should i do next? may be flash the firmware? factory reset?
Click to expand...
Click to collapse
If you were following the discussion then you most probably have the same problem as devetle did. I've updated the script so it sleeps for 5 seconds after mounting. You may want to redo the guide once again and download the updated script file.
I hope that helps.
I've made the kernel modules for ext3 and ext4. Kernel: 2.6.32.9-perf.
install-recovery.sh:
Code:
#!/system/bin/sh
insmod /system/lib/modules/jbd.ko
insmod /system/lib/modules/jbd2.ko
insmod /system/lib/modules/ext3.ko
insmod /system/lib/modules/ext4.ko
mount -t ext2 /dev/block/mmcblk0p2 /system/sd
/system/bin/sh /system/etc/init.d/dtapp
/system/bin/sh /system/etc/init.d/99complete
Haven't tested it yet, but the modules insmod just fine. And a2sd says ext3 and ext4 are supported.
Maybe someone with knowledge and guts can test it by converting the partition to ext4, so install-recovery.sh becomes:
Code:
#!/system/bin/sh
insmod /system/lib/modules/jbd.ko
insmod /system/lib/modules/jbd2.ko
insmod /system/lib/modules/ext3.ko
insmod /system/lib/modules/ext4.ko
mount -t ext4 /dev/block/mmcblk0p2 /system/sd
/system/bin/sh /system/etc/init.d/dtapp
/system/bin/sh /system/etc/init.d/99complete
Pls don't test it if you have the dalvik cache on your sd. You can end up with an bootloop if it doesn't work.
Hi majedev,
now that worked! now if i run the df command i can see the system/sd that shows me a capacity of approx 964.1123mega bytes, which is the ext2 partition that i created. now the issue is that i cannot see my phone's internal memory increased.
its still the same.
when i run the diskcheck command in a2sd (a2sd discheck) , it says me that:: displaying disc space statistics on sd card :
-h: no such file or directory
/dev/block/mmcblk0p2: 144220k total, 12k used.
and in another of your posts, u have said that if the phone ,memory doesn't increases, try command: a2sd install, which i have also tried and gives me the following output: mv: cant rename ' data/app-private/*' no such file or directory and then it says, time, date, test, expr echo: applet not found etc..
i tried to move the delvik cache to sd card by using the command : a2sd cachesd, and it was successful, the free space increased by like 10mb's. then i ran a2sd check and it also verified the same that the cache is running from sd card. i also trying moving it back to phone, it also worked fine as well.
so where is the glitch? the card is mounted. i am able to see system/sd, i am able to move cache to sd, but still internal memory is showing as 91 mb free??
and moreover my apps and market etc have disappeared? (i have backed then up using titanium bacup, i think ill be able to recover them from there) so what should i do next?
PS: BTW i am using latest beta 4 version 2.7.5.3 of a2sd
harrythescorpion said:
Hi majedev,
now that worked! now if i run the df command i can see the system/sd that shows me a capacity of approx 964.1123mega bytes, which is the ext2 partition that i created. now the issue is that i cannot see my phone's internal memory increased.
its still the same.
when i run the diskcheck command in a2sd (a2sd discheck) , it says me that:: displaying disc space statistics on sd card :
-h: no such file or directory
/dev/block/mmcblk0p2: 144220k total, 12k used.
and in another of your posts, u have said that if the phone ,memory doesn't increases, try command: a2sd install, which i have also tried and gives me the following output: mv: cant rename ' data/app-private/*' no such file or directory and then it says, time, date, test, expr echo: applet not found etc..
i tried to move the delvik cache to sd card by using the command : a2sd cachesd, and it was successful, the free space increased by like 10mb's. then i ran a2sd check and it also verified the same that the cache is running from sd card. i also trying moving it back to phone, it also worked fine as well.
so where is the glitch? the card is mounted. i am able to see system/sd, i am able to move cache to sd, but still internal memory is showing as 91 mb free??
and moreover my apps and market etc have disappeared? (i have backed then up using titanium bacup, i think ill be able to recover them from there) so what should i do next?
PS: BTW i am using latest beta 4 version 2.7.5.3 of a2sd
Click to expand...
Click to collapse
Do you have BusyBox installed?
peeter123 said:
I've made the kernel modules for ext3 and ext4. Kernel: 2.6.32.9-perf.
install-recovery.sh:
Code:
#!/system/bin/sh
insmod /system/lib/modules/jbd.ko
insmod /system/lib/modules/jbd2.ko
insmod /system/lib/modules/ext3.ko
insmod /system/lib/modules/ext4.ko
mount -t ext2 /dev/block/mmcblk0p2 /system/sd
/system/bin/sh /system/etc/init.d/dtapp
/system/bin/sh /system/etc/init.d/99complete
Haven't tested it yet, but the modules insmod just fine. And a2sd says ext3 and ext4 are supported.
Maybe someone with knowledge and guts can test it by converting the partition to ext4, so install-recovery.sh becomes:
Code:
#!/system/bin/sh
insmod /system/lib/modules/jbd.ko
insmod /system/lib/modules/jbd2.ko
insmod /system/lib/modules/ext3.ko
insmod /system/lib/modules/ext4.ko
mount -t ext4 /dev/block/mmcblk0p2 /system/sd
/system/bin/sh /system/etc/init.d/dtapp
/system/bin/sh /system/etc/init.d/99complete
Pls don't test it if you have the dalvik cache on your sd. You can end up with an bootloop.
Click to expand...
Click to collapse
Dude these are hot stuff, I'll give it a shot after finishing my homeworks :'(
But don't you think ext3/4 journaling is too much I/O for sd cards?

[Q] Move /data to SD card

I have a Galaxy GIO, which is a fairly old low-end phone. On factory reset, I have about 100MB memory free for apps, and the phone seems to start complaining as soon as I hit the 50MB mark; that's about one or 2 installed applications.
Because I would like to actually be able to, well, use my phone for anything else than calling, I want to move the /data partition to my SD card. I know this'll be slow, but slow still is better than not working at all.
I have done a bit of research, and came around plenty of scripts which claim to mount the second partition of the sd card as /data; none of these scripts work. I have tried 'INT2EXT', 'D2EXT', and I've heard about something called 'A2SD' but I have yet to find a copy of it . To install these scripts I've extracted them, and copied the scripts to '/system/etc/init.d/', after mounting '/system', using ADB.
I for an instant thought maybe my second partition isn't formatted properly, but using adb I am able to successfully mount the ext2 partition as /sd-ext, so I don't see why mounting them as /data should be a problem.
I have also tried to symbollicly link /data to /sd-ext/data and automatically mount my /sd-ext on boot. Obviously this didn't work, because the symbolic link isn't actually saved to disk.
How would I go about moving my data partition to my sd card? I am not affraid of doing some dirty work manually. I am running Cyanogenmod 11.
Binero said:
I have a Galaxy GIO, which is a fairly old low-end phone. On factory reset, I have about 100MB memory free for apps, and the phone seems to start complaining as soon as I hit the 50MB mark; that's about one or 2 installed applications.
Because I would like to actually be able to, well, use my phone for anything else than calling, I want to move the /data partition to my SD card. I know this'll be slow, but slow still is better than not working at all.
I have done a bit of research, and came around plenty of scripts which claim to mount the second partition of the sd card as /data; none of these scripts work. I have tried 'INT2EXT', 'D2EXT', and I've heard about something called 'A2SD' but I have yet to find a copy of it . To install these scripts I've extracted them, and copied the scripts to '/system/etc/init.d/', after mounting '/system', using ADB.
I for an instant thought maybe my second partition isn't formatted properly, but using adb I am able to successfully mount the ext2 partition as /sd-ext, so I don't see why mounting them as /data should be a problem.
I have also tried to symbollicly link /data to /sd-ext/data and automatically mount my /sd-ext on boot. Obviously this didn't work, because the symbolic link isn't actually saved to disk.
How would I go about moving my data partition to my sd card? I am not affraid of doing some dirty work manually. I am running Cyanogenmod 11.
Click to expand...
Click to collapse
I will introduce how to COPY(NOT MOVING) /data partition to /sdcard.
1. You should ROOT First.
2. Use Rootexplorer to Copy /data to /sdcard (WARNING:If your sdcard emulated with /data, Data WON'T copy to SDCARD --You need external Sdcard!)
2-1. if you don't want to use RootExplorer, you can use Android Debugging Bridge(adb)
(Youshould download Android sdks from developer.android.com)
--Command : adb shell su -C cp /data /sdcard/data
3. That's all.
Jason Hyunwoo said:
I will introduce how to COPY(NOT MOVING) /data partition to /sdcard.
1. You should ROOT First.
2. Use Rootexplorer to Copy /data to /sdcard (WARNING:If your sdcard emulated with /data, Data WON'T copy to SDCARD --You need external Sdcard!)
2-1. if you don't want to use RootExplorer, you can use Android Debugging Bridge(adb)
(Youshould download Android sdks from developer.android.com)
--Command : adb shell su -C cp /data /sdcard/data
3. That's all.
Click to expand...
Click to collapse
Thanks, but that's not entirely what I meant. I can manage to move my data to the SD card no problem, but I want my phone to actually use my second partition on my sd card, as the /data partition.
Binero said:
Thanks, but that's not entirely what I meant. I can manage to move my data to the SD card no problem, but I want my phone to actually use my second partition on my sd card, as the /data partition.
Click to expand...
Click to collapse
Oops.. Sorry about that!
First, I am not sure that will work or not, maybe you should try to edit init.*.rc. Which is from boot.mg. I think, maybe mounting sdcard as data is impossible, but you may try editing init.rc(or init.*.rc, * is manufacture). You could unpack your boot img, and you could edit mounting point which is from init.rc!
I hope this thing will help you..
Jason Hyunwoo said:
Oops.. Sorry about that!
First, I am not sure that will work or not, maybe you should try to edit init.*.rc. Which is from boot.mg. I think, maybe mounting sdcard as data is impossible, but you may try editing init.rc(or init.*.rc, * is manufacture). You could unpack your boot img, and you could edit mounting point which is from init.rc!
I hope this thing will help you..
Click to expand...
Click to collapse
I have looked into init.rc, but that only seemed to create the /data mountpoint, but not actually mount to it. I've no idea how to edit the boot image, or what that even is. Is that the filesystem that is built into the kernel?
Binero said:
I have looked into init.rc, but that only seemed to create the /data mountpoint, but not actually mount to it. I've no idea how to edit the boot image, or what that even is. Is that the filesystem that is built into the kernel?
Click to expand...
Click to collapse
Umm.. You should download unpackbootimg or dsixda's Android Kitchen to edit boot.mg. You cannot edit init.rc on Root explore. Use unpack boot.img menu which is from Android Kitchen!
Jason Hyunwoo said:
Umm.. You should download unpackbootimg or dsixda's Android Kitchen to edit boot.mg. You cannot edit init.rc on Root explore. Use unpack boot.img menu which is from Android Kitchen!
Click to expand...
Click to collapse
I'll try that out. Still not sure where to look though. As I said, init.rc does not contain any commands mounting /data.
Binero said:
I'll try that out. Still not sure where to look though. As I said, init.rc does not contain any commands mounting /data.
Click to expand...
Click to collapse
or you could edit look at other *.rc files!
Isn't this what you're looking for?
http://forum.xda-developers.com/galaxy-s2/themes-apps/tool-directorybind-data-to-externalsd-t1410262
sndsnd said:
Isn't this what you're looking for?
http://forum.xda-developers.com/galaxy-s2/themes-apps/tool-directorybind-data-to-externalsd-t1410262
Click to expand...
Click to collapse
I want to mount my sd card to my /data. That simply creates a symbolic link.
Jason Hyunwoo said:
or you could edit look at other *.rc files!
Click to expand...
Click to collapse
There is only 2 rc files, and one of them is specific to my recovery image.

Categories

Resources