Mounting the second partition of SDCARD as internal memory - Android Q&A, Help & Troubleshooting

Alright so here's the deal, my internal SDCARD is corrupted and the /data partition is unusable.
My device is i9003 and it's running on MIUI at the moment. By default MIUI didn't detect my external SD or my internal SD but after editing "vold.fstab" I was able to mount the first partition of my external SDCARD as external memory and everything was good, I could finally use the camera and pretty much do everything else.
But I was still unable to mount the second partition of my external SDCARD as my internal memory which meant none of my messages could be saved and the phone would pretty much go back to factory settings after a reboot, this apparently is because the /data partition (present on the internal memory) stores all the user data such as the time, the theme I'm using, etc and not having a /data partition meant none of these settings were really saved.
Having no internal memory also means I cannot install any apps such as Link2SD.
Moving on, after many hours of googling I found out that it might not be possible to mount the internal memory using "vold.fstab" and the only way to do it could be by mounting the memory manually during init.
So here's what I want again, I want to use the second partition of my external SDCARD as internal memory, this is likely to solve all my problems and make my phone usable again.
Thanks for all the help, appreciate it.

You need to edit /init.rc (or init.vendor.rc). To make the edits here stay, you'll need to create a new boot.img to flash your device with.
Have a look at an extract of mine init.<vendor>.rc:
Code:
on fs
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
#mount yaffs2 [email protected] /system
#mount yaffs2 [email protected] /system ro remount
# Use below two lines instead of above to run /system from SDcard instead of internal flash
mount ext3 /dev/block/mmcblk0p3 /system
mount ext3 /dev/block/mmcblk0p3 /system ro remount
#mount yaffs2 [email protected] /data nosuid nodev
mount ext3 /dev/block/mmcblk0p4 /data nosuid nodev
mount yaffs2 [email protected] /cache nosuid nodev
Compare the lines I've commented out with the others. Here both /data and /system resides on the SDcard, you only need to care about /data. Also remember your device nodes may not be named "mmcblk0p3" etc.
But you'll need to make those changes in the initramfs in your flashed boot.img to make them stay.

kuisma said:
You need to edit /init.rc (or init.vendor.rc). To make the edits here stay, you'll need to create a new boot.img to flash your device with.
Have a look at an extract of mine init.<vendor>.rc:
Code:
on fs
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
#mount yaffs2 [email protected] /system
#mount yaffs2 [email protected] /system ro remount
# Use below two lines instead of above to run /system from SDcard instead of internal flash
mount ext3 /dev/block/mmcblk0p3 /system
mount ext3 /dev/block/mmcblk0p3 /system ro remount
#mount yaffs2 [email protected] /data nosuid nodev
mount ext3 /dev/block/mmcblk0p4 /data nosuid nodev
mount yaffs2 [email protected] /cache nosuid nodev
Compare the lines I've commented out with the others. Here both /data and /system resides on the SDcard, you only need to care about /data. Also remember your device nodes may not be named "mmcblk0p3" etc.
But you'll need to make those changes in the initramfs in your flashed boot.img to make them stay.
Click to expand...
Click to collapse
Thanks for the reply man, mind telling me the how I can go about doing this?, I've got the ROM I flashed via CWM here with me, I could send it over to you if that would make things easier for you.
EDIT: would pulling init.rc via ADB, making the changes and pushing it back do the trick? or do I have to go for the boot.img? In case it's the latter, I'm going to need help doing it.

PhantomPhreek said:
Thanks for the reply man, mind telling me the how I can go about doing this?, I've got the ROM I flashed via CWM here with me, I could send it over to you if that would make things easier for you.
Click to expand...
Click to collapse
You'll find a good tutorial about how to work with boot images here: http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
If you already got the ROM in a file, this should be easy! Got ADB and FASTBOOT as well?

kuisma said:
You'll find a good tutorial about how to work with boot images here: http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
If you already got the ROM in a file, this should be easy! Got ADB and FASTBOOT as well?
Click to expand...
Click to collapse
I'm not sure I've got FASTBOOT but I've definitely got ADB and I've also got the ROM. Would pulling init.rc via ADB, making the changes and pushing it back do the trick? or do I have to go for the boot.img?.

