• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root How Do I Mount EXT On Bootup.

im trying 2 mount my sd ext2 format but run into problems...

if i type in adb
mount -t ext2 /dev/block/mmcblk0p1 /system/sd
I get a device busy or in use..

but if i type
mount -t vfat /dev/block/mmcblk0p1 /system/sd
it mounts it no probs. & in titanium backup i get the a2sd.. meaning its mounted.
but once rebooted it will unmount the ext2.

im trying 2 get it 2 load on boot up,

by using a

install-recovery.sh file with this content & Chmod to 555:
#!/system/bin/sh
/system/etc/init-sd2.sh&
& Using The init-sd2.sh with this content & Chmod to 555:

#!/system/bin/sh MYLOG=/data/install-recovery.log echo "$(date) Starting install-recovery.sh" > $MYLOG echo "$(date) Waiting SD to become ready..." >> $MYLOG sleep 10 mount -t vfat /dev/block/mmcblk0p1 /system/sd 1>>$MYLOG 2>>$MYLOG mount -o bind /system/sd/app /data/app 1>>$MYLOG 2>>$MYLOG mount >> $MYLOG echo "$(date) Finishing install-recovery.sh" >> $MYLOG
Folders on phone are in place, but it wont mount it on bootup.. but it does mount it manually thru adb. but again once rebooted.. it unmounts.. so script isnt working...

anyway 2 mount this Code On Bootup:

mount -t vfat /dev/block/mmcblk0p1 /system/sd
on bootup??? any ideas???
 
im trying 2 mount my sd ext2 format but run into problems...

If i type in adb
i get a device busy or in use..

But if i type
it mounts it no probs. & in titanium backup i get the a2sd.. Meaning its mounted.
But once rebooted it will unmount the ext2.

Im trying 2 get it 2 load on boot up,

by using a

install-recovery.sh file with this content & chmod to 555:
& using the init-sd2.sh with this content & chmod to 555:

Folders on phone are in place, but it wont mount it on bootup.. But it does mount it manually thru adb. But again once rebooted.. It unmounts.. So script isnt working...

Anyway 2 mount this code on bootup:

On bootup??? Any ideas???

disregard!
update: Figured it out... Wasnt pushing files as root.
 
Upvote 0
disregard!
update: Figured it out... Wasnt pushing files as root.

Hi murderousone

I have read your a2sd threads

In some of your threads you mention ext3, ext3 is not supported in any of the kernels, ext2 is supported in all of them, and ext2/4 is supported in mine.

Why are you not trying to get this working on my ext4 rom?
Why are you not using ext4 on the sd-ext?
Why are you using the install-recovery.sh file?
Did you try using any init.d scripts for this?
 
Upvote 0
Hi murderousone

I have read your a2sd threads

In some of your threads you mention ext3, ext3 is not supported in any of the kernels, ext2 is supported in all of them, and ext2/4 is supported in mine.

Why are you not trying to get this working on my ext4 rom?
Why are you not using ext4 on the sd-ext?
Why are you using the install-recovery.sh file?
Did you try using any init.d scripts for this?

thanks for the reply hoark .. your actually the person i wanted 2 look into this...

but lemme explain a lil what im using & did, so u can have a better understanding...

i did mentioned ext3 was not supported & tested, due to me testing the script i made for it mounting the ext3.. it may be supported, but just haven't got it mounting on bootup... & i didn't really know what was supported on your rom or kernel, so was winging it thru trial & error......

im using your odin ee14 rooted with your kernel & CWM... then i used the ext4 cache CWM file u have... so i am using the ext4 on SD-ext...

then i flash Shabbymod09 Loaded i altered. the added files to the rom are kernel modules, that push into system/lib/modules folder & init.rc to system, init-sd2.sh & install-recovery.sh go to system/etc

ok i used the the install-recovery.sh to run my script from the system/etc folder. so the init-sd2.sh is to mount the ext2 partition on bootup after 10 secs... couldnt figure how 2 mount external without making the script.

