Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

Sometimes I really wish they hadn't messed around with Linux so much! I know there's an /etc/fstab in there somewhere, but where?

I'd like to mount some partitions with alternative filesystems (because I don't like FAT32).

share|improve this question

4 Answers 4

up vote 17 down vote accepted

Don't think about Android as a heavily modified Linux distribution. Because it's not. The nearly only thing that Android shares with a Linux distribution is the kernel. And even this component is modified. Also other core components, like the libc, differ.

Android has no /etc/fstab

You don't need /etc/fstab to mount an partition. But there is IIRC no mount command either.dev_mount should work (root required). To answer your questions title: All startup system mounting is done with the/etc/vold.fstab helper script.

share|improve this answer
    
Guess I'm a wishful maemo user then really. Yeah it's pretty far away from linux I guess. Thanks for the pointer to vold.fstab ! –  barrymac Oct 14 '11 at 0:51
    
Vold.fstab only has sd card stuff on my nexus one –  gcb May 20 '12 at 21:11

I'm seeing conflicting information. One resource says it's hardcoded, so not something you can change user-side:

Android-specific init programs are found in device/system/init. Add LOG messages to help you debug potential problems with the LOG macro defined in device/system/init/init.c.

The init program directly mounts all filesystems and devices using either hard-coded file names or device names generated by probing the sysfs filesystem (thereby eliminating the need for a /etc/fstab file in Android).

Elsewhere /etc/vold.fstab and /etc/vold.conf are mentioned. I have them on my device under CM 7.1 but I'm not sure of how they are used.

share|improve this answer
1  
The are used at system startup, vold.conf is for the emulator startup. I don't think that the information is conflicting: The hard-coded file/device names are "hard-coded" within vold.fstab. –  Flow Oct 13 '11 at 18:09
2  
It kind of is hardcoded, but it kind of isn't. There's an init.rc file that lives in your ramdisk, so you can pull your boot.img, extract your ramdisk, and then modify the init.rc and repack it again (briefly discussed here, and Tiamat's source is a good example of setting mountpoints in init.rc) –  eldarerathis Oct 13 '11 at 18:18

You can remount your external storage to be executable by running

mount -o remount, rw /mnt/sdcard

this will remove the noexec, nosuid and nodev flags, but it will still be vfat fs. You can make links to this fs but not from within. The remount does not survive a reboot, because the vold.fstab file will be read and they will be remounted at reboot with the noexec flags.

If you reformat any of your external storage to anything other than vfat, then they will not be remounted at reboot, and any apps that you have moved to any external storage will not be usable. If you don't intend to use external storage for apps then you can unmount your external storage and use busybox mke2fs DEVICE to make it ext2. Use busybox newfs_msdos DEVICE to return it to vfat and make it usable again.

Note busybox mkfs.vfat is broken, you will get something like

lseek: Value too large for defined data type

so don't waste your time. All of this assumes you are rooted, and have a working busybox binary.

share|improve this answer

The fstab file is in /.

It's called /fstab.$systemname.rc where $systemname is based on the handset's fingerprint property, either identified as category of chipset or handset itself.

share|improve this answer
3  
That is dependant and varies from ROM to ROM. In AOSP its /etc/vold.fstab. :) –  t0mm13b Jan 26 '13 at 22:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.