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.

How do I mount /mnt/sdcard/data as /data. Right now the /data has its own partition but it's too small (~500mb) and I would much rather give it more space than move apps and other things to my SD card.

My device is Micromax Canvas 2 A110.

It has a ~2GB internal sd card mounted at /mnt/sdcard2
and an external one at /mnt/sdcard and /sdcard
(I'm on some custom rom that switches internal and external default mount points like that)

I don't know what filesystem those are in.

share|improve this question
    
What's the filesystem on your external sd? Also, tell more about your device.. –  Sachin Shekhar Jan 24 '13 at 6:26
    
@SachinShekhar added details in the edit. –  laggingreflex Jan 24 '13 at 6:34
add comment

2 Answers 2

i had the same problem and my external sd card was in extsd, /mnt/extsd, and the one inside the tablet was in /mnt/sdcard.

I spend 3 hours to figure this out.

Hope this helps someone. Thanks

share|improve this answer
1  
Sorry, but this doesn't really answer the question. The asker wasn't asking where his SD card data resides, he was asking how he could use a portion of the SD card to provide more space for apps and data. See the answer above. –  Trebor Rude May 4 '13 at 4:38
add comment

This is the way to have /data on the SD Card directory:

  1. Copy all /data to the SD card directory: /mnt/sdcard/data
  2. Delete /data
  3. Create a symlink that points to the SD: ln -s /mnt/sdcard/data /data

The main problem is that /data could be EXT2/3/4 partition, while the SD Card is FAT32. The best thing to achieve what you want is to create an extra partition on the SD Card as EXT2/3/4 filesystem. Then you can link the directory /data with the partition.

When the phone restarts, it will mount the data partition more or less like this:

mount <args> /dev/block/mmcblk0p2 /data

Since /data is pointing now to /mnt/sdcard/data, the above command is equivalent to this one:

mount <args> /dev/block/mmcblk0p2 /mnt/sdcard/data

So in the end, we would have our data partition mounted in the SD card. Again, it should be in a separate partition, so we have the SD card as FAT and the extra partition as EXT2/3/4 so it won't fail when it mounts due to the filesystem.

If you want a more elegant solution, you can try any of the XDA Developers App2SD scripts, they let you achieve the same but without symlinking (it will mount it and bind it to /data). You will only need a Custom Recovery to be able to flash them. You can check them here.

share|improve this answer
    
What does a reboot mean in your example? The init-scripts probably want to mount the original /data partition then. Won't that be a problem? –  Izzy Jan 24 '13 at 12:06
    
When rebooting the phone, it will mount the data partition in /data. Since it now points to the SD card, it will mount it there and it shouldn't be a problem since we're using the same filesystem. –  Peter Jan 25 '13 at 8:13
    
Thank you for clarification :) –  Izzy Jan 25 '13 at 10:36
add comment

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.