[9001]Mounting external SD Card as ext3 - Galaxy S I9000 Q&A, Help & Troubleshooting

Hey,
I like to mount my external SD Card as ext3 to support large files. The SD Card is formatted with ext3 but now Android shows only an empty folder.
So i tried to remount the SD:
Code:
mount -o rw,remount -t ext3 /dev/block/vold/197:33 /mnt/sdcard/externald_sd
But it doesnt use something... Does anybody has an idea? Some Example or sthing else?
Greetz

FaxXer said:
Hey,
I like to mount my external SD Card as ext3 to support large files. The SD Card is formatted with ext3 but now Android shows only an empty folder.
So i tried to remount the SD:
Code:
mount -o rw,remount -t ext3 /dev/block/vold/197:33 /mnt/sdcard/externald_sd
But it doesnt use something... Does anybody has an idea? Some Example or sthing else?
Greetz
Click to expand...
Click to collapse
u need a kernel that supports ext3. u can ask one of the guys compiling at the moment if they have time to add an ext3 module for u.

May be a stupid question:
would ext4 work instead? I thought the system partition would use this FS.

filesystem is already ext4

wintel_mac said:
May be a stupid question:
would ext4 work instead? I thought the system partition would use this FS.
Click to expand...
Click to collapse
well the system uses ext4 so it should work, but i'm not sure what u're trying to achieve. i use a 16 gb class 10 formatted fat32
Blumdum said:
filesystem is already ext4
Click to expand...
Click to collapse
He's talking about formatting external sd-card

When I get him right, he has a file that exceeds the 4GB FAT32 limit.
So he looks for an alternative to FAT32, which might be some kind of ext*-FS.

wintel your right!
In the Android-Hilfe Forum someone said the system expect first an vfat partition and then the ext. I think thats wrong cause its not working but somehow it has to go.
Hmm should I write these mount command I postet in the init.rc? Or something else. Would be very nice if you post your ideas!
Thanks

init.rc+ ext3 module/object included in kernel

Hmm okay thats good but how do I use them? So I can read and write to my external sd card with an ext3 or ext2 partition.
Thanks

Come on guys where are the great developers?!

Ok I did a test with busybox inbuilt mount, but I tried only with an image.
Not with a real SD card! This worked for me:
On a linux box:
# dd if=/dev/zero of=/tmp/image bs=1M count=1k
# mkfs.ext4 /tmp/image
Copy file to your phone. Then:
On the phone with terminal:
# mkdir /sdcard/mmnt
# busybox mount -o loop /sdcard/image /sdcard/mmnt
To unmount:
# busybox umount -l /sdcard/mmnt

Anybody tried that?
If I understand u right u puting an image file (ext3/4) on the sd and mount that as a virtual disk. Wouldn't the image file be bound to the same restrictoins as other content on a fat32 file system? Like the 4 gig limit!

YOU WILL LOSE ALL DATA ON YOUR SDCARD IF YOUR FDISK
BACKUP WHATEVER IS ON THERE FIRST!!!
YOU'VE BEEN WARNED
using a photon 4g but....
what i did was get an external sdcard reader writer...
(used ubuntu) and let it mount
fdisk device and DELETE ALL PARTITIONS
write
fdisk again
create a linux primary type 83
type mount and grab the /dev/sdcX value (it was /dev/sdc1 for me)
umount that
then
mkfs.ext3 /dev/sdcX ... ( heres the thing though with cyanogen mod 7 kernel 2.6.32.9 SMP PREEMPT)
had to reboot twice for it to be seen in file manager...
its buggy but it does work for the most part

Reviving an old thread, but I just found that I can format a MicroSD under NTFS and it will work with Paragon's NTFS module. At the very least, my phone will mount the drive. I partitioned and formatted it with ext4 on my Linux machine and it didn't recognize it, but I did have it use the GUID partition table. Hoping to be able to load up some videos to take with me.

ext4 sdcard mount works
FaxXer said:
Hey,
I like to mount my external SD Card as ext3 to support large files. The SD Card is formatted with ext3 but now Android shows only an empty folder.
So i tried to remount the SD:
Code:
mount -o rw,remount -t ext3 /dev/block/vold/197:33 /mnt/sdcard/externald_sd
But it doesnt use something... Does anybody has an idea? Some Example or sthing else?
Greetz
Click to expand...
Click to collapse
The problem is with the shell interpreting the special character ":"
To make it work, first create a symlink to the device node:
Code:
ln -s /dev/block/vold/197\:17 /dev/sd2
Then mount it:
Code:
busybox mount /dev/sd2 /mnt/tmp
Code:
sh-4.1# ls -l /dev/sd2
lrwxrwxrwx root root 2013-11-16 14:45 sd2 -> /dev/block/vold/179:17
sh-4.1# mount|grep sd2
/dev/sd2 /mnt/tmp ext4 rw,relatime,user_xattr,acl,barrier=1,data=ordered 0 0

success mounting ext formatted SD Card on Android
An improvement in technique to mount ext formatted SDcard:
1) be root and open terminal
2) insert the card
3) see the block device and partition names from dmesg
4) mount device to location of choice (create the directory if needed)
Below is an example of an SD card with one ext4 partition on it
Code:
bash-4.1# dmesg | tail | grep mmc
<6>[20230.719541] mmc1: new high speed SDHC card at address 0007
<6>[20230.722803] mmcblk1: mmc1:0007 SD32G 29.3 GiB (ro)
<6>[20230.728352] mmcblk1: p1
bash-4.1# busybox mount /dev/block/mmcblk1p1 /data/mnt/sdcard2

tribh said:
An improvement in technique to mount ext formatted SDcard:
1) be root and open terminal
2) insert the card
3) see the block device and partition names from dmesg
4) mount device to location of choice (create the directory if needed)
Below is an example of an SD card with one ext4 partition on it
Code:
bash-4.1# dmesg | tail | grep mmc
<6>[20230.719541] mmc1: new high speed SDHC card at address 0007
<6>[20230.722803] mmcblk1: mmc1:0007 SD32G 29.3 GiB (ro)
<6>[20230.728352] mmcblk1: p1
bash-4.1# busybox mount /dev/block/mmcblk1p1 /data/mnt/sdcard2
Click to expand...
Click to collapse
Would this work just the same way with i9000?
After this, no more access to the extSD by the Windows PC but only with Ubuntu, right?

tetakpatak said:
Would this work just the same way with i9000?
After this, no more access to the extSD by the Windows PC but only with Ubuntu, right?
Click to expand...
Click to collapse
Since it's generic Linux kernel and busybox functionality it should work on any 'droid. The SDcard device name might be different than in the above example - you will see the correct device and partition names after you insert SDcard and run `dmesg | tail` on the tablet or phone.
(of course your device must be rooted and have busybox...)
Typically Windows is engineered not to recognise anything that does not come from Microsoft, so you will not be able to mount the Linux partition via Windows.

Related

Partition Formatting Through Terminal???