it works mounting on boot up now with the script, but only using ext2 format... tried with ext3 & change the init.rc to ext3 & init-sd2.sh files 2 mount ext3 but it dont mount on bootup..

so that mounting ext2 problem is basically solved, except for other ext3/4.. maybe i missed something in the files.

ok now im trying 2 implement this code into the sd script made.
mount -o bind /data/app /system/sd/app 1>>
to basically bind the data/app folder to the system/sd/app folder..

so what this will do if done correctly & the way i want it 2 work, is 2 binds the app folder to sd card folder thats mounted.. meaning if u download something it will use the space for the sd instead of the internal..

with the bind i get over 800mb on the data/app folder which means it is binded & is using the mounted ext2 for data/app.
but i think i have 2 chown or chmod somthing for it to work...

cuz im def getting a permission problem there or i that i think is a permission problem.. not really sure...

but with code in place, & when downloading any app or app update they dont install @ all..

if u remove code from the init-sd2.sh & push it back it will install & downloaded files normally with the ext2 mounted fine on bootup.. but then internal space on the data/app folder goes back 2 normal....

so that binding code is def messing with the downloads & installs.

The init.d Folder i also have files in place. u can check em out.

if u download the mod u can check the files & the code in those 3 files &.bat so u can c how
there are being pushed....

Below I Have The Rom & The Files I Used Separated From The Rom & Is What I Added..
If Anyone Wants 2 Check Em Out.

M1 Mod

EXT Modules I Added (Separated From Rom)

My Init Scripts (Separated From Rom)

Init.d Folder (Separated From Rom)

maybe u can figure out what im doing wrong to bind the sd... my goal main goal is 2 get the darktremors script working, but if it can be done manual by coding our own scripts by binding adding chown & chmod Folders Correctly Den Whats Da Point Of Needing The DarkTremors Script.

U can basically bind dalvik, data, etc to the mounted sd but the permissions is the problem...

but it does mount ext2 on bootup & now titanium backup Allows moving app data to sd the way i have the scripts in the Mod setup..
 
Upvote 0
I will try to help you the best I can, but I cant get deep into untill the weekend,

i did mentioned ext3 was not supported .
you should just totally forget ext3 it is crap and unreliable, lets stay with ext4

im using your odin ee14 rooted with your kernel & CWM... then i used the ext4 cache CWM file u have... so i am using the ext4 on SD-ext..

you should use my ext4 test rom, also the ext4_cache file I put out does not change anything on the sdcard, it only formats /dev/stl14 to ext4, that is the cache partition, if you want to format the sd-ext partition to ext4, format it in CWM mounts and storage (as long as you are using my kernel) it is probably better to created the partition in cwm too, instead of using some pc app

then i flash Shabbymod09 Loaded i altered. the added files to the rom are kernel modules, that push into system/lib/modules folder & init.rc to system, init-sd2.sh & install-recovery.sh go to system/etc

my ext4 rom has shabby 09 loaded
you are not doing the kernel modules and init.rc correctly, those files are part of the kernel ramdisk, when the kernel loads, it uncompresses the ramdisk to memeory and mounts it to /

you can not just copy kernel files and an init.rc using adb or adding them to ShabbyMod, you have to make a modified kernel ramdisk folder and repack it to a boot.img file, tar it up and then flash it with odin, i will help you with that if you want, but you should have a linux system computer for that, or cygwin may work, but I really dont think we need to do that

my kernel already has the correct ext4.ko and jdb2.ko files that are meant to work with our kernel so you dont need them, we dont want the ext3 stuff

the stuff you are trying to do in the init.rc init-sd2.sh & install-recovery.sh folder, we may be able to do in an init.d file

in your init.d folder there is a file called dtapp

i am pretty sure that any script you want to run from the init.d folder has to start with a capital S and 2 digit number like this

S45dtapp
S99complete


I am not too sure about the bind stuff, i will look into when I get a chance
 
