# mount_all



## giveen (Nov 9, 2011)

I've noticed a lot of ROM's on Jellybean are starting to use mount_all /fstab.device 
I want to impliment this in my rom but cannot find the source for mount_all

Any help?


----------



## imnuts (Jun 9, 2011)

From what I can find, it is a function of init, so if you are on a JB rom, you should be able to use mount_all. If you want to see what it does, I believe you can find it starting on line 447


----------



## giveen (Nov 9, 2011)

Hm, I tried that in my CM10 rom, and boot failed.
I put in my fstab the lines from my init.streak7.rc and called it up using "mount_all /fstab.streak7" but it failed to boot.

So its not necessarily a sub command of the mount binary, but of init itself?


----------



## imnuts (Jun 9, 2011)

Did you setup the format of the fstab.streak7 file properly? Also, did you make sure to include it in the ramdisk of the kernel/boot.img? I just did this for my tablet, which mounted everything in init.espresso.rc and it worked fine for me. Here is what was in the .rc file:

```
mount ext4 /dev/block/platform/omap/omap_hsmmc.1/by-name/FACTORYFS /system wait rw   <br />
    mount ext4 /dev/block/platform/omap/omap_hsmmc.1/by-name/FACTORYFS /system ro remount<br />
    mount ext4 /dev/block/platform/omap/omap_hsmmc.1/by-name/DATAFS /data wait noatime nosuid nodev crypt discard,noauto_da_alloc<br />
    mount ext4 /dev/block/platform/omap/omap_hsmmc.1/by-name/CACHE /cache wait noatime nosuid nodev nomblk_io_submit,errors=panic<br />
    mount ext4 /dev/block/platform/omap/omap_hsmmc.1/by-name/EFS /efs wait rw<br />
```
Which I replaced with

```
mount_all /fstab.espresso
```
And this is my fstab.espresso

```
# Android fstab file.<br />
#<src>                                                      <mnt_point>     <type>      <mnt_flags and options>                                 <fs_mgr_flags><br />
# The filesystem that contains the filesystem checker binary (typically /system) cannot<br />
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK<br />
<br />
/dev/block/platform/omap/omap_hsmmc.1/by-name/FACTORYFS     /system         ext4        ro                                                      wait<br />
/dev/block/platform/omap/omap_hsmmc.1/by-name/EFS           /efs            ext4        rw                                                      wait<br />
/dev/block/platform/omap/omap_hsmmc.1/by-name/CACHE         /cache          ext4        noatime,nosuid,nodev,nomblk_io_submit,errors=panic      wait,check<br />
/dev/block/platform/omap/omap_hsmmc.1/by-name/DATAFS        /data           ext4        nosuid,nodev,crypt,discard,noauto_da_alloc              wait,check<br />
```
Also, while I added "check" to /data and /cache, you don't have to do this, I did it for added data security.


----------



## imnuts (Jun 9, 2011)

And though I wouldn't normally double post, it looks like mount_all is mainly processed through system/core/fs_mgr/fs_mgr.c.


----------



## giveen (Nov 9, 2011)

Here is my current setup in init.streak7.rc


> on fs
> # Okpa, symbolic link named partitions
> exec /sbin/ln_named_part mmcblk3 /dev
> 
> ...


So would mount_all fail because of kernel? I am using a 2.6.36 kernel.

Ah I think I know what the problem is. I created a fstab.streak7 that looked like this.:

```
<br />
mount ext4 /dev/APP /system wait ro<br />
mount ext4 /dev/CAC /cache wait noatime nosuid nodev<br />
mount ext4 /dev/UDA /data wait noatime nosuid nodev<br />
```
When it should have looked like this......


```
<br />
/dev/APP /system ext4 wait,ro<br />
/dev/CAC /cache ext4 wait,noatime,nosuid,nodev<br />
/dev/UDA /data ext4 wait,noatime,nosuid,nodev<br />
```


----------



## imnuts (Jun 9, 2011)

I wouldn't think it would be kernel related, but it is possible that it is. Here is what I would try for the fstab and rc file.

*init.streak7.rc*