PhantomPhreek said:
I'm not sure I've got FASTBOOT but I've definitely got ADB and I've also got the ROM. Would pulling init.rc via ADB, making the changes and pushing it back do the trick? or do I have to go for the boot.img?.
Click to expand...
Click to collapse
No. You need to reboot the phone for the init.rc script to execute, and once you reboot the phone, the root file system is overwritten by the flashed image ... Catch 22.
You'll NEED to create a new boot.img with a new initramfs containing your changes.

kuisma said:
No. You need to reboot the phone for the init.rc script to execute, and once you reboot the phone, the root file system is overwritten by the flashed image ... Catch 22.
You'll NEED to create a new boot.img with a new initramfs containing your changes.
Click to expand...
Click to collapse
Shucks, this explains why it didn't work. Alright, so I extract boot.img from the rom, follow the tutorial.What is it that I have to edit again? "/init.rc" or "init.<vendor>.rc"?.
Thanks for the help man, appreciate it.
EDIT: Looks like the tutorial is meant for Linux, I'm currently on Windows. I might be asking for a lot here but is there any chance I could get you to do it for me?

PhantomPhreek said:
Shucks, this explains why it didn't work. Alright, so I extract boot.img from the rom, follow the tutorial.What is it that I have to edit again? "/init.rc" or "init.<vendor>.rc"?.
Thanks for the help man, appreciate it.
Click to expand...
Click to collapse
Of course, MIUI may have some boot hooks you could use to re-mount /data after boot. I know nothing about that ROM. Also keep in mind that each time you update the ROM, you have to remake this edit.
Also, no idea what MIUI calls its init.rc, you'll just have to see for yourself. If you've got the mount commands in init.rc, fine. Else look elsewhere.
A good first step would to make sure you really are able to flash a new boot.img. Download fastboot and verify your device understands it. Else you have to use some proprietary flash program, and I'm not familiar with Samsungs bootloaders at all. Ask in the Samsung forum if so.

kuisma said:
Of course, MIUI may have some boot hooks you could use to re-mount /data after boot. I know nothing about that ROM. Also keep in mind that each time you update the ROM, you have to remake this edit.
Also, no idea what MIUI calls its init.rc, you'll just have to see for yourself. If you've got the mount commands in init.rc, fine. Else look elsewhere.
A good first step would to make sure you really are able to flash a new boot.img. Download fastboot and verify your device understands it. Else you have to use some proprietary flash program, and I'm not familiar with Samsungs bootloaders at all. Ask in the Samsung forum if so.
Click to expand...
Click to collapse
Looks like the tutorial is meant for Linux, I'm currently on Windows. I might be asking for a lot here but is there any chance I could get you to do it for me?. ADB and I do see the file init.rc and I also see the mount commands as well. I used adb shell to run the command you sent over with a few edits for second partition and it does mount but as you said, it all goes away after reboot.

PhantomPhreek said:
Looks like the tutorial is meant for Linux, I'm currently on Windows. I might be asking for a lot here but is there any chance I could get you to do it for me?. ADB and I do see the file init.rc and I also see the mount commands as well. I used adb shell to run the command you sent over with a few edits for second partition and it does mount but as you said, it all goes away after reboot.
Click to expand...
Click to collapse
Hmm... are you even able to create a second ext3 partition on the SDcard using Windos..?

kuisma said:
Hmm... are you even able to create a second ext3 partition on the SDcard using Windos..?
Click to expand...
Click to collapse
haha, I used CWM to create the partitions initially, but then I used a software called MiniTool, works well. Can I get you to to do it?

PhantomPhreek said:
Alright so here's the deal, my internal SDCARD is corrupted and the /data partition is unusable.
Click to expand...
Click to collapse
The ROM you are using requires an ext4 partition as partition #3 of the SDcard. This is mounted as /data. Repartition your SDcard #1 as FAT, #2 whatever, and #3 as ext4, and everything will work as intended. :victory:
I guess you've missed this in the ROM documentation ...