Upvote 0
I will try to help you the best I can, but I cant get deep into untill the weekend,


you should just totally forget ext3 it is crap and unreliable, lets stay with ext4



you should use my ext4 test rom, also the ext4_cache file I put out does not change anything on the sdcard, it only formats /dev/stl14 to ext4, that is the cache partition, if you want to format the sd-ext partition to ext4, format it in CWM mounts and storage (as long as you are using my kernel) it is probably better to created the partition in cwm too, instead of using some pc app



my ext4 rom has shabby 09 loaded
you are not doing the kernel modules and init.rc correctly, those files are part of the kernel ramdisk, when the kernel loads, it uncompresses the ramdisk to memeory and mounts it to /system

you can not just copy kernel files and an init.rc using adb or adding them to ShabbyMod, you have to make a modified kernel ramdisk folder and repack it to a boot.img file, tar it up and then flash it with odin, i will help you with that if you want, but you should have a linux system computer for that, or cygwin may work, but I really dont think we need to do that

my kernel already has the correct ext4.ko and jb2.ko files that are meant to work with our kernel so you dont need them, we dont want the ext3 stuff

the stuff you are trying to do in the init.rc init-sd2.sh & install-recovery.sh folder, we may be able to do in an init.d file

in your init.d folder there is a file called dtapp

i am pretty sure that any script you want to run from the init.d folder has to start with a capital S and 2 digit number like this

S45dtapp
S99complete


I am not too sure about the bind stuff, i will look into when I get a chance

i would def appreciate the help with learning how to modify the kernel ramdisk & repackn it.. just for the init.rc edits if needed.

& I will try your Ext4 Rom Now.. Maybe it will work better that way...

i have linux ubuntu on dual boot. so thats not a problem with the repacking, if u explain what i have 2 do.. u can take your time & just hit me up when u have the time... ima patient person...

ill def get 2 work on it once u do....
...

kernel scripts not worried about since it worked without it, using yours & was just gonna add em for ext3 support but u stated ext3 sucks...

the 2 init.d scripts u mentioned, i didnt know they need the S & 2 digits.... will change that up

i do get ext2 to mount by just pushing the init-sd2.sh & install-recovery.sh in system/etc folder & it mounts the ext2 sd partition to the system/sd folder.

only thing is it mounts, but uses the actual rom space instead of the actual space on sd cards ext2 partition on sd... could b im using the wrong dev/block on the code on sd.sh when mounting it or the init.rc file needs 2 b switched up 2 read it...

but once u get me repacking, ill def figure it out.....

thanks again for the help & info..


also do u know what command can be used thru adb or busybox to get a list of the dev blocks on the phone. like the mmcblk0p1-2-3 etc...... i did it before, but forgot the commands.

i know using
cat /proc/mounts can read the mounts how do i get dev blocks.
dev/stl14 /system rfs
dev/stl13 /data rfs
dev/stl14 /cache ext4
 
Upvote 0
the hidden partition is mmcblk0p2 when partitioned and formatted through cwm.
i'm having the same problem. i can mount the partition at boot but a2sd won't use it.

yea its crazy.. i was trying 2 figure out if it was actually using that block & it is.. i know if u use these commande thru adb
adb shell
mount -o rw,remount rootfs /
then
mount -vfat /dev/block/mmcblk0p1 /system/sd
it mounts the system/sd to that block & i get 1.6GB on a2sd space on titanium but thats the fat32.

if i try with

adb shell
mount -vfat /dev/block/mmcblk0p2 /system/sd
Mount: invalid argument

but the way i got that hidden one 2 mount is by typing this command in adb...

adb shell
mount -t ext2 /dev/block/mmcblk0p2 /system/sd
so now it reads the ext2 i have formatted & file size on titanium.. 882mb

also if u mount it to whatever folder it basically turns that folder into the ext2. so the data/app folder, it will make the data/app folder have that space on ext2..