can anyone provide me with the terminal commands to formatting ext2 partitions
mke2fs /dev/block/mmcblk0p2
that's assuming you want to format the 2nd partition of your sd card to ext2
this requires e2fsprogs -- check here if your build doesn't have them
if you want to partition your sd card use SDSplit
if you want to reformat your already existent ext2 partition run this in terminal
su
rm -r /system/sd/*
reboot
nephron said:
rm -r /system/sd/*
Click to expand...
Click to collapse
this does not format the partition -- it removes (deletes / unlinks) all files in that directory or file system mounted there.
fairly substantial difference, but your suggestion may, indeed accomplish what the OP set out to do if that's all they wanted

is there a way to format ext3 partition (app2sd) from g1 phone or from recovery mode

help please .. paragon partitiion is not working
wc326 said:
help please .. paragon partitiion is not working
Click to expand...
Click to collapse
-repeatedly bangs head against wall-
follow this guide but in the beginning where it says use adb and type adb shell
just be in recovery console and hit enter then from there out all the commands should be the same.
if you need more help pm me and i will walk you through the steps
cant; do itr without adb ??
wc326 said:
help please .. paragon partitiion is not working
Click to expand...
Click to collapse
turn phone off and boot into recovery via home+red key
go to console and type in
# mount -o rw /dev/block/mmcblk0p2 /system/sd
# cd /system/sd
# rm -rf /system/sd/*
# reboot recovery
this has been covered many times in many other threads
NOTE:dont type in the # signs. but do however type in the * sign.
go to recovery console hit enter
parted /dev/block/mmcblk0
print
the fourth line in the 'print' command output shows you the total size of sdcard in MB(or GB if you card is large)..mine says: Disk /dev/block/mmcblk0: 7969MB
use this number(XXXXMB) and do some simple math to get the size of your partitions.
7969MB - 32MB linux-swap = 7937MB
7937MB - 500MB ext2 = 7437MB fat32
32MB seems to be alright size for swap, though it can be lower depending on your sdcard size.
500 MB is a good round number for the ext2 partition...no need for more.
that leaves us with 7437MB for fat32 storage.
Click to expand...
Click to collapse
if you do not want linux-swap then do not figure it in
after figuring out the size of your partitions from using the above method type rm 1 (if you only have one partition skip next part) then rm2
then to make the partitions type (numbers are from above example substitute your own in)
mkpartfs primary fat32 0 7437
mkpartfs primary ext2 7437 7937
mkpartfs primary linux-swap 7937 7969 (only if you want linux-swap)
then type print again to see if it worked. if it did you will have 1 and 2 (and 3 if you want linux-swap) come up under all the other info.
then type quit
then to upgrade to ext3 type upgrade_fs
then if apps2sd is automatic in your rom of choice reflash it and you are set. i am too nice tonight.
brian_v3ntura said:
turn phone off and boot into recovery via home+red key
go to console and type in
# mount -o rw /dev/block/mmcblk0p2 /system/sd
# cd /system/sd
# rm -rf /system/sd/*
# reboot recovery
this has been covered many times in many other threads
NOTE:dont type in the # signs. but do however type in the * sign.
Click to expand...
Click to collapse
too bad its not that simple. i think he means partitioning since he references not having adb to do the partitioning in the guide i linked him to. (sorry for assuming your gender OP)
i just want to format my ext3 app2sd partition....
it already has fat32 , ext 3 , and linus swap
really only want to format ext3 partition so i can install my new rom
just wondering can you format ext3 partition without havn'ing to erase fat32 and linus swap
david1171 said:
too bad its not that simple. i think he means partitioning since he references not having adb to do the partitioning in the guide i linked him to. (sorry for assuming your gender OP)
Click to expand...
Click to collapse
actually its clear as day that he means he JUST wants to format his ext.
wc326 said:
is there a way to format ext3 partition (app2sd) from g1 phone or from recovery mode
help please .. paragon partitiion is not working
Click to expand...
Click to collapse
paragon partition is aprogram that will enable you to partition your card on your computer and format.
wc326 said:
i just want to format my ext3 app2sd partition....
it already has fat32 , ext 3 , and linus swap
really only want to format ext3 partition so i can install my new rom
just wondering can you format ext3 partition without havn'ing to erase fat32 and linus swap
Click to expand...
Click to collapse
THIS IS WHAT YOU NEED TO DO to format ext. the other guy must've confused u
turn phone off and boot into recovery via home+red key
go to console and type in
# mount -o rw /dev/block/mmcblk0p2 /system/sd
# cd /system/sd
# rm -rf /system/sd/*
# reboot recovery
NOTE:dont type in the # signs. just push enter when done typing each line. and be sure to type everything exact and carefully.but do however type in the * sign.
errr wrong post

Question about first time Swap setup....

i am interested in creating a SWAP partition on my sd card to increase rom speed, even tho CMs roms are preety fast already. I hav e 8gb CD with about 500mb ext2. now if i use this method to create Swap partition:
Reboot and enter recovery
Enter console
#parted /dev/block/mmcblk0
#print (to verfiy we know what size card we are dealing with, the details should be straight forward)
rm 1
rm 2
mkpartfs primary fat32 0 7200
mkpartfs primary ext2 7200 7700
mkpartfs primary linux-swap 7700 7732
#print (to verify we have the 3 partitions)
i know how to backup music and everything on fat32 to my PC(to later restore) because doing the above will reformat entire card.
my question is do i need to back up my ext2 with all my apps and data on it, and if so how? or will it do everything itself when i reboot my CM rom? i am trying to create this swap partition without really changing everything and without wiping
There are quite a few threads on this, but granted they aren't that easy to find (I'm looking at you, people who name their threads "PLZ HELPPPPP!!")
boot in to recovery and go to the console:
cd sdcard
mkdir app
mkdir app-private
cp /system/sd/app/* /sdcard/app/
cp /system/sd/app-private/* /sdcard/app-private/
All your apk's are now on your Fat partition, copy those two folders to your computer
after you have remade the partitions go back to the recovery console (don't do this in terminal, but you can use adb shell when the phone is in recovery mode). This time we have to mount your new ext partition as rw.
mount -o rw /dev/block/mmcblk0p2 /system/sd
cd /system/sd
mkdir app
mkdir app-private
cp /sdcard/app/* /system/sd/app/
cp /sdcard/app-private/* /system/sd/app-private/
You're done. expect your phone to take a few minutes to boot up as it re-creates the dalvik-cache.

moving apps to sd

it looks a bit different from G1
is this the correct "fstab" conf file to be modified ?
# cat /system/etc/vold.conf
## vold configuration file for Device
volume_sdcard {
## This is the direct uevent device path to the SD slot on the device
media_path /devices/platform/msm_sdcc.2/mmc_host/mmc1
emu_media_path /devices/platform/goldfish_mmc.0/mmc_host/mmc0
media_type mmc
mount_point /sdcard
ums_path /devices/platform/usb_mass_storage/lun0
}
unfortunately i can't find /system/init.rc
hope to inject a standard rom on this device soon !!!
At the moment we cannot get Apps working on the SD Card. Apps2SD won't work.
We are aware of this, and we understand that you'd like these features, but the hackers are currently busy working on exploits to install our own recovery for flashing baked ROMs.
init.rc is located on the top level of the root file system, under /init.rc . You need root to read the said file.
but ...
i'm used to linux and don't understand what we are missing in order to move apps to sd
since i'm root i should be able to do the extra mount of new partition, isn't it ?
actually, as far as understood, if android finds a new partition (either fat or ext) on the sd card it mounts it automagically
I have the same question, too.
Event we can't add extra mount in fstab. We could have the right to mount SD to /data/app, and just copying all apks to SD card, could we??
suoko,
I had done some tests today.
1. I format my sd card into ext3 format and copy all apks in /data/app into my sdcard.
2. mount my sd card on /data/app manually, and change the mode and owner of mounted folder and files.
You can install app into the sd card mounted on /data/app. But once you reboot them, (reset the /data/app), the market will be inconsistent with application list in settings. And I can't unmount the sd card after it mounted on /data/app.
So, I think it is still possible to use sd card for the app installation.
If you have any idea, please let me know... thanks
umount problem
by this "And I can't unmount the sd card after it mounted on /data/app." you mean you can't even access the sd vfat partition with your computer ?
i would only need vfat to be visible via pc not to screw installed apps
gonna try it too in a while
curiosity
as far you know, the install process of apks involves the "unzipping" of apks ?
or it's just a copy from the download apk folder to /data/app ?
what i would try is set a second app folder, this time in /sd/app
where /sd/app is an ext3 partition
so that we can leave main apps in internal memory and put extra apps in sd
the install process of apks is only to copy the app into /data/app folder. It is unzipped when the app is launched first time and cache them in another folder. So, we can found the dalvik-cache in the /data/ folder that the folder it unziped the dex files.
The test I had done is just mount the sd card on "/data/app" folder in android. So, if we want to add a second app folder, we need to change the app loader that I never did it before.
The unmount part means that I can mount the sd card on /data/app but I can't unmount that from /data/app, the message is "failed". The only way to unmount it is to reboot the tattoo. Once removing the sd card from tattoo, I can mount it to PC or tattoo again.
suoko
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This picture is that I mount the sd card(500MB) on /data. The displaying size of flash (that's my sd card) in tattoo is 361MB, sorry for all chinese, you can find the number in the second line from bottom to up.
I don't know where to change the fstab record in tattoo. But it may be possible to write an app who runs at the machine startup and does the "mount" staff before other apps in /data/app executing.
I had one Hero with Apps2SD installed. It mounts the sd card on /system/sd and /data/dalvik-cache. The apps are installed and launched at /system/sd/app. I think it is the same way like mime.
2 install folders in linux ???
you know what ? i guess in linux is not that easy to set up a second install folder.
I think we could sim link a /data/app/app folder to /sd/app but then the install process should do something:
check /data/app folder space left, and in case it's full, install to /data/app/app
Yes, right. That's the way I use. But I mount the sd card directly on /system. This makes android to calculate the left space of my sd card.
Currently, I need to modify the /init.rc to make it mount at the boot. But the /init.rc seems in the ramdisk image, so I can't modify it and store it back. I don't know where the ramdisk image is, it seems in one of partition 0, 1, 2. Any idea??
hello people
have you test this?
http://androidandme.com/2009/08/news/how-to-manually-partition-your-sd-card-for-android-apps2sd/
ok, trying now
formatted my 4gb sd to:
vfat: 3.4 GB
ext2: 508 MB
swap: 32 MB
i found partitions at:
mount -t ext2 /dev/block/mmcblk0p2 /data/myapp
swapon /dev/block/mmcblk0p3
must work on vold.conf now since ext2 on sd is not automatically mounted at /system/sd
another way ...
is create an ext2 img file to be mounted at boot using a loopback device.
no sd partitioning is needed then and the FULL-OF-APPS IMG FILE could be easily moved from one SD to another (aka to another android compatible phone).
modify /system/init.rc to mount an ext2 image on bootup.
http://forum.xda-developers.com/showpost.php?p=3402719&postcount=683
extra ext2 partition creation [750MB] (on ubuntu):
dd if=/dev/zero of=sd.img seek=749999999 bs=1 count=1
mke2fs -F sd.img
mounting it (on android):
[mkdir /data/myapp]
mount -o loop sd.img /data/myapp
current state:
mount: mounting /dev/block/loop0 on /data/myapp failed: Invalid argument
the ext2 loop partition was an end 2008 discussion
http://forum.xda-developers.com/showthread.php?t=463488&page=2
what i think now is extending the /data/app partition with the looped img file.
can we (without lvm) ?
I prefer the second install option
if android detects an extra ext2 partition or an ext2 img file, you can change the default install location in android preferences
Suoko, do your tattoo have /system/init.rc file??
In /init.rc, it doesn't import /system/init.rc. So, we can't use /system/init.rc to mount it.
currently, I need to compile my owned boot.img file. But the compiled file doesn't work. I don't know why. I following the following url to do so: http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images.
Any idea??
BTW, why do we need to mount /dev/loop0?? I just use mount -t ext3 /dev/block/mmcblk0p2 /data/app to do so.
why loop?
Cause you don't have to partition the sd this way.
You just create an img file which can be used as a partition.
Think this:
You have a 4 gb sd and want to change it to store more music/vids/maps with a 16 gb one
You take the file and move it from the old sd to the new one.
You want to increase the img file size?
You create a new larger file?
You create it and move old img file contents to it.
We can probably extends its size some way
ok I see. That's a good idea for expanding purpose.
BTW, I had solved the boot.img problems. It is caused by the wrong version I checked out from repo. I use the correct version to build mkbootimg and everything works.
current state:
trying to mount the /dev/block/mmcblk0p2 on /data at the boot time. but all trials failed.
succesfully mounted looped device
extra ext2 partition creation [350MB] (on ubuntu):
# dd if=/dev/zero of=sd.img seek=349999999 bs=1 count=1
# mke2fs -F sd.img
pushing ext2 partition to android [350MB] (on ubuntu):
# adb push ./sd.img /sdcard/sd.img
mounting it (on android) (DO NOT RUN BUSYBOX !!!):
# su
# export LD_LIBRARY_PATH=/system/lib
# export PATH=/system/bin
# insmod /data/local/bin/tattoo-hack.ko
# mount -o rw,remount /dev/block/mtdblock5 /data
# mount -o rw,remount /dev/block/mtdblock3 /system
# mkdir /data/myapp
# mount -o loop -t ext2 /sdcard/sd.img /data/myapp/
[now run busybox]
# /data/local/bin/sh
# df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 93.0M 0 93.0M 0% /dev
tmpfs 4.0M 0 4.0M 0% /sqlite_stmt_journals
/dev/block/mtdblock3 150.0M 135.7M 14.3M 90% /system
/dev/block/mtdblock5 165.1M 148.1M 17.0M 90% /data
/dev/block/mtdblock4 150.0M 3.7M 146.3M 2% /cache
/dev/block//vold/179:1 3.7G 3.5G 223.5M 94% /sdcard
/dev/block/loop0 323.2M 2.0M 304.5M 1% /data/myapp
re: boot.img problems
huchengtw said:
ok I see. That's a good idea for expanding purpose.
BTW, I had solved the boot.img problems. It is caused by the wrong version I checked out from repo. I use the correct version to build mkbootimg and everything works.
current state:
trying to mount the /dev/block/mmcblk0p2 on /data at the boot time. but all trials failed.
Click to expand...
Click to collapse
are you reading mainfram3 tips ?
http://forum.xda-developers.com/showthread.php?t=641731
i'm gonna look at android install process and SD settings

[Q] [HELP] Swap sdcard with sdcard-ext

I've edited vold.fstab so that sdcard and sdcard-ext are swapped. But this doesn't work on my XT894. Nothing happens in my case.
Then I found this topic.
In short, you run a script containing:
Code:
busybox mount -o remount,rw /
busybox mount -t vfat -o umask=0000 /dev/block/vold/179:97 /mnt/sdcard
busybox mount -t exfat -o umask=0000 /dev/block/vold/179:97 /mnt/sdcard
if busybox mount | busybox grep vold/179:97; then
busybox mount -o bind /data/media /mnt/extSdCard
fi
After running this script the result is that both sdcard and scard-ext are in fact pointing to my external 32GB card. So in a way I'm happy. Now I can install games and all navigational maps without any hassle. But, I would like my internal 8GB of storage back. To do so I take it "something" has to be mounted to /mnt/sdcard-ext.
My Linux/Unix is of n00b quality so here I am asking for help :cyclops:
I've tried adding these two lines:
busybox mount -t vfat -o umask=0000 /dev/block/vold/179:1 /mnt/sdcard-ext
busybox mount -t exfat -o umask=0000 /dev/block/vold/179:1 /mnt/sdcard-ext
Hoping 179:1 pounted to the internal sdcard and /mnt/sdcard-ext would mount it at exactly that. But it didn't work.
Can anyone explain to me what these commands do? Why vfat and exfat? Is this done so that you always mount the correct filesystem? And what about the vold/179:xx? Does anyone know which one points to the internal sdcard on an XT894 running ICS?
Trust me, I've Googled all I can. I have tried several options, multiple scripts, but my lack of Linux/Unix knowledge is killing me.
Edit:
When I connect as USB Mass storage I get my internal 8GB back. It is accessible on the laptop. When I switch back to MTP it shows a different directory (maybe due to vold/179:1 !?). After I re-run the script sdcard is back to my external 32GB. For now this will do.
I will update later. Sygic is downloading 2GB of data. After that I will switch back and forth between USB M / MTP with and without running the script.
Edit 2
After I connect as MTP, Internal Storage seems to be pointing to an unknown space. There is an .android directory which I am unable to find on the phone.
When I switch to USBMS (from MTP) it seems to switch back to the original setup, sdcard 8GB and sdcard-ext 32GB.
When I disconnect the USB cable everything is back to normal. But, all I need to do is re-run the script and sdcard points back to my external SD.

Categories

Resources