kuisma said:
The ROM you are using requires an ext4 partition as partition #3 of the SDcard. This is mounted as /data. Repartition your SDcard #1 as FAT, #2 whatever, and #3 as ext4, and everything will work as intended. :victory:
I guess you've missed this in the ROM documentation ...
Click to expand...
Click to collapse
Wah~ really?, I'll try that and get back here with the results. Thanks a lot!.
EDIT: Is it FAT or FAT32?

PhantomPhreek said:
Wah~ really?, I'll try that and get back here with the results. Thanks a lot!.
EDIT: Is it FAT or FAT32?
Click to expand...
Click to collapse
FAT32.

kuisma said:
FAT32.
Click to expand...
Click to collapse
Tried but didn't work out. I made three partitions, all primary - #1 FAT32, #2 FAT32, #3 EXT4. Plugged the SDCARD in and the external memory was detected as usual, but not the internal memory.
I tried changing the time, it was reset back after reboot.
After that I left the SDCARD as is and flashed the ROM again and now, neither the internal nor the external memory are detected. This is probably because the "vold.fstab" which was edited by me, was overwritten on re flashing.
I'm at a dead end, any ideas?

PhantomPhreek said:
Tried but didn't work out. I made three partitions, all primary - #1 FAT32, #2 FAT32, #3 EXT4. Plugged the SDCARD in and the external memory was detected as usual, but not the internal memory.
I tried changing the time, it was reset back after reboot.
After that I left the SDCARD as is and flashed the ROM again and now, neither the internal nor the external memory are detected. This is probably because the "vold.fstab" which was edited by me, was overwritten on re flashing.
I'm at a dead end, any ideas?
Click to expand...
Click to collapse
Attach an output of "df", "mount", the file "/init.latona.rc" and "/etc/vold.fstab" here, and I'll have a look at it. Hmm... include the output of "dmesg" as well, to be on the safe side.

kuisma said:
Attach an output of "df", "mount", the file "/init.latona.rc" and "/etc/vold.fstab" here, and I'll have a look at it. Hmm... include the output of "dmesg" as well, to be on the safe side.
Click to expand...
Click to collapse
What bugs me is the fact that the external SD is not detected, from what little knowledge I have, external SD is unrelated to the internal SD which I currently have problems with, meaning it should be detected without a problem.
Also I have to add, CWM doesn't detect my external SD right away, when I go to recovery and go over to "Choose zip from sdcard" it says "E:Can't mount /sdcard/". The solution I've found coincidentally is to go to "mounts & storage", mount "/emmc", pull the SDCARD out plug it in again and then "mount /sdcard" this works perfectly and I'm able to flash roms from the sdcard.

One problem at a time, please. Attach the files I requsted, so we can determine why /data failes to mount. Looking at your ROM:
Code:
$ grep " /data$" init.latona.rc
mount ext4 /dev/block/mmcblk0p3 /data
I want to know why this fails, and I guess the answer is in the dmesg output. And please before I'll get another whiskey.

kuisma said:
One problem at a time, please. Attach the files I requsted, so we can determine why /data failes to mount. Looking at your ROM:
Code:
$ grep " /data$" init.latona.rc
mount ext4 /dev/block/mmcblk0p3 /data
I want to know why this fails, and I guess the answer is in the dmesg output. And please before I'll get another whiskey.
Click to expand...
Click to collapse
I can't seem to find "/init.latona.rc" everything else you requested I've mailed them over already
EDIT: the dmesg output is AFTER I mounted "/sdcard" manually as explained in my previous post.