was about 104mb before the mount & then jumped to 882mb
adb shell
mount -t ext2 /dev/block/mmcblk0p2 /data/app
the code before this one above to is how i basically want it 2 mount on bootup, cuz if u have it on data & u install a app, it wont work.

im jus waitin for the info on how 2 repack & maybe get this working..
 
Upvote 0
thanks big time for that... i got it mounting now with a one init.d script & without using both the sh files.

but i def need 2 wait for u 2 show me how to repack the boot image. so i can make edits to the init.rc before i move further.......

I dont think you will need to repack a kernel, but i will show you how to do it
i can tell you for sure that you will not have enough room to add the ext3 module, i tried it and made the ramdisk too big, and it would not boot

keep in mind that if you make modifications to the ram disk files and repack, you are essentially making a kernel

http://androidforums.com/galaxy-prevail-all-things-root/410648-prevail-kernel-ramdisk-packer.html




I would try to accomplish everything with init.d if I were you, but it will be good for you and other people to know how to repack a ramdisk
 
  • Like
Reactions: murderousone
Upvote 0
this works fine
Code:
mount -t auto /dev/block/mmcblk0p2 /system/sd
i'd been using
Code:
mount -t ext4 -o rw /dev/block/mmcblk0p2 /system/sd
either way after running the CWM script TitaniumBackup sees it as a2sd storage

2h8cp7a.png


but a2sdgui says otherwise

262pmrp.png
nywphe.png


and everything still installs to internal.
 
Upvote 0
yea mines reads the same way as yours inigomontoyasr. gui & titanium. i just mount it differently. so where on the same page.. cant move dalvik cuz it dont show the ext2/3 etc.

do u know how 2 make that mount code u have thru adb, into a init.d script so it loads on bootup? im going to try 2 get the a2sd working using init.d scripts... i think thats what we need 2 make, for it 2 work... but not really familiar with the init.d scripts & how 2 code em correctly....

will have to do some researching on that...

hroark13
i will try messing with the kernel repacking later on tonight, just got off work... but i really dont think that its necessary like u said.... will try thru init.d,
but just want to take a look @ it just to get familiar with whats going on with it & how it was made...

also i was trying out your ext4 mod, but wanted to push my version to overwrite the shabby u got preloaded. it wouldnt let me flash it.
changed the .bat
adb.exe shell mount -o remount,rw -t auto /dev/stl12 /system
still wouldnt work.
kept staying stuck @ boost screen. also removed the files u mentioned wasnt getting pushed correctly from the .bat & folder, so only thing getting pushed was my init.d folder which only had the ram balancing script. still wouldnt work. went back 2 your ee14 rooted - flashed & it worked. tried a couple times...

thanks again for the files & files info..
 
Upvote 0
This Is The Init.d Script Code I Added & Tried Using To Mount It On Bootup...
But Only Problem Here Is That It Mounts It On Bootup, But Uses The Rom Space Instead Of SD.

Im Trying 2 Get It So It Looks Like How When I Mount The SD Ext2 Thru ADB.

Names The File:
S01mountsd
Contents:
#!/system/bin/sh
#
# mount ext partition from sd card

BB="logwrapper busybox";

if [ "$SD_EXT_DIRECTORY" = "" ];
then
SD_EXT_DIRECTORY=/sd-ext;
fi;

# find SD Card
for MMC_NUM in `seq 0 9`;
do
MMC_TYPE=`cat /sys/block/mmcblk$MMC_NUM/device/type`
if [ "$MMC_TYPE" = "SD" ];
then
# 2nd partition of sdcard should be the sd-ext if exist
SD_EXT_PART=/dev/block/mmcblk${MMC_NUM}p2
break
fi
done

if [ -b "$SD_EXT_PART" ];
then
log -p i -t mountsd "Checking filesystems..";

# fsck the sdcard filesystem first
if [ -x `which e2fsck` ];
then
e2fsck -y $SD_EXT_PART
e2fsk_exitcode=$?
else
echo "executable e2fsck not found, assuming no filesystem errors"
e2fsk_exitcode=0
fi