```
on fs<br />
# Okpa, symbolic link named partitions<br />
exec /sbin/ln_named_part mmcblk3 /dev<br />
<br />
# misc setting<br />
symlink /dev/block/mmcblk3p12 /dev/general_setting<br />
symlink /dev/block/mmcblk3p15 /dev/fa<br />
symlink /dev/block/mmcblk3p16 /dev/otp<br />
chown root system /dev/VAR<br />
chmod 0660 /dev/VAR<br />
chown root system /dev/WP1<br />
chmod 0660 /dev/WP1<br />
chown root system /dev/MSC<br />
chmod 0660 /dev/MSC<br />
<br />
setprop ro.crypto.tmpfs_options size=128m,mode=0771,uid=1000,gid=1000<br />
exec /system/bin/do_fsck<br />
mount_all /fstab.streak7
```
*fstab.streak7*

```
# Android fstab file.<br />
#<src>		<mnt_point>		<type>	<mnt_flags and options>		<fs_mgr_flags><br />
# The filesystem that contains the filesystem checker binary (typically /system) cannot<br />
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK<br />
/dev/APP	/system			ext4	ro							wait<br />
/dev/CAC	/cache			ext4	noatime,nosuid,nodev		wait<br />
/dev/UDA	/data			ext4	noatime,nosuid,nodev		wait
```


----------



## giveen (Nov 9, 2011)

Going to try that tomorrow morning.


----------



## imnuts (Jun 9, 2011)

Actually, I looked at what is above, and while it should work for mounting, it may not work completely. The Streak 7 looks to have a really odd layout of /dev as well as an odd way of doing stuff in general. The part that wouldn't work is the "exec /system/bin/do_fsck" part. Since /system isn't mounted yet, it won't be able to do that. However, if you add ",check" after the lines for /cache and /data, it should check them before mounting, hopefully accomplishing the same thing.


----------



## giveen (Nov 9, 2011)

Yeah, no worky. Lots of things like this


```
<br />
Could not stat dex cache directory '/cache/dalvik-cache': No such file or directory<br />
I/dalvikvm(  428): Unable to open or create cache for /system/framework/core.jar (/cache/dalvik-cache/[email protected]@[email protected])<br />
```
No worries, just back to the old way.


----------



## imnuts (Jun 9, 2011)

My guess is that it has something to do with the symlinks it's using for the partitions and that's keeping it from mounting properly. I found the actual devices that should be getting mounted on your Github. What about this:

*init.streak7.rc*

```
on fs<br />
# Okpa, symbolic link named partitions<br />
exec /sbin/ln_named_part mmcblk3 /dev<br />
<br />
# misc setting<br />
symlink /dev/block/mmcblk3p12 /dev/general_setting<br />
symlink /dev/block/mmcblk3p15 /dev/fa<br />
symlink /dev/block/mmcblk3p16 /dev/otp<br />
chown root system /dev/VAR<br />
chmod 0660 /dev/VAR<br />
chown root system /dev/WP1<br />
chmod 0660 /dev/WP1<br />
chown root system /dev/MSC<br />
chmod 0660 /dev/MSC<br />
<br />
setprop ro.crypto.tmpfs_options size=128m,mode=0771,uid=1000,gid=1000<br />
mount_all /fstab.streak7
```
*fstab.streak7*

```
# Android fstab file.<br />
#<src>                                          <mnt_point>     <type>  <mnt_flags and options>     <fs_mgr_flags><br />
# The filesystem that contains the filesystem checker binary (typically /system) cannot<br />
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK<br />
/dev/block/platform/sdhci-tegra.3/by-num/p3     /system         ext4    ro                          wait<br />
/dev/block/platform/sdhci-tegra.3/by-num/p4     /cache          ext4    noatime,nosuid,nodev        wait,check<br />
/dev/block/platform/sdhci-tegra.3/by-num/p13    /data           ext4    noatime,nosuid,nodev        wait,check
```


----------



## giveen (Nov 9, 2011)

I'll try that tomorrow.
Also could I talk to you in a PM about audio drivers?


----------



## giveen (Nov 9, 2011)

Okay that worked  but I am getting this

```
<3>EXT4-fs (mmcblk3p13):<br />
Unrecognized mount option "nomblk_io_submit" or missing value
```
On both p13 and p4.

Do you know why mediaserver keeps crashing after loading up the audio driver?


----------



## imnuts (Jun 9, 2011)

No idea what may be wrong with the audio drivers, but I'd guess that looking in logcat and dmesg would be a good place to start. See if there is any info in them around when you load the driver.

Looking at some info about the error you're getting, it looks like it's due to old EXT4 drivers. Not sure if getting rid of the ",check" at the end of those lines would fix it or not. If not, you may need to look at back-porting the EXT4 drivers from a newer kernel version to allow you to use the mount_all option.


----------

