Linux Deploy ext4 and Adoptable Storage - Moto G 2015 Q&A, Help & Troubleshooting

I created an issue ( - github.com/meefik/linuxdeploy/issues/820 - and asked on Android Enthusiasts - android.stackexchange.com/questions/179324/linux-deploy-ext4-and-adoptable-storage) in the Linux Deploy project.
I have a smartphone with the following settings:
{
"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"
}
And the following SD:
Ok, it's not a good SD, but that's what I have for today...
I was using SD as an extension to internal storage, and I was able to store applications and files there normally.
I would like to use Kali Linux through Linux Deploy (if there is no other way), but the system can only have a maximum of 4GB (github.com/meefik/linuxdeploy/issues/395#issuecomment-177475166) per account of the created .img file and the format of the card, which is very little in my opinion.
So I tried to follow this tutorial (github.com/meefik/linuxdeploy/wiki/Installing-Kali-Linux-Guide) for an installation with more space for the operating system.
I created a three partitions:
Fat32 to continue using on my smartphone as before (with less space of course);
An additional swap...
And an ext4 for the operating system installation.
I've ejected the ext4 partition to install Kali Linux. And everything worked perfectly!
Well... Almost everything!
Kali Linux was working just the way I wanted it, but when I tried to use my smartphone as before, I realized that I could no longer transfer my applications to the fat32 partition I created for it.
The option to transfer applications to SD is no longer displayed.
I tried to transform part of SD as Adoptable Storage again but do it directly from the smartphone, formatting all the storage, undoing all created partitions.
I then followed this answer (android.stackexchange.com/a/146529/228277 - both with adb, and with Root Essentials). Which again undid my partitions. But I re-did it again following the following steps:
Format everything and use 50% for Adoptable Storage (by adb or Root Essentials).
Remove the SD from the smartphone and insert it into the computer to create the other partitions (ext4) with MiniTool (minitool.com/partition-manager/partition-wizard-home.html) because Android Partition Tool (AParted - play.google.com/store/apps/details?id=com.sylkat.AParted) was not able to do this.
Ok, now I can transfer my applications to SD, and I also have the ext4 partition for installing Kali Linux, but now Linux Deploy can not see this partition mounted or ejected by Android.
Monted:
Code:
[12:36:31] >>> status
[12:36:32] Device: MotoG3
[12:36:32] Android: 7.1.2
[12:36:32] Architecture: armv7l
[12:36:32] Kernel: 3.10.49-MPI24.241-2.35-1-g4023d70
[12:36:32] Memory: 38/898 MB
[12:36:32] Swap: 273/511 MB
[12:36:32] SELinux: yes
[12:36:32] Loop devices: yes
[12:36:32] Support binfmt_misc: no
[12:36:32] Supported FS: ext2 ext3 ext4 f2fs fuseblk vfat
[12:36:32] Installed system: unknown
[12:36:32] Status of components:
[12:36:32] :: extra/dbus ... stopped
[12:36:32] :: extra/ssh ... stopped
[12:36:32] :: graphics/vnc ... stopped
[12:36:32] Mounted parts:
[12:36:32] ...nothing mounted
[12:36:32] Available mount points:
[12:36:33] * /system 0.9/2.2 GB (ext4)
[12:36:33] * /data 4.5/11.8 GB (f2fs)
[12:36:33] * /cache 0.2/0.2 GB (ext4)
[12:36:33] * /fsg 0.0/0.0 GB (ext4)
[12:36:33] * /firmware 0.0/0.0 GB (ext4)
[12:36:33] * /persist 0.0/0.0 GB (ext4)
[12:36:33] * /mnt/runtime/default/emulated 4.5/11.8 GB (sdcardfs)
[12:36:33] * /storage/emulated 4.5/11.8 GB (sdcardfs)
[12:36:33] * /mnt/runtime/read/emulated 4.5/11.8 GB (sdcardfs)
[12:36:33] * /mnt/runtime/write/emulated 4.5/11.8 GB (sdcardfs)
[12:36:33] * /mnt/media_rw/f86f8583-23fb-d201-f063-858323fbd201 13.0/13.7 GB (ext4)
[12:36:33] * /mnt/runtime/default/f86f8583-23fb-d201-f063-858323fbd201 13.0/13.7 GB (sdcardfs)
[12:36:33] * /storage/f86f8583-23fb-d201-f063-858323fbd201 13.0/13.7 GB (sdcardfs)
[12:36:33] * /mnt/runtime/read/f86f8583-23fb-d201-f063-858323fbd201 13.0/13.7 GB (sdcardfs)
[12:36:33] * /mnt/runtime/write/f86f8583-23fb-d201-f063-858323fbd201 13.0/13.7 GB (sdcardfs)
[12:36:33] * /mnt/expand/bd43c04c-2500-40bd-9325-1de5ae577eb6 14.2/14.8 GB (f2fs)
[12:36:33] Available partitions:
[12:36:34] ...no available partitions
[12:36:34] <<< status
Ejected:
Code:
[12:39:49] >>> status
[12:39:49] Device: MotoG3
[12:39:49] Android: 7.1.2
[12:39:49] Architecture: armv7l
[12:39:49] Kernel: 3.10.49-MPI24.241-2.35-1-g4023d70
[12:39:49] Memory: 42/898 MB
[12:39:49] Swap: 216/511 MB
[12:39:49] SELinux: yes
[12:39:49] Loop devices: yes
[12:39:49] Support binfmt_misc: no
[12:39:49] Supported FS: ext2 ext3 ext4 f2fs fuseblk vfat
[12:39:49] Installed system: unknown
[12:39:49] Status of components:
[12:39:49] :: extra/dbus ... stopped
[12:39:49] :: extra/ssh ... stopped
[12:39:49] :: graphics/vnc ... stopped
[12:39:49] Mounted parts:
[12:39:49] ...nothing mounted
[12:39:49] Available mount points:
[12:39:49] * /system 0.9/2.2 GB (ext4)
[12:39:49] * /data 4.5/11.8 GB (f2fs)
[12:39:50] * /cache 0.2/0.2 GB (ext4)
[12:39:50] * /fsg 0.0/0.0 GB (ext4)
[12:39:50] * /firmware 0.0/0.0 GB (ext4)
[12:39:50] * /persist 0.0/0.0 GB (ext4)
[12:39:50] * /mnt/runtime/default/emulated 4.5/11.8 GB (sdcardfs)
[12:39:50] * /storage/emulated 4.5/11.8 GB (sdcardfs)
[12:39:50] * /mnt/runtime/read/emulated 4.5/11.8 GB (sdcardfs)
[12:39:50] * /mnt/runtime/write/emulated 4.5/11.8 GB (sdcardfs)
[12:39:50] * /mnt/expand/bd43c04c-2500-40bd-9325-1de5ae577eb6 14.2/14.8 GB (f2fs)
[12:39:50] Available partitions:
[12:39:50] ...no available partitions
[12:39:50] <<< status
Is it possible to do what I'm trying? Use half the SD as Adoptable Storage and the rest as ext4 to install Kali Linux? Am I forgetting to set something up?
Click to expand...
Click to collapse

Related

[Q] P3113 Suggestions for reclaiming the 537MB HIDDEN partition for Internal Storage

Do any of you have any suggestions on how to do this? I ran parted via ADB on my 8GB tablet's internal storage (/dev/block/mmcblk0)
Code:
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 4194kB 25.2MB 21.0MB ext4 EFS
2 25.2MB 27.3MB 2097kB SBL1
3 27.3MB 29.4MB 2097kB SBL2
4 29.4MB 37.7MB 8389kB PARAM
5 37.7MB 46.1MB 8389kB KERNEL
6 46.1MB 54.5MB 8389kB RECOVERY
7 54.5MB 789MB 734MB ext4 CACHE
8 789MB 810MB 21.0MB MODEM
9 810MB 2278MB 1468MB ext4 FACTORYFS
10 2278MB 7281MB 5004MB ext4 DATAFS
11 7281MB 7818MB 537MB ext4 HIDDEN
I knew more or less what each partition did but was curious about "HIDDEN" so I mounted it to see what was there. All that was in that partition is Retail.apk (its the "Demo Mode" that runs when the tablet is sitting at Best Buy) and the sample multimedia files used in the demo. In total these files were less than 100MB and the multimedia already copied on the /sdcard/Samsung directory in the main storage.
537MB is quite significant considering how littte space there is on this 8GB model? The next time I do a factory reset can I just delete "HIDDEN" and DATAFS and create a new larger DATAFS partition with no ill effects? I'm thinking this would work because they are contiguous and enlarging DATAFS would not change its partition number so the mounting scripts during the boot process wouldn't get thrown off.
Are there any other suggestions on how I could reclaim 537 MB of internal storage?
I've done it successfully. delete p9,p10,p11 and recreate them in new size.
parted can only create ext2 partition, need tune2fs and e2fsck to convert ext2 to ext4 fs.
first, use tar to backup the system and data partition(p9,p10) to external_sd,
after repartition can restore them.
If you want to do it, must be careful, it's VERY DANGEROUS, maybe brick your device.
my device:Samsung Galaxy Tab2 P3110, CM 10.1.3RC2
{
"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"
}
For more detail you can have a look of this, it's in chinese and for kindle fire, but i think the commandline code you can understand.
http://bbs.imp3.net/thread-10515210-1-1.html
Have you succeeded in using all memory? I repartitioned device, in clockworkmod everything is fine, but I can't access all the space from system. For DATAFS I have now 5480MB instead of 5004MB, but system says me, that internal storage is still ~5GB with only 4,5GB available. I even hard resetted device - nothing changed. How to make system see all space?
it seems that all the memory of DATAFS are ok for my p3110, have a look of the snapshots below.
i use cm 10.1.3, i dont know which rom do you flash, stock rom?
sorry it is in chinese, but you could see the numbers of memory.
No problem with language, everything is clear . I'm using stock odexed Samsung 4.1.2 rom with my own changes for tabletui and a couple of others (like editing systemui.apk). I guess, that Samsung gives fixed amount of space for /data and I haven't found where it is. Anyway, thank you for idea
probably obvious to most, but don't delete all those partitions! i was in the middle of surgery via adb, and stupidly typed
Code:
du -hs
and the device rebooted.
http://forum.xda-developers.com/galaxy-tab-2/help/argh-deleted-internal-partitions-boot-t2912866

[GUIDE]How To Dual Boot Two Roms almost ANY Device

Ever wanted to try a new rom without having to waste our time on making backups then trying the rom and then again restoring it, and if another rom pleases you at the moment , you'll have to perform the same drill again and again ... Well Now NO MORE of this frustrating business.
Here i present you my very own method of Dual Booting almost ANY two roms you like on YOUR device.
But make sure to try at your risk.. as per DoomLord many devices can be hardbricked too.
Do Not use this method
on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!
As the partition maps vary from device to device it may not work for you and you may get your device hard bricked!
Also your device must use older bootloader bypass based kernels i.e boot.img format and has SD-card slots for this method to work !!
Before we begin here's what Dual Booting means :
- Dual booting is the process through which you can switch between any two or more roms without the need of wiping data or making backups before flashing ,all you need to do is switch between the roms ,meanwhile all the apps you've insatlled remain intact in their specific rom.
for ex- If you are using cm10 and you have installed a lot of apps, and you want to test other rom ,but you don't want the fuss of backing up then flashing.. This dual booting method is for you !!​
So to begin with make sure you meet the following prerequisites :
Your Device which can run android
an class 6 or above SD-Card
an Os on the PC to make partitions on the SD-card
ubuntu for kernel specific changes
notepad ++
ConCentRation
If you meet all the above requirements you are good to go
Now to Before we get our hand in the filth remember : You need to have and an SD-Card that's class 6 or above because we would be using it extensively , and slow cards may not keep up
SO LET'S ROLL :
In this method [/CENTER]
Primary Rom = The rom which is modded and remains on the Sd-ext partitons
Secondary Rom = any rom you wish (any android version for ex- cm9 , cm10.1 and even stock !) [ make sure that the secondary rom doesn't use sd-ext partitions]​
I would be dividing the process in tow steps : 1) Kernel level changes and 2)SD-card and Rom level changes
1- Kernel Level Changes :
Get the source of any kernel for your device (if you don't know what's kernel compilation you can go to xda-university to learn it.)
-Now open the defconfig file (usually present in : "arch/arm/config" -folder)
-Search for LBDAF and then change the line consisting it as follows :
Code:
CONFIG_LBDAF=y
and now compile the kernel
This is done so that our Primary Rom can support multiple SD-ext partitons
-Now grab the boot.img of your Primary Rom , unpack it using any tool of your convenience(Google : chanpionwimmer's kernel tools -- i use it ) now open the ramdisk part , then open init.rc
-Search for the rom's mounting functions it will be like:
Code:
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
it will vary from device to device.. proceed only if you know the correct mount points for your device.. otherwise you WILL hardbrick your device
-Now replace the following lines from the mounting functions to this Make sure you know the correct mount points of your device :
Code:
# Mount SD-SYSTEM
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
mount ext4 /dev/block/mmcblk0p2 /system
mount ext4 /dev/block/mmcblk0p2 /system ro remount
# Mount SD-DATA
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
mount ext4 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
# Mount SD-CACHE
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
-Now recompile the kernel and you are good to go
more in the 2nd post ..​
Here now comes the SD-Card and Rom level changes :
YOU MUST USE ATLEAST CLASS 6 OR ABOVE SDCARD WITH MINIMUM 8GB CAPACITY
First you need 3 EXT4 partitions on SD-card, using minitool partition wizard
1) around 400 MB - SD-SYSTEM (ext4)
2) around 1 GB (or can be less) - SD-DATA(ext4 format),
3)around 75MB (can be less) SD-CACHE(ext4 format) (refer to the screenshot):
{
"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"
}
Rom level changes :
Get the updater-script of your Primary rom and find for these lines (Will differ from device to device - but basically the format is same )
Code:
format("yaffs2", "MTD", "system", "0", "/system");
mount("yaffs2", "MTD", "system", "/system");
package_extract_dir("system", "/system");
Now replace it with :
Code:
run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p2", "/system");
run_program("/sbin/busybox", "rm", "-rf", "/system/*");
package_extract_dir("system", "/system");
-what we are doing here is extracting the sustem files to the sd-ext partition we just created earlier
save it and replace this updater-script in the original Primary rom and also replace the boot.img with the one you made earlier.
That's it.If you have followed the guide correctly you can Dual boot any Rom on your device
Now flash the primary rom first.. and then any rom you choose as the secondary rom (PROVIDED IT DOESN"T USE SD-Ext partitions..) and flash it
REMEMBER DO NOT wipe data before installing the secondary rom
If you want to change your secondary rom DO NOT WIPE DATA instead goto recovery -
if in CWM or philz -go to mounts and storage and format system , data and cache
For Switching roms :
-put the boot.img of primary rom in the root of your sd-card(not in any directory) reanme it primary.img
-put the boot.img of secondary rom in the root of your sd-card(not in any directory) reanme it sec.img
-get terminal emulator app
-type
Code:
su
flash_image boot /sdcard/primary.img (or secondary.img)
But STOP here are some restrictions of this method :
You must make sure your device uses boot.img format and you know your device's correct mount points !! if you do it wrong you WILL hard brick your device !!
1. For The secondary rom you CANNOT use scripts like int2ext, etc.
2. Also you CANNOT use pll2 OC method in Secondary ROM
3. The edited cm10beta 6 (primary rom) is clocked at 600mhz, so NO chances of burnt nand.
4. You can choose ANY rom as secondary ROM provided it does not violate the first 2 clauses, that is, it should not use sd-ext partitions
5. The process is only for people having class 6 or higher sd card.
PS : This has taken a lot of effort and time so please don't go on commenting "This is useless" , "i don't like it" ,etc. If you don't like it, you are free to leave.
<JohnCarter> said:
...
-Now grab the boot.img of your Primary Rom , unpack it using any tool of your convenience(Google : chanpionwimmer's kernel tools -- i use it ) now open the ramdisk part , then open init.rc
-Search for the rom's mounting functions it will be like:
Code:
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
it can vary from device to device..
-Now replace the following lines from the mounting functions to this :
Code:
# Mount SD-SYSTEM
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
mount ext4 /dev/block/mmcblk0p2 /system
mount ext4 /dev/block/mmcblk0p2 /system ro remount
# Mount SD-DATA
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
mount ext4 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
# Mount SD-CACHE
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
wait /dev/block/mmcblk0p4
mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
..
Click to expand...
Click to collapse
PLEASE DONT POST INCORRECT INFORMATION!
the partition maps vary from device to device!
on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!
also not all devices use standard boot.img format...
if u were able to get it to work on a particular device atleast test it out on 8-10 different devices from different vendors and different platforms before posting such threads...
DooMLoRD said:
PLEASE DONT POST INCORRECT INFORMATION!
the partition maps vary from device to device!
on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!
also not all devices use standard boot.img format...
if u were able to get it to work on a particular device atleast test it out on 8-10 different devices from different vendors and different platforms before posting such threads...
Click to expand...
Click to collapse
I truly second that. The information on this thread is valid only for some devices. You can seriously screw a number of devices.
DooMLoRD said:
PLEASE DONT POST INCORRECT INFORMATION!
the partition maps vary from device to device!
on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!
also not all devices use standard boot.img format...
if u were able to get it to work on a particular device atleast test it out on 8-10 different devices from different vendors and different platforms before posting such threads...
Click to expand...
Click to collapse
Ok thanks for the info... i'll give a caution for not using this method on newer devices

[Q] fstab entry for newly-split internal SD partition (rooted tablet)

Device: Teclast P78HD tablet, Allwinner A31 SoC, Android 4.4.2 (rooted) :::: Software: Busybox X (with fdisk, vi, etc.)
The Teclast P78HD tablet has a small 8GB internal eMMC SDcard with an external microSD slot. In order to best make use of the Link2SD utility, I chose to split in half the almost empty 4.7GB (usable) internal SD FAT32 partition and then format the new (primary) second partition to EXT2 EXT3 or EXT4 as used by the Link2SD app.
I used Busybox X to fdisk /dev/block/mmcblk0 ( /mnt/sdcard )
{
"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"
}
After rebooting, the DiskInfo app showed P1 ( mmcblk0p1 ) partition had shrunk to 2.4GB and, as expected, a new (unmounted) 2.3GB P4 ( mmblk0p4 , type 83, Linux ) was there too.
Connecting to a PC vis USB, I tried to format P4 to ext4 using MiniTool Partitioner (Windows) but it did not see the new partition, I then tried Gparted under Linux but it indicated that neither P1 or P4 existed. Gparted just showed a large 4.7GB "unallocated" block.
[ QUESTIONS ]
1. How do I format the new P4 mmblk0p4 partition to EXT4 using Busybox X on the tablet itself ?
2. Should I use some sort of fsck command to fix any side effects of simply truncating the original P1 mmblk0p1 FAT32 partition ?
3. What entry should I add to the tablet's /fstab.sun6i file shown below to make it automount at boot time ?
Code:
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/by-name/system /system ext4 ro wait
/dev/block/by-name/cache /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,barrier=1 wait,check
/dev/block/by-name/databk /databk ext4 noatime,nosuid,nodev,nomblk_io_submit,barrier=1 wait,check
/dev/block/by-name/data /data ext4 noatime,nosuid,nodev,nomblk_io_submit,barrier=1,noauto_da_alloc wait,check,encryptable=/dev/block/by-name/databk
/devices/virtual/block/nandj /mnt/sdcard vfat rw,relatime,fmask=0000,dmask=0000 wait,check,noemulatedsd,voldmanaged=sdcard:auto
/devices/platform/sunxi-mmc.2/mmc_host /mnt/sdcard vfat rw,relatime,fmask=0000,dmask=0000 wait,check,noemulatedsd,voldmanaged=sdcard:auto
/devices/platform/sunxi-mmc.0/mmc_host /mnt/extsd vfat rw,relatime,fmask=0000,dmask=0000 wait,check,voldmanaged=extsd:auto
/devices/platform/sunxi-mmc.1/mmc_host /mnt/extsd vfat rw,relatime,fmask=0000,dmask=0000 wait,check,voldmanaged=extsd:auto
/devices/platform/sw-ehci.1 /mnt/usbhost1 vfat rw,relatime,fmask=0000,dmask=0000 wait,check,voldmanaged=usbhost1:auto
/devices/platform/sw_hcd_host0 /mnt/usbhost1 vfat rw,relatime,fmask=0000,dmask=0000 wait,check,voldmanaged=usbhost1:auto
/devices/platform/sw-ohci.1 /mnt/usbhost1 vfat rw,relatime,fmask=0000,dmask=0000 wait,check,voldmanaged=usbhost1:auto
BTW, despite the tablet's fstab entries, there is no /devices/platform directory but there is a /sys/devices/platform directory. Also note that sdcard0 and sdcard1 seem to point to the same place with the same files. I assume that my new partition should point to /storage/sdcard2
Did you ever figure it out? Thinking about splitting my internal storage and looking up for all the info I can find....

[Q] Optimizing ext4 for sd-ext (Samsung EVO MB-MP32D/EU on Xperia Mini Pro)

Goal:
Motivation: As my phone (Sony Ericsson SK17i) has low internal memory, it is essential to have a good MicroSD card with sd-ext and move some parts of /data to /sd-ext.
Problem: I am not satisfied with random I/O performance on ext4.
I, however, don't want to sacrify safety by disabling journaling.
My HW&SW:
My MicroSD: Samsung EVO MB-MP32D/EU, 32GB.
My phone: Sony Ericsson Xperia Mini Pro (SK17i)
ROM: LegacyXperia CM11
Ext4 mount options: noatime,nodiratime,barrier=1
My laptop OS (I ran mkfs.ext4, GParted and fdisk tools there): Ubuntu 12.04, up-to-date
Before making any change, I did a byte-by-byte backup of the original raw data, that is roughly dd if=/dev/sdc bytes=(some size) | compression > output_file. If you are interested in it, you can download the https://public.v6ak.com/samsung-evo-MB-MP32D--EU--32GB/sdc.gz.bz2 (< 1KiB) backup file.
What and why I did:
First, I resized the FAT32 (without reformatting) to 20GiB by GParted,
Second, I determined the sdcard characteristics by flashbench tool using command sudo ./flashbench -a /dev/sdc --blocksize=1024: https://public.v6ak.com/samsung-evo-MB-MP32D--EU--32GB/
There is my conclusion:
Code:
erase_block = 16777216
multi_plane = 16384
page = 8192
So, I took recommendation from https://wiki.gentoo.org/wiki/SDCard#Solution_2:_Tuned_ext4:
Code:
filesystem_block = min(page, 4096) = 4096 # Values higher than 4096 are not supported, so I had to pick 4096.
stride = multi_plane / page = 2 # Should I use page, or filesystem_block?
stripe_width = erase_block / page = 2048 # Should I use page, or filesystem_block?
# The resulting command:
sudo mkfs.ext4 -E stride=2,stripe-width=2048 -b 4096 /dev/sdc2
Third, I made another partitions in the free space. Now, I am just interested in the /dev/sdc2, which is sd-ext. The start of all the partitions is divisible by 8192, so I hope they are all properly aligned:
Code:
Disk /dev/sdc: 32.0 GB, 32010928128 bytes
255 heads, 63 sectors/track, 3891 cylinders, total 62521344 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000cf13
Device Boot Start End Blocks Id System
/dev/sdc1 8192 41951231 20971520 c W95 FAT32 (LBA) # The original partition
/dev/sdc2 41951232 50339839 4194304 83 Linux # The sd-ext partition
/dev/sdc3 50339840 52436991 1048576 83 Linux # A legacy partition, nothing important
/dev/sdc4 52436992 56631295 2097152 b W95 FAT32 # Titanium Backup partition, not important at the moment
The results:
I used A1 SD Bench to benchmark both FAT32 (i.e. /dev/sdc1) and ext4 (i.e. /dev/sdc2) filesystems. I did just the random I/O test when phone was in airplane mode (=> no noise from network events) and charging:
{
"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"
}
I've seen some suggestions it should perform several times better: http://forums.storagereview.com/index.php/topic/36678-samsung-evo-sd-memory-card-review-discussion/?p=287587 (Well, SD and microSD might differ, but I hope it not to differ much.)
There are my questions:
* Why is random write performance on the original FS significantly lower than on the benchmark above?
* Random writes are about twice faster on FAT32 than on ext4. Is it caused just by journaling?
* Why is random read significantly better on FAT32 than on ext4?
* Did I choose the right stripe/stride/blocksize? Should I double them?
* Should I perform another benchmark?
P.S.: Sorry there are no hyperlinks, I am not allowed to post them. I've tried to make the references as friendly as possible.

ZTE v987 cannot mount /system etc. possible eMMC damage

Hello,
I got stuck and I need some help.
The phone is ZTE v987. There was bgcngm's ROM V4.0B0MOD inside.
I pulled-out-&-pushed-in the battery and after boot there was a prompt that my data needed to be erased. (I'm not excatly sure what it was). I freaked out. Turned off and boot into recovery mode (vol up + power). Performed factory reset and tried to restore backup. It didn't work. I got messages:
Can't mount /system!
Can't mount /data!
Can't mount /cache!
Click to expand...
Click to collapse
So I tried to format all of the above. Then I tried to restore individually /system, /data, /cache. All the same.
When I enter the Recovery I get errors like here:
E: Can't mount /cache/recovery/command
E: Can't mount /cache/recovery/log
E: Can't open /cache/recovery/log
E: Can't mount /cache/recovery/last_log
E: Can't open /cache/recovery/last_log
Click to expand...
Click to collapse
There are mentioned some apps like Heimdall but I couldn't find a version for my device and I'm not exactly sure what I should do.
What's more, I found info about eMMC damage and followed the link to check if my eMMC was good or bad.
I typed the command and the output was empty:
adb shell
~ # dmesg | grep mmc0
dmesg | grep mmc0
~ #
Click to expand...
Click to collapse
I read somewhere it's possible that I don't have grep installed (maybe because I wiped the data).
So I tried another command to list the eMMC-chip partition info:
~ # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5
Disk /dev/block/mmcblk0: 3853 MB, 3853516800 bytes
1 heads, 16 sectors/track, 470400 cylinders
Units = cylinders of 16 * 512 = 8192 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 65 64 2147483647+ 5 Extended
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 1665 2944 10240 83 Linux
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 2945 4224 10240 83 Linux
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 5825 6592 6144 83 Linux
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 8385 91584 665600 83 Linux
/dev/block/mmcblk0p6 238785 64 2145573887+ 83 Linux
~ #
Click to expand...
Click to collapse
I also tried to mount /system and /data in adb but it failed:
~ # mount /system
mount /system
mount: mounting /[email protected] on /system failed: Invalid argument
~ # mount /data
mount /data
mount: mounting /[email protected] on /data failed: Invalid argument
Click to expand...
Click to collapse
I've also downloaded the ROM and tried to install from SD.
{
"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"
}
I've saved the log and here are bottom lines:
Updating kernel
open emmc partition "boot"
contents of partition "boot" didn't match EMMC:boot:4941824:a63fb5e2f91e9c21ae76325d15d98fd36c50c41b:4941824:a63fb5e2f91e9c21ae76325d15d98fd36c50c41b
file "EMMC:boot:4941824:a63fb5e2f91e9c21ae76325d15d98fd36c50c41b:4941824:a63fb5e2f91e9c21ae76325d15d98fd36c50c41b" doesn't have any of expected sha1 sums; checking cache
failed to stat "/cache/saved.file": No such file or directory
failed to load cache file
Flashing partition: BOOT
script aborted (no error message)
script aborted (no error message)
Installer Error (Status 7)
Click to expand...
Click to collapse
Also I've got recovery.log but it's a long one and can paste here if it is needed.
I didn't try to flash trough SP Flash Tool anything because I didn't want to make things worse.
That's all the info I could gather. I don't know if it is helpful at all but I've run out of clues.
I'd be very grateful for any help.
PS. Right now I'm not able to charge the battery. For one second the red light blinks and then the screen with battery with red strip at the bottom appears and I don't believe it's charging.

Categories

Resources