# set property with exit code in case an error occurs
setprop e2fsck.errors $e2fsk_exitcode;
if [ "$e2fsk_exitcode" -lt 2 ];
then
# mount and set perms
$BB mount -o noatime,nodiratime,barrier=1 -t ext2 $SD_EXT_PART $SD_EXT_DIRECTORY;
if [ "$?" = 0 ];
then
$BB chown 1000:1000 $SD_EXT_DIRECTORY;
$BB chmod 771 $SD_EXT_DIRECTORY;
log -p i -t mountsd "$SD_EXT_DIRECTORY successfully mounted";
else
log -p e -t mountsd "Unable to mount filesystem for $SD_EXT_DIRECTORY!";
fi
else
log -p e -t mountsd "Unable to repair filesystem, disabling apps2sd";
fi
fi
code may be incorrect.
 
Upvote 0
Used notepad++ to put mount code in a file called S00mount, stuck it in the init.d folder, rebooted. Really wish I had known about the leading S two days ago, makes things much smoother. I had been using install-recovery.sh to invoke other scripts. That felt messy.
yea i was using the install-recovery.sh also at 1st.. until hoark mentioned the S & 2 digits... had things all over the place.. lol... my other scripts i had, i now have 2 check em out adding that 2 it... if they work fine ill post em.. only one i saw working fine was the ram script i posted but i took that off another samsung phone i had so the S & 2 digits were there already.

but i will try your method now to mount it.... thanks....
 
Upvote 0
Code:
#!/system/bin/sh
#mount sd for a2sd

sleep 10

mount -t ext4 /dev/block/mmcblk0p2 /system/sd

mount -t ext4 /dev/block/vold/179:2 /system/sd

maybe make sure you don't reuse numbers. you probably have S00banner S01firstboot, etc... i believe they determine execute order. Also, i had to edit the dtinstall script to include those missing S leaders. the original script just makes two digits. i'm trying to do this with as little modifying and as much automation as possible in each step to make it easily repeatable for everybody and so i don't get lost in code. this is all new to me. i'm downloading ubuntu now to try that kernel packer, though. learning linux seems quick.
 
Upvote 0
Code:
#!/system/bin/sh
#mount sd for a2sd
 
sleep 10
 
mount -t ext4 /dev/block/mmcblk0p2 /system/sd
 
mount -t ext4 /dev/block/vold/179:2 /system/sd

maybe make sure you don't reuse numbers. you probably have S00banner S01firstboot, etc... i believe they determine execute order. Also, i had to edit the dtinstall script to include those missing S leaders. the original script just makes two digits. i'm trying to do this with as little modifying and as much automation as possible in each step to make it easily repeatable for everybody and so i don't get lost in code. this is all new to me. i'm downloading ubuntu now to try that kernel packer, though. learning linux seems quick.

My Kernel and Shabby's kernel do init.d differently I am not sure if you need the S and number with his
 
Upvote 0
Code:
#!/system/bin/sh
#mount sd for a2sd

sleep 10

mount -t ext4 /dev/block/mmcblk0p2 /system/sd

mount -t ext4 /dev/block/vold/179:2 /system/sd
maybe make sure you don't reuse numbers. you probably have S00banner S01firstboot, etc... i believe they determine execute order. Also, i had to edit the dtinstall script to include those missing S leaders. the original script just makes two digits. i'm trying to do this with as little modifying and as much automation as possible in each step to make it easily repeatable for everybody and so i don't get lost in code. this is all new to me. i'm downloading ubuntu now to try that kernel packer, though. learning linux seems quick.

thanks for that.. i was actually adding to the mount code & is why it wasnt working...

also i think thats my prob.. getting lost in the code trying 2 many things.. i have the same. banner, 1stboot etc.... ill had a look @ the kernel & may work on modifying it & repakin it maybe 2morrow..

working on tweaking the kernel & overclocking if possible thru init.d scripts since i seen the kernel..
 
Upvote 0
Upvote 0
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones