Mount ext4 formatted mircosd - Shield Android TV Q&A, Help & Troubleshooting

I have a rooted Shield but I can't figure out how to mount the microsd card.
I see that the file system is supported but I don't see where the device is listed.
Usually I would look for mmcblk or something.
[email protected]:/ $ cat /proc/filesystems
ext3
ext2
ext4

Related

Creating Android's very own SDCard filesystem

If I were to create a 1.5gb fakesd.img ext2 file
done once, on computer
dd if=/dev/zero of=fakesd.img bs=1048576 count=1536
mke2fs -F fakesd.img
--------
done in rootfs-init
losetup /dev/block/loop2 /sdcard/fakesd.img
mount -t ext2 -o noatime,nodiratime /dev/block/loop2 /fakesd
change " symlink /mnt/sdcard /sdcard/ " in rootfs-init.rc
symlink /mnt/sdcard /fakesd/
probably want to avoid changing the external path from /mnt/sdcard/ to anything.. for compatibility sake..
I have my windows stuff on my card. I want android to index as little as possible yet still be able to access my sd card at /sdcard.. Will this work?
I have a feeling that someone is just going to tell me to partition card. I don't feel like it right now..
Partition the card Just kidding, but I like your thinking.
Trying to test it out post boot.. My router has more command line functionality, thanks Google.

[fix new sdcard] little Solution (Partitioning)

hi
I have two 8GB class4 memory card but when I'm just a partition're doing very bad work
Android is reset
apps are broken
High and low speed is
And ...
But when a 2GB partition, I just work very well
Benchmarking partition is much better!
no more problem in android!
So I decided two partitions 2 and 6 GB and the second partition so I just do mount
Method:
1- Memory partitioning (first partition 2gb fat32)
2- copy android in first partition & run it
3- in android terminal type:
Code:
ls /dev/block/m*
or adb
Code:
adb shell ls /dev/block/m*
result like this:
Code:
/dev/block/mmcblk0
/dev/block/mmcblk0p1
/dev/block/mmcblk0p2
/dev/block/mmcblk0p3
Partition testing can be yours for the mount
1- make a folder (not in /sdcard & /mnt/sdcard)
Code:
mkdir /mnt/sd2
now test (for fat32): (just change mmcblk0p2)
Code:
mount -t vfat -o fmask=0000,dmask=0000,rw,flush,noatime,nodiratime /dev/block/mmcblk0p2 /mnt/sd2
(for ext2)
Code:
mount -t ext2 -o noatime,nodiratime /dev/block/mmcblk0p2 /mnt/sd2
Now the partition should be on the /mnt/sd2 mounted
and you can mount in boot
backup /init
open init and past mount cammand below this line :
Code:
PATH=/sbin:/system/sbin:/system/bin:/bin:/system/xbin:/system/xbin/bb:/data/local/bin
now we have auto mount partition
but we have one problem! we should link /mnt/sd2 > /mnt/sdcard
Who s the solution?
interesting idea. will try out.

Android Batch File to Partition SD Card [11 Jun 2012]

Android Batch File to Partition SD Card
This batch command file invokes the /sbin/parted and /sbin/tune2fs tools hosted by ClockWorkMod (CWM) Recovery 5.0.2.0 to control partitioning of your SD card for a variety of purposes, some of which are listed below.
It is a good idea to review the command line options and parameters of the parted and tune2fs tools: On your phone (for example, via computer-enabled ADB or terminal emulator), get root and enter:
# /sbin/parted --help
# /sbin/tune2fs --help
I decided to make this a separate thread for a number of reasons:
Streamline the process of making room for second ROM in a dual boot configuration (see http://forum.xda-developers.com/showthread.php?t=1651356 ). These commands can theoretically be rolled into a flashable zip to almost fully automate a dual-boot install of fixed ROMs, e.g. CM9 and CM7.
My Dual Boot threads have “sensory overload” written all over them
The amount of material presented here is probably enough to warrant a separate thread
This is an Android-friendly alternative to GParted/MiniTool. For example there is no need to pull SD card, partition and reinsert. Of course, GParted has the pleasant GUI and gives you a chance to review your changes before committing, whereas the Android “parted” tool is highly utilitarian.
Batch commands are quickly and easily modified to create/remove/adjust partitions. The general consensus is that for large files, ext3 R/W speeds are faster than those of FAT32. And ext3[4] is more stable and can handle files exceeding the maximum 4GB allowed by FAT32.
Batch commands are easily modified to perform customizations other than dual boot
Some users may wish to host their entire system on SD card: ROM, music, pictures, movies etc.
Some users may wish to return their SD cards to a traditional single-boot state by running a subset of these batch commands
That said, I strongly advise that you NOT run these commands UNLESS you are comfortable with ALL of the following:
1. /sdcard (FAT32) and ALL subdirectories copied to /emmc/sdcard-backup. Ask yourself: Do I have enough space left on my 10GB emmc partition to host a full backup of /sdcard? AND, will there be enough room on the /sdcard filesystem to restore this backup AFTER downsizing my SD card's FAT32 partition?
2. Any existing ext* partitions of SD card are blown away, for example those generated by a previous dual boot zip install. In other words, you lose /system, /cache and /data from an existing sdcard-based ROM.
3. You MAY lose all data on your (backed-up) FAT32 partition depending on what boundaries were used for resizing.
Note that I do not include a command to push /emmc/sdcard-backup back onto SD card. That is because:
There may not be enough room on /sdcard after a FAT32 downsize, and
There may be a data conflict when flashing a different dual boot configuration as opposed to an updated one. But at least there is a full backup of /sdcard FAT32 --- assuming emmc has enough room to host it.
Presently there is no logic to detect the storage limits of the /emmc and /sdcard filesystems. I will leave that to you.
SO... if for ANY reason you are NOT comfortable with the potential changes outlined above, I recommend that you please STOP HERE and consider researching this topic further until you are comfortable.
For those willing and able to give this a try, I strongly recommend first performing an ADB-assisted run (i.e. with a computer hosting Android SDK Platform Tools) using an SD card with at least 4GB open (to be safe) AND with enough room on emmc to host a FULL backup of your entire /sdcard filesystem (/sdcard and all its subdirectories).
Fully charge your battery! CWM draws a lot of current, even if nothing else is running.
Boot phone to CWM
Connect phone to computer
Launch ADB shell to access phone
# adb shell (can do this on any ADB-enabled machine)
Get root (enter “su” at phone shell command prompt) and copy/paste/enter each and every command (those not prefixed by "echo") in your computer's command window:
Code:
#! /bin/sh
echo "Android batch script to create ext partitions for SD card-based ROM"
echo
echo "First unmount all filesystems of primary (emmc) ROM"
umount /system > /dev/null 2>&1
umount /cache > /dev/null 2>&1
umount /data > /dev/null 2>&1
echo
echo "Mount external (sdcard) and internal (emmc) memory"
mount /sdcard > /dev/null 2>&1
mount /dev/block/mmcblk0p18 /emmc > /dev/null 2>&1
echo
echo "Create sdcard-backup directory on emmc with current date and time"
echo "Recommend delete any unnecessary backups of sdcard at this point"
bkdir="sdcard-backup-`date +%d-%b-%Y-%H%M%S`"
mkdir /emmc/$bkdir > /dev/null 2>&1
echo
echo Backup directory: /emmc/$bkdir
echo
echo "Press ENTER to continue..." ; read
echo
echo "Backing up contents of sdcard FAT32 to emmc"
cp -a /sdcard/* /emmc/$bkdir/
echo
echo Done...
ls -ld /emmc/$bkdir
echo
echo "Unmount internal and external memory"
umount /emmc > /dev/null 2>&1
umount /sdcard > /dev/null 2>&1
echo
echo "Show existing partition map of SD card"
parted /dev/block/mmcblk1 print
echo
echo "Press ENTER to continue..." ; read
echo
echo "Delete any existing ext* partitions and show results"
parted /dev/block/mmcblk1 rm 4 > /dev/null 2>&1
parted /dev/block/mmcblk1 rm 3 > /dev/null 2>&1
parted /dev/block/mmcblk1 rm 2 > /dev/null 2>&1
parted /dev/block/mmcblk1 print
echo
echo "Press ENTER to continue..." ; read
echo
echo "Resize START/STOP values MUST be expressed in MB"
echo "Downsize FAT32 and generate new ext2 partitions"
echo "Resize START/STOP values MUST be expressed in MB!"
echo "This example shows TYPICAL repartitioning of 16GB card..."
parted /dev/block/mmcblk1 resize 1 4.194 10700
parted /dev/block/mmcblk1 mkpartfs primary ext2 10.7GB 11.1GB
parted /dev/block/mmcblk1 mkpartfs primary ext2 11.1GB 11.8GB
parted /dev/block/mmcblk1 mkpartfs primary ext2 11.8GB 13.9GB
echo
echo "Upgrade from ext2 to ext3"
tune2fs -j /dev/block/mmcblk1p2
tune2fs -j /dev/block/mmcblk1p3
tune2fs -j /dev/block/mmcblk1p4
echo
echo "Review changes"
parted /dev/block/mmcblk1 print
echo
echo "Press ENTER to continue..." ; read
echo
echo "Final review. Mount SD card ROM filesystems"
mount /dev/block/mmcblk1p2 /system > /dev/null 2>&1
mount /dev/block/mmcblk1p3 /cache > /dev/null 2>&1
mount /dev/block/mmcblk1p4 /data > /dev/null 2>&1
echo
echo "Show used and available space (in MB) on all mounted filesystems"
df -m
echo
echo "Unmount SD card ROM filesystems"
umount /system
umount /cache
umount /data
echo
echo "Remount emmc ROM /cache (CWM mounts this by default)"
mount /cache > /dev/null 2>&1
echo
echo "Done. Can now (if necessary) wipe /cache and /data for primary ROM and flash dual boot zip"
echo
And now ... here are unedited results of a successful batch run made on 11 Jun 2012 at 1630 PDST
Code:
~ # sh /tmp/part-sdc.sh
Android batch script to create ext partitions for SD card-based ROM
First unmount all filesystems of primary (emmc) ROM
Mount external (sdcard) and internal (emmc) memory
Create sdcard-backup directory on emmc with current date and time
Recommend delete any unnecessary backups of sdcard at this point
Backup directory: /emmc/sdcard-backup-11-Jun-2012-233034
Press ENTER to continue...
Backing up contents of sdcard FAT32 to emmc
Done...
drwxrwxrwx 16 root root 8192 Jun 11 23:36 /emmc/sdcard-backup-11-Jun-2012-233034
Unmount internal and external memory
Show existing partition map of SD card
Model: SD SU16G (sd/mmc)
Disk /dev/block/mmcblk1: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 4194kB 10.7GB 10.7GB primary fat32 lba
2 10.7GB 11.1GB 395MB primary ext2
3 11.1GB 11.8GB 707MB primary ext2
4 11.8GB 13.9GB 2097MB primary ext2
Press ENTER to continue...
Delete any existing ext* partitions and show results
Model: SD SU16G (sd/mmc)
Disk /dev/block/mmcblk1: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 4194kB 10.7GB 10.7GB primary fat32 lba
Press ENTER to continue...
Resize START/STOP values MUST be expressed in MB
Downsize FAT32 and generate new ext2 partitions
Resize START/STOP values MUST be expressed in MB!
This example shows TYPICAL repartitioning of 16GB card...
Information: You may need to update /etc/fstab.
Information: You may need to update /etc/fstab.
Information: You may need to update /etc/fstab.
Information: You may need to update /etc/fstab.
Upgrade from ext2 to ext3
tune2fs 1.41.6 (30-May-2009)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.
tune2fs 1.41.6 (30-May-2009)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.
tune2fs 1.41.6 (30-May-2009)
Creating journal inode: done
This filesystem will be automatically checked every 30 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.
Review changes
Model: SD SU16G (sd/mmc)
Disk /dev/block/mmcblk1: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 4194kB 10.7GB 10.7GB primary fat32 lba
2 10.7GB 11.1GB 395MB primary ext3
3 11.1GB 11.8GB 707MB primary ext3
4 11.8GB 13.9GB 2097MB primary ext3
Press ENTER to continue...
Final review. Mount SD card ROM filesystems
Show used and available space (in MB) on all mounted filesystems
Filesystem 1M-blocks Used Available Use% Mounted on
tmpfs 408 0 408 0% /dev
/dev/block/mmcblk1p2 353 8 326 2% /system
/dev/block/mmcblk1p3 632 16 582 3% /cache
/dev/block/mmcblk1p4 1874 32 1742 2% /data
Unmount SD card ROM filesystems
Remount emmc ROM /cache (CWM mounts this by default)
Done. Can now (if necessary) wipe /cache and /data for primary ROM and flash dual boot zip
~ #
All you brave testers out there, please let me know if you see anything amiss. Thanks!
Disclaimer
Standard disclaimers apply. In short, I am not responsible for any harm you or your phone may incur by using any or all of this material.
Enjoy.
References
http://androidos.in/2009/11/manually-partition-sd-card-for-android/
http://www.gnu.org/software/parted/manual/html_chapter/parted_2.html
http://linux.die.net/man/8/tune2fs
Successfully Installed Dual Boot After Running Batch SD Card Partitioner
Shortly after running Android Batch SD Card Partitioner, I successfully flashed Dual Boot Zip v1.4: http://forum.xda-developers.com/showthread.php?t=1651356 featuing AOKP+Aroma_37a (emmc) and CM7 RC3 (sdcard)
don't know if that is the correct place
Hello,
Thanks for your patch, I am facing an issue with my Atrix (Orange UK), I have scrued up my internal storage, here I have posted once a Question but got no reply from nobody (POST).
Am I right to ask here, or is it wrong place too
Thanks and Thumbs up for the nice work
Ammar
Arwany said:
Hello,
Thanks for your patch, I am facing an issue with my Atrix (Orange UK), I have scrued up my internal storage, here I have posted once a Question but got no reply from nobody (POST).
Am I right to ask here, or is it wrong place too
Thanks and Thumbs up for the nice work
Ammar
Click to expand...
Click to collapse
Hello Ammar,
Please see my answer here: http://forum.xda-developers.com/showthread.php?p=27311205#post27311205
I hope this helps
sendust7

USB External hard drive on Nook Touch?

Hi everyone,
I'm trying to figure out if I can get my nook to be the ultimate upgrade on a 160gb Ipod, that is to get it to work with an external battery powering a 200gb or higher 2.5" external hard drive.
and then using audio through USB.
Do you know if that is theorically possible? (power wouldnt be an issue with external power but maybe the nook just can't recognize any external storage beyond a certain capacity)
the info is probably out there somewhere but I'm sad to say I don't know enough to understand most of what I find on the board (yet)
please tell me it's possible !
cheers
I don't see why it wouldn't work.
USB mass storage should all be the same.
You'll need to mount it.
I'll have to borrow a 2.5" disk in a USB enclosure and try it today.
Hi Renate,
Great! thanks for your reply
and wow! thanks for looking into this!
I'll have to wait till next month to give it a try, the idea is to build some sort of portable dock (using the slots meant for the nook cases) with battery/USB hub/hard drive and jack audio output so I can use the nook+dock as a unit, just the dock as music library on my laptop or just the nook for reading.
I've been dreaming of an e-ink computer for some time, the three main things I needed were a keyboard, and sound output (both of which you already took care of, and mass storage) if you tell me it works I'll post a guide on how to get that done.
I have a 2.5" disk out of an old laptop in a USB.
It has 3 partitions on it.
Yes, it works fine on FAT, FAT32 & NTFS
If you use this a lot, you might want to put a mkdir for the mount point in init.rc before the root goes ro.
This is how you have to mount it if you have to do all the steps.
Code:
mount -o rw,remount rootfs /
mkdir /usb
mount -t vfat /dev/block/uba1 /usb
Change vfat to ntfs if applicable.
Thanks a lot Renate,
I don't quite understand everything yet, but I'll get there (there's plenty to read on this board) don't bother explaining, if you start you'll never see the end of it.
Now I suppose the big question is : can the nook touch take a 300gb itunes library? I'll get back to you on that
cheers
I tried this script
mount -o rw,remount rootfs /
mkdir /usbdisk
mount -o rw,iocharset=utf8 -t vfat /dev/block/uba1 /usbdisk
Click to expand...
Click to collapse
for fat32 hard disks - 500 and 1000gb and work perfect
but for ntfs
mount -o rw,remount rootfs /
mkdir /usbdisk
mount -o rw,iocharset=utf8 -t ntfs /dev/block/uba1 /usbdisk
Click to expand...
Click to collapse
script works without errors but usbdisk folder remained empty.
where I do mistake? please advice.
Try without any of the options.
It may be that with the default driver NTFS can only be mounted read-only.
Code:
mount -t ntfs /dev/block/uba1 /usbdisk
Renate NST said:
...
If you use this a lot, you might want to put a mkdir for the mount point in init.rc before the root goes ro.
This is how you have to mount it if you have to do all the steps.
Code:
mount -o rw,remount rootfs /
mkdir /usb
mount -t vfat /dev/block/uba1 /usb
Change vfat to ntfs if applicable.
Click to expand...
Click to collapse
Does this just work on top of a plain rooted 1.1.2, or do I also need some additional apk?
It should work on anything.
Renate NST said:
It should work on anything.
Click to expand...
Click to collapse
What I meant to ask was if the above process (to mount an external drive on the NST) was contingent on the prerequisite "to first get my NST to support USB Host Mode"?
Yes, to get a disk drive working you need to somehow get the Nook to be a USB host.
The straight forward way is to install verygreen & mali100's uImage and then use my UsbMode.apk to switch it into host mode.
This is all detailed in another thread: http://forum.xda-developers.com/showthread.php?t=1457971
You'll need a powered hub if you want to run a disk drive.
If you know what you are doing and you use a back-powering hub you can get the Nook to kick into USB host mode without any modifications or apps.
Oh, yeah, of course an OTG adapter is required for any of this.
Thanks for reply/pointer.
I found the usb-host-mt-pack_0.1.zip.
I assume I should replace the NullKbd-1.1.apk and UsbMode-1.2.apk in the zip file with their corresponding newer versions NullKbd-1.2.apk and UsbMode-1.6.apk?
Renate NST said:
Try without any of the options.
It may be that with the default driver NTFS can only be mounted read-only.
Code:
mount -t ntfs /dev/block/uba1 /usbdisk
Click to expand...
Click to collapse
Renate thanks for advice. I tried without any of the options, but without luck. usbdisk folder still remaining blank. Please any more suggestions.
You probably have multiple partitions on the drive.
Try:
Code:
busybox fdisk -l /dev/block/uba1
Then you'll have to do something like:
Code:
mount -t ntfs /dev/block/uba1p1 /usb
Renate NST said:
Try without any of the options.
It may be that with the default driver NTFS can only be mounted read-only.
Code:
mount -t ntfs /dev/block/uba1 /usbdisk
Click to expand...
Click to collapse
Renate NST said:
You probably have multiple partitions on the drive.
Try:
Code:
busybox fdisk -l /dev/block/uba1
Then you'll have to do something like:
Code:
mount -t ntfs /dev/block/uba1p1 /usb
Click to expand...
Click to collapse
I get this print with error:
***********************
# busybox fdisk -l /dev/block/uba1
busybox fdisk -l /dev/block/uba1
Disk /dev/block/uba1: 500.1 GB, 500104691712 bytes
255 heads, 63 sectors/track, 60800 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/uba1p1 ? 120528 234814 918008208 4f Unknown
Partition 1 does not end on cylinder boundary
/dev/block/uba1p2 ? 119381 153271 272218546+ 73 Unknown
Partition 2 does not end on cylinder boundary
/dev/block/uba1p3 ? 113202 147075 272087568 2b Unknown
Partition 3 does not end on cylinder boundary
/dev/block/uba1p4 ? 177064 177067 27487 61 Unknown
Partition 4 does not end on cylinder boundary
Partition table entries are not in disk order
# mount -t ntfs /dev/block/uba1p1 /usbdisk
mount -t ntfs /dev/block/uba1p1 /usbdisk
mount: No such file or directory
**********************
p.s. In Windows this disk have one ntfs partition only.
Hmm, I tried fdisk on an old 256M flash drive that I had and got similar gobble-dee-gook.
It mounted correctly though without a partition number.
Renate NST said:
Hmm, I tried fdisk on an old 256M flash drive that I had and got similar gobble-dee-gook.
It mounted correctly though without a partition number.
Click to expand...
Click to collapse
Now tried sd 256mb ntfs via card reader. In fdisk - same gibberish output. mount work w/o errors but usbdisk dir still empty (on sd were few files).
Renate NST said:
...
If you use this a lot, you might want to put a mkdir for the mount point in init.rc before the root goes ro.
This is how you have to mount it if you have to do all the steps.
Code:
mount -o rw,remount rootfs /
mkdir /usb
mount -t vfat /dev/block/uba1 /usb
Change vfat to ntfs if applicable.
Click to expand...
Click to collapse
Is there another way to auto-create a persistent mount point without fiddling with unpacking/repacking uRamdisk to apply the snippet to its init.rc copy?
digixmax said:
Is there another way to auto-create a persistent mount point ...
Click to expand...
Click to collapse
Certainly. Just do it in init.rc before the root is mounted read-only.
Code:
[b]mkdir /usb 0777 system system[/b]
mount rootfs rootfs / ro remount
(init.rc is in uRamdisk in the boot partition.
use bootutil.exe to extract and replace the init.rc)

MicroSD mmcblk1p1 Ext4 mount, set permission, vold

I've an SM-N910F with rooted TouchWiz 6.0.1 XXS1DPK1 and I'm finding big problems on properly mount (or better to say "manage") my Ext4 formatted MicroSD.
I run:
Code:
mkdir /data/media/extSdCard
chown root:sdcard_rw /data/media/extSdCard
chmod 775 /data/media/extSdCard
mount -w -t ext4 /dev/block/mmcblk1p1 /data/media/extSdCard
The card is now mounted and accesible but vold daemon still can't see it. Without vold maybe the volume is unknown to all apps and effectively unusable out of just file transfer ...
Is there a way to force vold daemon to manage it?? Or am I doing some mistake on mounting properly my Ext4 formatted MicroSD?
Thanks for helping ...

Categories

Resources