PhantomPhreek said:
I can't seem to find "/init.latona.rc" everything else you requested I've mailed them over already
EDIT: the dmesg output is AFTER I mounted "/sdcard" manually as explained in my previous post.
Click to expand...
Click to collapse
The files you mailed me does not correspond to the ROM you refereed.
The /etc/fstab show that /data is mounted as an rfs file system, not ext4. So either format partition #3 on the sdcard as rfs (Samsung proprietary), or edit /etc/fstab and change "rfs" to "ext4". I'd prefer the later, assuming your kernel supports ext4. Else use ext3.
Code:
/dev/block/mmcblk0p3 /data rfs rw
But you can't have flashed the ROM you told me you did. It excepted an ext4 file system ...

Related

Using 2 Ext4 partitions on SD instead of one Ext+fat32

My sdcard(class 4 8gb sandisk) is causing problems with fat32 fs...i use debian all the time and wud like to have a much advanced fs like ext4 for saving my music,videos,pictures etc instead of fat32...how can i achieve taht...Does android use a fstab or something for mounting on boot ???
I'm quite sure android uses fstab for mounting, you just need to set the proper mounting option on your FS to force it to check fstab options. I have one question(since I don't use a linux machine), can you access your ext(2nd) partition(if you have one) when you connect your phone to the PC using debian?
Yep,Android uses fstab to mount all.
anybody interested in setting it up i dont have the requisite knowhow
I have not toyed with fstab myself... but I did find this page which seems to have want your looking for.
http://androidandme.com/2009/08/news/how-to-manually-partition-your-sd-card-for-android-apps2sd/
It isn't exactly what your explaining, BUT seems to go through the commands needed for what you are wanting to try.
Just remember to back up! Good luck!
Sent from my LG-P500 using XDA App
Instructions:
-Suggested at least fat32 partition to be 1gig and the rest to your ext partition. Also, try to use root explorer for everything else. Must have init.d support.
1. On your SD card, make a folder to serve as a door/portal to access your ext partition files.(When testing this, I just used the default "/sdcard/media" folder)
2. Make a blank text file and name it as "11usext"
3. Using root explorer, edit the file and add this line inside it:
Code:
#!/system/bin/sh
busybox mount -t auto /dev/block/mmcblk0p2 /mnt/sdcard/media
change media to the folder that you just made on step 1. Exit and save.
4. Using root explorer move this file to /system/etc/init.d
5. Again using root explorer, change the permission to "rwxrwxrwx"
6. Reboot and play. This would allow you to access your ext partition through the /media or the folder that you have created.
If this does not work, then you should give more details on what setup you are running.
ungaze said:
Instructions:
-Suggested at least fat32 partition to be 1gig and the rest to your ext partition. Also, try to use root explorer for everything else. Must have init.d support.
1. On your SD card, make a folder to serve as a door/portal to access your ext partition files.(When testing this, I just used the default "/sdcard/media" folder)
2. Make a blank text file and name it as "11usext"
3. Using root explorer, edit the file and add this line inside it:
Code:
#!/system/bin/sh
busybox mount -t auto /dev/block/mmcblk0p2 /mnt/sdcard/media
change media to the folder that you just made on step 1. Exit and save.
4. Using root explorer move this file to /system/etc/init.d
5. Again using root explorer, change the permission to "rwxrwxrwx"
6. Reboot and play. This would allow you to access your ext partition through the /media or the folder that you have created.
If this does not work, then you should give more details on what setup you are running.
Click to expand...
Click to collapse
That's a quite dirty implementation. All he want's is an ext4 partition mounted as /sdcard. I want to do the same, but right now I'm messing with the internal fs. I'll look into it.
That's a quite dirty implementation.
Click to expand...
Click to collapse
Dirty it might be(I even tried a dirtier one), but that's all he's got at the moment. If you have a better solution(even just a rough plan), please do share. Maybe we can exchange knowledge on stuff like these.
Using 2 Ext4 partitions on SD instead of one Ext+fat32
Click to expand...
Click to collapse
Would mean that no Fat32 partition exist, and I've never heard of anything like that.
I have one question(since I don't use a linux machine), can you access your ext(2nd) partition(if you have one) when you connect your phone to the PC using debian?
Click to expand...
Click to collapse
And since no one answered this, I have no idea how you could transfer files to your phone without using card readers.
ungaze said:
Dirty it might be(I even tried a dirtier one), but that's all he's got at the moment. If you have a better solution(even just a rough plan), please do share. Maybe we can exchange knowledge on stuff like these.
Click to expand...
Click to collapse
Probably it involves messing with the init.rc (and I think that involves messing with boot and recovery images, but, I'm not sure) or init.d scripts or fstab. Anyway, I'm not sure, but it should be possible.
ungaze said:
Would mean that no Fat32 partition exist, and I've never heard of anything like that.
Click to expand...
Click to collapse
Yes. The /sdcard partition would exist, just not fat32 formatted.
ungaze said:
And since no one answered this, I have no idea how you could transfer files to your phone without using card readers.
Click to expand...
Click to collapse
Linux systems can read and write to ext4 partitions without problems. In fact, it's a linux filesystem. I had problems once when I had a sd_ext partition (for Apps2SD), because both partitions would get mounted when using mass storage mode, while Android only unmounts the /sdcard (fat32) partition, leading to file corruption (because of the same partition being mounted on both systems at once).
We could create the partitions using gparted or cfdisk on a pc. I'm not sure, but maybe simply mounting it with different params (like the filesystem type and other options) at /sdcard would do the trick. Everything else that follows would be easy.
I've been doing some testing and research.
On recovery side:
I've done a little modification in Mik's ClockWork recovery to make it accept ext4 and vfat as valid file systems for the first partition on sdcard. It involves just a little change on /etc/recovery.fstab file, but then you need to rebuild the recovery image.
This is working fine.
On the OS side:
It's not an easy mod. It involves patching the vold (volume manager) and recompiling. There are some proposed patches to Cyanogenmod, but I don't know if it's been accepted and if it made it to Miks CM7 port.
I'll do some tests and post results.
ilarrain said:
I've been doing some testing and research.
On recovery side:
I've done a little modification in Mik's ClockWork recovery to make it accept ext4 and vfat as valid file systems for the first partition on sdcard. It involves just a little change on /etc/recovery.fstab file, but then you need to rebuild the recovery image.
This is working fine.
On the OS side:
It's not an easy mod. It involves patching the vold (volume manager) and recompiling. There are some proposed patches to Cyanogenmod, but I don't know if it's been accepted and if it made it to Miks CM7 port.
I'll do some tests and post results.
Click to expand...
Click to collapse
This got my interest
Mik's CM7 (beta 6.2) recognizes and mounts the ext4 partition just fine.
BUT:
As vfat is a non posix fs, there wasn't any need for the OS to manage permissions, so it's a mess.
Applications on the SD card (I'm not using Apps2SD or Data2SD) don't load, internal applications can't be moved to SD, and many apps can't store data on the SD, even I've set read+write permissions on all files and directories (chmod -R 777 /sdcard/). I have no idea why. I'm stuck.

Boot Manager for the Optimus V

Anyone know if this will work on the Optimus V?
http://lifehacker.com/5826050/how-to-dual-boot-multiple-roms-on-your-android-phone
I don't know, but it looks like it does the same thing we do in recovery. Plus I think you would still have to restore all of your apps. Might as well just boot into recovery and do it the old fashioned way.
Sent from my LG-VM670 using XDA App
You only have to restore once. And as far as I know, it doesn't work for the v yet. (I tried). If someone gets it to work it would be awesome to get a tut.
"device name is found in your build.prop which is at /system/build.prop its at the line ro.product.build= and whatever that's equal to is your device name
the rest you need adb shell and need to reboot to recovery then type these mount your sdcard (to the phone not the computer) data system and cache then type the command "mount" without the quotes and look for the line in sdcard for /dev/block/something and that is what your sdcard block is
Next in adb shell still in recovery type the command "df -h" without the quotes and get the size of data system and cache and put them in and that's it you have unofficial support"
YThis is what one of the devs told me if anyone cares to try and post results.
Ya, I did all of that. My problem comes when trying to figure out which number is which.. Like is data your sd card and so on
Anyone willing to help me figure out which is which?
BigChillin said:
Anyone willing to help me figure out which is which?
Click to expand...
Click to collapse
here you go.
Filesystem Size Mounted on
/dev/block/mtdblock5 164.5M /system
/dev/block/mtdblock6 178.9M /data
/dev/block/mtdblock1 110.1M /cache
or, if you need more exact numbers:
Filesystem 1K-blocks Mounted on
/dev/block/mtdblock5 168448 /system
/dev/block/mtdblock6 183168 /data
/dev/block/mtdblock1 112768 /cache
I don't mind running the numbers for you but I don't want to help port that software.
I was considering making a multiboot recovery, but haven't decided it's worth my while for the time it'd take to refine enough to release.
edit: oh, yeah: android mounts the sdcard at /dev/block/vold/179:1
you can also access it from /dev/block/mmcblk0p1 (although the 0 increases by 1 every time you remove and replace the SD card until rebooting.)
will this work at optimus me?

CM10 - external_sd mount location

I jumped from stock to CM10 and have found an issue I need resolved, but am not sure how to go about it.
On stock, I didn't have
/sdcard/ is the path for the internal memory
/sdcard/external_sd/ is the path for the actual add-in slot you buy yourself.
This is great because the file explorer apps don't need special access to get to, and things are at least somewhat logical on how they're laid out.
On CM10:
/storage/sdcard0/ is internal memory
/storage/sdcard1/ is external memory
There are symbolic links of /sdcard and /external_sd but to access the latter, I need to tell apps like ES file explorer to change their base path rather than just having a nested mount structure.
I've tried using terminal emulator to go in and create a symbolic link, but I get 'operation not permitted' messages. I've also tried editing /etc/vold.fstab to have it change the mount from /storage/sdcard1 to /storage/sdcard0/external_sd, but the filesystem is read-only and 'mount -o remount,rw /' doesn't have an effect even though it doesn't complain.
How can I change the mount structure back to how I want it and how it's easier to access/navigate it in my apps?
Run into some situation, hopefully someone can shed some light
Did you mount this files as r/w?
Sent from my SAMSUNG-SGH-I717 using xda premium
johnrippa said:
Did you mount this files as r/w?
Sent from my SAMSUNG-SGH-I717 using xda premium
Click to expand...
Click to collapse
In my original post I mention trying to get it remounted as r/w, the command doesn't complain but the filesystem stays read-only.
Try busybox mount -o remount,rw /system
If that fails, use an app to do it.
ChronoReverse said:
Try busybox mount -o remount,rw /system
If that fails, use an app to do it.
Click to expand...
Click to collapse
Any particular apps to recommend? I had tried issuing the remount command on / and not /system. I will give that another try.
ChronoReverse said:
Try busybox mount -o remount,rw /system
If that fails, use an app to do it.
Click to expand...
Click to collapse
I was able to modify the mount point to be /storage/sdcard0/external_sd/ for the external SD slot, but when I rebooted CM it got stuck and would buzz every 10 seconds or so and stayed that way indefinitely. Not sure why this breaks CM so bad but there you have it. Oh well.
Might be a better idea to just add links so you get your old /sdcard/external_sd
I'm not currently on a CM10 ROM or else I'd test.
ChronoReverse said:
Might be a better idea to just add links so you get your old /sdcard/external_sd
I'm not currently on a CM10 ROM or else I'd test.
Click to expand...
Click to collapse
Symbolic links don't work on a FAT based filesystem (which the SD card mounts are), unfortunately.

[Q] sd card with two partitions: 2nd not visible to File Explorer

My situation: Galaxy S3 with latest (26 Oct. 2012) update to 4.1.1 via Kies. Then rooted. Works smoothly. External Sd-card visible, no problem.
Then:
repartitioned SD-card with gparted in Fedora machine: mmcblk1p1 with old contents, mmcblk1p2 for new contents, both vfat. Filled mmcblk1p2 with contents from linux machine.
In the phone the first partition (the one with the old data) is recognised as before. The second partition is not seen.
By using the terminal emulator as super user I can mount the second partition by the command:
mount -rw -t vfat /dev/block/mmcblk1p2 <mountpoint>
<mountpoint> is a directory VISIBLE to File Explorer.
After mounting, however, the directory contents are NOT visible in File explorer (even after stopping and restarting File explorer) but can be listed perfectly in the terminal emulator. Giving the cp-command for copying of an individual (MP3) file from the <mountpoint> to the folder Music shows the copied file in that folder and the music can be played in the usual way through the GUI.
Question:
Does anybody have an idea how to make the mounted 2nd partition visible to the apps so that the files can be accessed though the GUI?
Thanks for thinking about this problem.
Bananiel-1944
Found the solution by some more thinking after all:
mount -rw -t vfat -o umask=0000 /dev/block/mmcblk1p2 <mountpoint>
The -o umask=0000 is essential, otherwise the permissions are rwx------; with the umask option they are rwxrwxrwx and thus can be reached.
For safety sake, mount when needed and umount promptly afterwards.
Bananiel-1944
Bananiel-1944 said:
My situation: Galaxy S3 with latest (26 Oct. 2012) update to 4.1.1 via Kies. Then rooted. Works smoothly. External Sd-card visible, no problem.
Then:
repartitioned SD-card with gparted in Fedora machine: mmcblk1p1 with old contents, mmcblk1p2 for new contents, both vfat. Filled mmcblk1p2 with contents from linux machine.
In the phone the first partition (the one with the old data) is recognised as before. The second partition is not seen.
By using the terminal emulator as super user I can mount the second partition by the command:
mount -rw -t vfat /dev/block/mmcblk1p2 <mountpoint>
<mountpoint> is a directory VISIBLE to File Explorer.
After mounting, however, the directory contents are NOT visible in File explorer (even after stopping and restarting File explorer) but can be listed perfectly in the terminal emulator. Giving the cp-command for copying of an individual (MP3) file from the <mountpoint> to the folder Music shows the copied file in that folder and the music can be played in the usual way through the GUI.
Question:
Does anybody have an idea how to make the mounted 2nd partition visible to the apps so that the files can be accessed though the GUI?
Thanks for thinking about this problem.
Bananiel-1944
Click to expand...
Click to collapse
Dear Bananiel,
your post was closest to the solution of my problem, maybe you could suggest something that will finally help me.
I've partitioned external SDcard with CWM to be used for Link2SD. Link2SD's script works fine and the EXT2 partition mounts well. The problem is with the FAT32 partition which can't be mounted by android (I get "SD card empty of file system damaged" in the notification area). When I go in CWM recovery mode I can mount that partition by choosing "mount USB storage" option and then I can see it on my PC. Partition is healthy and PC has no problems with it.
I've tried issuing commands you've suggested in your post through ADB SHELL, after that when I go to folder that I've designated as mount point I can see files from non-working partitio, but the message in notification area still persist. Also the change is not permanent, after reboot I have to do that again.
Thanks in advance for any help given.
Bananiel-1944 said:
Found the solution by some more thinking after all:
mount -rw -t vfat -o umask=0000 /dev/block/mmcblk1p2 <mountpoint>
The -o umask=0000 is essential, otherwise the permissions are rwx------; with the umask option they are rwxrwxrwx and thus can be reached.
For safety sake, mount when needed and umount promptly afterwards.
Bananiel-1944
Click to expand...
Click to collapse
dxage said:
Dear Bananiel,
your post was closest to the solution of my problem, maybe you could suggest something that will finally help me.
I've partitioned external SDcard with CWM to be used for Link2SD. Link2SD's script works fine and the EXT2 partition mounts well. The problem is with the FAT32 partition which can't be mounted by android (I get "SD card empty of file system damaged" in the notification area). When I go in CWM recovery mode I can mount that partition by choosing "mount USB storage" option and then I can see it on my PC. Partition is healthy and PC has no problems with it.
I've tried issuing commands you've suggested in your post through ADB SHELL, after that when I go to folder that I've designated as mount point I can see files from non-working partitio, but the message in notification area still persist. Also the change is not permanent, after reboot I have to do that again.
Thanks in advance for any help given.
Click to expand...
Click to collapse
In my situation (SD-card with two partitions, both vfat) the first partition automatically was mounted at start-up, the second needed to be mounted manually whenever I wanted to access it. This was also my intention as that second partition contains sensitive information.
Android has a file fstab.<system-id> in the root directory, in which some mounts are mentioned (but not all).
You could try to edit this file with the permanent mounts you are looking for. I'm not sure if that works, however, as I do not want a permanent mount.
Can you publish your results, please?
Bananiel
Finally!
I managed to get my external partitions visible with the help of this post.
Device: Samsung Galaxy Tab2 10.1
ROM: Candy5_p5110 Android 5.1.1
SDExternal: 2 Partitions; 1st VFAT, 2nd Ext3
Using Mount2Sd from Google Playstore.
I had the same mounting issues. SD external would only mount Partition 1 automatically and manually mounting Partition 2 would only be visible via Terminal.
The solution that finally fixed the invisible 2nd Partition was to reformat the 2nd Partition with Ext3 and allowing Mount2Sd to find it and mount to /sd-ext. Formatting to vfat or ext4 did not work. Only Ext3 did the trick.
I hope this helps others and big thanks to the OP for bringing this issue up.

can't mount internal sdcard exfat

I formatted my internal sdcard to exfat by mistake while trying to simply format it(for some reason windows defaulted to exfat instead of fat32) now my sdcard won't mount and I can't format it in windows and can't mount it, any way you guys think I could get it back to fat32 and working again.
KainXSS said:
I formatted my internal sdcard to exfat by mistake while trying to simply format it(for some reason windows defaulted to exfat instead of fat32) now my sdcard won't mount and I can't format it in windows and can't mount it, any way you guys think I could get it back to fat32 and working again.
Click to expand...
Click to collapse
I think you would have to fix it while in recovery - either with adb parted (example: http://mobilecon.info/how-to-partition-sdcard-using-parted-partition.html - don't use those commands, they will be specific to your device and what block the internal storage is located on) or possibly GParted in Linux?
What device do you have? Depending on what kind of storage set up, it might be possible to reformat everything by restocking it with the original firmware, but I am not positive on that.
es0tericcha0s said:
I think you would have to fix it while in recovery - either with adb parted (example: http://mobilecon.info/how-to-partition-sdcard-using-parted-partition.html - don't use those commands, they will be specific to your device and what block the internal storage is located on) or possibly GParted in Linux?
What device do you have? Depending on what kind of storage set up, it might be possible to reformat everything by restocking it with the original firmware, but I am not positive on that.
Click to expand...
Click to collapse
yup, I had to use parted and delete the sdcard block then recreate it as fat32
KainXSS said:
yup, I had to use parted and delete the sdcard block then recreate it as fat32
Click to expand...
Click to collapse
Right on. Mind posting what you had to do, for future reference? I'm curious and could come in handy if I find myself in that situation.
es0tericcha0s said:
Right on. Mind posting what you had to do, for future reference? I'm curious and could come in handy if I find myself in that situation.
Click to expand...
Click to collapse
what I did was go into cwm then run
adb shell
su
parted /dev/block/mmcblk0 (to see what block the sdcard is)
rm (block #) (remove entire block)
mkpartfs
-block name
-format type (I needed fat32)
-start
-end
then start creating block and waited till done.
KainXSS said:
what I did was go into cwm then run
adb shell
su
parted /dev/block/mmcblk0 (to see what block the sdcard is)
rm (block #) (remove entire block)
mkpartfs
-block name
-format type (I needed fat32)
-start
-end
then start creating block and waited till done.
Click to expand...
Click to collapse
Right on. Hope it doesn't come to that, but I fix people's phones for a living, so never know when someone will have an issue like this.

Categories

Resources