[Completed] Swipe Monster Tab XL916 messup up with internal Storage paritions - XDA Assist

Hi,
I wanted to just Overclocked the CPU of my Swipe Monster tab XL916,and as a consequence my device got hanged .I rebooted it and it was still working but it had no User apps in it.It was a strange when I checked out in Setting>Storage that now i had two internal storage partition(Strange)....One partition was just 16 mb and other was The Other was the actual paritition which was 5GB in size.
Maybe it could have changed some system files which led to changes in overall system. I am seriously not able to understand what has went wrong with my device.
#EDIT :Finally got ADB working..Please tell me if you need any information ,i can now run ADB shell commands.i have researched a lot and added parted binaries to the sbin folder,so now I can use parted tool also.I have found out that when i push any app to system via adb the Internal Storage which was earlier as Apps (16 MB) now becomes Apps (19.95 MB) . That means is my System Memory or some part of it is being assumed as Internal Memory.Earlier i was not able to install apks as user apps (as it said not enough memory). But now i am able to do that.
One thing more i have noticied which is quite strange :
a)When sd card is mounted before the boot : The mount command has 2 entries for /dev/block/vold/93:72(for /mnt/sdcard and for /mnt/secure/asec) and one entry for external sdcard by /dev/block/vold/179:1. I have 4 tmpfs (for /dev,/mnt/asec,/mnt/obb,/mnt/sdcard.android_secure)
b)after removing sdcard : vold entry 179:1 is oviously removed but also entry for vold 93:72 for mnt/secure/asec is removed.No change observed in tempfs.
c)reinserting sd card vold entry 179:1 comes back to play while entry for vold 93:72 for mnt/secure/asec is still not appearing.No change observed in tempfs
COMMAND : ls -al /dev/block : has entries for loop 0-7 (strange),platform,vold,nand a-j(nandd is system),ram 0-1,mmcblk0 and mmcblk0p1 for external sdcard
COMMAND: df shows =>/dev ,/mnt/asec,/mnt/obb,/system,/mnt/sdcard,/mnt/extsd

Hi!
Glad you got it sorted! In the future, you can post here for questions or help...
http://forum.xda-developers.com/android/help
Thanks!

Related

Issues with apps to sdcard?? POST HERE ONLY!!!

I was able to install and run apps from the sd card (ext2), but somehow I still uninstall some apps that i don't use frequently. Is there anyway I can remove the apps from the sd card that i uninstalled? I know the fact that they don't occupy that much spaces, but still I'm thirsty for the knowledge on that issue
uuummm you can go to your terminal and
1- su
2- cd /system/sd/app or app-private
3- ls
4- rm "filename you wanna remove" without double quotes
5- Thats it !!!
samysam05 said:
uuummm you can go to your terminal and
1- su
2- cd /system/sd/app or app-private
3- ls
4- rm "filename you wanna remove" without double quotes
5- Thats it !!!
Click to expand...
Click to collapse
and because of the "ln -s" command you could also cd /data/data/app .. it all points to the same place now
issues partitioning SD card for moving apps
I am having ALOT of trouble trying to format my 4GB SD card to the fat32/ext2 partitions.
I have tried using partition manager 9, setting the fat32 (2.8GB) as a primary, and also setting the SECOND partition ext2 as a primary (1GB). I also tried using gparted and did the same EXACT partition, size and settings in all the different programs. I also tried a mixture of FAT16/FAT32 and ext2 for all the settings. I then tried using ext2fsx on my mac using the same exact settings as before. No matter what, it doesn't mount /system/sd, it always is mounted to /system/sdcard.
(the below are estimated because I was entering all commands in the terminal on my G1)
I'm suppose to see something similar to the following:
dev/mmcblk0p2 1.2G 9.1M 1.1G 1% /system/sd
I always get something to similar to:
dev/mmcblk0p2 1.2G 9.1M 1.1G 1% /system/sdcard
I always see the fat32 partition but never the ext2. I know that alot of people on this forum seem to be able to do this without issue. I unfortunately have been working it on all day.
Can someone PLEASE help me out? Thanks!!!
have you tried moving the apps to sd? see if you actually move all your apps and look at that line again to see if there is an adjustment in size
Which directory does your mountd.conf and init.rc files specify in it if you open them up? Does it say /system/sd or system/sdcard? I believe tempo had his saying system/sdcard and used different files than the ones in the post by dwang that does basically the same thing. I recall one of them using /system/sdcard in their post and the other doing just /system/sd. Use the same file from the same post and don't mix the 2 up because they are not the same.
I used dwang's instructions and files and got my 2GB card partitioned and working. I have had a problem getting my 8gb card working for some reason but that is another story. It seems my 8gb isn't readable or writeable after I partition the ext2 section although the fat32 is ok. I'm familiar with linux but don't know what I need to do to make that partition writeable when I can't get it to show up at all except in gparted and partition manager under windows. I tried busybox df -h without it showing so no luck there...
Hopefully what I metioned helps you and maybe somebody has an idea why mine didn't work either although I wasn't very specific.
I tried both files and mounting on both /system/sd and /sd neither of which worked . I also tried various programs to partition the sd card. I have no other ideas...
Hi,
This is how it should look.
I use an adb shell through the computer (windows xp).
The drive with 1.5g available is the sd card drive.
Non-market apps on SD card issue
Okay... Getting this to work has sucked horribly for me and after rooting through the other forums that would apply to my issue i've found no solution. I have RC33 JFv1.42 LucidREM mod, with /app, /app-private, and /data all copied to the EXT2 partition of my SD card. I am trying to install the AndroidVNC viewer using the AppsInstaller app, I have AndroidVNC saved onto the root of the FAT32 partition of my SD card. The Appsinstaller sees it but when I go to install the .apk itself it's giving me the following error:
"androidVNC could not be viewed. Free up some space on your phone and try again." Giving me a 'cancel,' and 'manage applications' button under.
The error doesn't make any sense because when I login to my terminal as root and # busybox df -h, the only parts of my system that are full are the usual suspects:
/system
/system/modules
/system/xbin
all of which are full, but they always have been for me, so I'm not sure if the Appsinstaller is trying to use one of those blocks to extract to temporarily or something like that. what am i missing here!?!?
bump
Partial App migration to SD card...possible?
Has anyone tried to move only *some* of the apps to the SD card?
I'm stuck with a class 4 mSD card, so as I understand it, moving the apps en masse to the SD card isn't a recommended option.
But I was wondering if perhaps I might move *some* apps to the SD card...maybe just ones that I don't use often, or aren't particularly complicated, or maybe just ones that seem to run perfectly fine from the card.
Some of the "high performance" apps, or ones with a lot of I/O dependency I'd leave on the phone internal storage.
As it stands right now, I'm at total app saturation. I've uninstalled infrequently used apps and have them backed up for ready restoration anytime/anyplace. I've moved every cache possible. Yet even at 13MB free, the phone still complains I don't have enough room to install the latest build of AndNav2.
Should I even attempt a partial migration? I have no paid apps (and apparently couldn't install any even if I wanted to) so I'd just be moving the *.apk file and maybe the *.odex files? Is that all I need to move and then symlink to?
Bump for day crew.....
I'm using this setup. I use my own bash script to move apps:
Code:
#!/bin/bash
# mvappndata.sh 1.1 by Autarkis
# GPL OpenSource
adb remount
adb shell cp -rp /data/app/$1.apk /system/sd/app/$1.apk
adb shell rm /data/app/$1.apk
adb shell ln -s /system/sd/app/$1.apk /data/app/$1.apk
adb shell cp -rp /data/data/$1 /system/sd/data/$1
adb shell rm -r /data/data/$1
adb shell ln -s /system/sd/data/$1 /data/data/$1
You call it with the application's name without the .apk suffix.
Code:
mvappndata.sh com.mobisystems.msdict.embedded.wireless.pons.ssd
Known Bugs:
* apps moved this way don't show as Installed or Updated in Market, but as Free
* sometimes, when you are running out of memory, it won't be possible to install new apps from market - the downloading process will hang right at the beginning. Making even more room does the trick
I leave all apps that are being started at boot time or once started should run as a service in the internal memory. I move all the big apps (like dictionaries) to the SD. It mostly works, but since many apps are buggy themselves it's difficult to tell where a certain Force Close is coming from.
Cheers from Switzerland,
Autarkis
Ah...precisely what I was looking to do. Thanks....that helps a lot.
I'm guessing I can modify the script to run directly on the phone....it appears you have constructed to move apps while connected to a PC via the USB cable. Is this correct?
f4phantomii said:
Ah...precisely what I was looking to do. Thanks....that helps a lot.
I'm guessing I can modify the script to run directly on the phone....it appears you have constructed to move apps while connected to a PC via the USB cable. Is this correct?
Click to expand...
Click to collapse
Yes on both counts. I also use ls -laS to display installed apps sorted by size.
looping on android, home button & silent not working on 1.42
Hi,
Had a weird experience the other day. Phone was fine (rooted RC33/JF1.41). Got some AK Notepad reminders but was busy with something so I ignored them (but heard the alert go off). A few minutes later, the phone spontaneously rebooted and from that point on just looped on the android screen.
I figured I was due for an upgrade, so I popped out the sdcard and upgraded to JF1.42. The phone did come back to life, but at that point the home button won't work (wasn't a hardware issue as it worked to get me to the home+power loader) and when I held down power to shut down, I got only the "power off phone" option but no "silent mode" option. Very strange. This was obviously no good, so I went back to 1.41.
Long story short, the phone still looped, so I took this as a sign that a wipe was unavoidable (I didn't have a recent nandroid backup), but since I had WAY too many apps I never used (~200) and my phone was getting unstable (things were constantly force-quitting), I figured I may as well do some spring cleaning and start fresh.
I learned my lesson and finally got the important apps reinstalled and the phone reconfigured the way I want it -- and then did a nandroid backup so I can avoid this in the future.
But what the heck happened that made the buttons not work? That one freaked me out a bit...
And of course I still wonder what caused me to loop in the first place, totally randomly and spontaneously. Are there specific things that can cause that and if it happens again, is there an easy way to fix it?
Thanks
Gah! This is driving me nuts! I absolutely can't make this work.
I can transfer the whole /data/app and /data/data directories to /system/sd, but as I have a class 4 SD card, I get tons of force closes on apps.
So then I try just moving single apps. For example, moving the OI Flashlight app to the sd card.
Code:
# busybox -a /data/app/org.openintents.flashlight.apk /system/sd/app
# rm -r /data/app/org.openintents.flashlight.apk
# ln -s /system/sd/app/org.openintents.flashlight.apk /data/app/org.openintents.flashlight.apk
I do the same thing with the appropriate data directory for the app. I check and the files are moved. The symlinks are present.
But when I try to run the app, it just tells me that the application is not installed on my phone!
Grr! Then if I delete the symlinks and cp the files back to their original locations, same result. I end up having to re-install from backup.
Very frustrating. Any advice?
I don't know what busybox -a does.
It probably shoud say "cp -rp" instead.
It's important that you preserve access rights.
It's also very important that /system/sd is an ext2 partition. vfat won't do.
My script also assumes that as a preparation, /system/sd/app and /system/sd/data have been created. Like that:
Code:
mkdir /system/sd/app
mkdir /system/sd/data
I assumed that was self-explanatory, but it probably wasn't.
unionfs works for this:
have cake and eat it micro-howto:
(Use a recent jf dist)
/system/bin/insmod /system/modules/2.6.25-01843-gfea26b0/kernel/fs/ext2/ext2.ko /system/modules/2.6.25-01843-gfea26b0/kernel/fs/unionfs/unionfs.ko
(partition sd card as described in the aps-on-sd howto)
(mount to /data/local/ext for this example)
mkdir /data/local/ext/app
busybox mount -v -t unionfs -o dirs=/data/local/ext/app=rw:/data/app=ro unionfs /data/app
This has been tested; downloaded apps go to sd card but the system sees apps in /data as well.
The only issue with this is you can't umount the unionfs mount. In theory, you can have writes go to the real /data/app with:
busybox mount -o remount,dirs=/data/local/ext/app=ro:/data/app=rw /data/app
But I have not tested this.
losing storage after moving cache and apps.
Hi all,
I have moved apps to Sd Card.. I have moved cache to sd card and when all is said and done I had 47mb of 74mb free.. YES... but wait..
Now in using my phone I keep losing free space I am now at 45 of 74mb free. How can I found out what is taking my free space up .?
Please help. Thanks in advance for your time.

[Howto] App2sd Step by step

a big part of this new tutorial is not from me, credits go to tot31
New version out !!
Now you can choose if you also want to move the dalvik cache an the /data/data directory to sd (if you have an slow sd-card this will be a bit laggy) (to use this you can now use the update funktion)
and i've added an update funktion and protectet the install function so now you can't install app2sd two times an brick your fimrware
and if this help you you can help/thanks me
If You have an x10 mini (pro) go here :
http://forum.xda-developers.com/showthread.php?t=804574
The leds on boot are Now working :
blue means:
no proplem with sd card booting normal
purple/voilet means
sdcard malfunktion booting with failsafe
.
How To : App2sd on Xperia X10i
Pre Installation.
Root the phone by using z4root ( http://forum.xda-developers.com/showthread.php?t=833953 )
Step 1 : Preparing your micro SD Card.
Please refer to this link ( http://forum.xda-developers.com/wiki/index...rd_partitioning ) on how to prepare your micro sd card.
For better performance I would advise that you use a Class 10 card instead of the original card that comes with the phone because the card is only Class 2 card. For more infomation on speed class rating of sd card please go here -> http://en.wikipedia.org/wiki/Secure_Digital
An excerpt taken from wikipedia :-
The following are the ratings of some currently available cards:
* Class 0 - These cards do not specify performance, which includes all legacy cards prior to class specifications.
* Class 2 - Minimum of 2 MB/s performance. Lowest speed for SDHC cards.
* Class 4 - Minimum of 4 MB/s performance.
* Class 6 - Minimum of 6 MB/s performance.
* Class 10 - Minimum of 10 MB/s performance.
Note : The recommended maximum size of ext2 partition is 1.4GB. I've tried 3GB before and ended up with unstable system and eventually crash the phone. So if you're really greedy since you've bought a 16GB or 32GB card to partition the ext2 more than the recommended size and if your phone is unstable, you've been warn but normaly 1.4 GB are enough
Step 2 : Download the related files.
1. App2sd : see attachment
2. adb shell : see attachment
Step 3 : Enabling USB Debugging mode on you phone.
Go to Settings -> Applications -> Development -> USB Debugging (check this option).
Step 4 : Installing App2sd.
Create a folder name adb in your pc and extract all the files from adb.zip into this folder.
Connect your phone to your pc and mount the sd card. Extract all the file from app2sd2.1.zip to the root of your sd card. Make sure to unmount the sd card before continue the next step.
In your pc open up a dos terminal box by typing cmd in the Search programs and files box.
Type
cd /adb
then type
adb shell
then type
sh /sdcard/app2sd.sh
you'll be presented by this screen...
+________________________________+
|********************************|
|*Welcome To wolfilein's App2sd *|
|*installing script *|
|********************************|
+------------------------------------------+
~this version should be go on any device ~
+___________________+
|********************|
|* Menu *|
|* *|
|*[0] install app2sd *|
|* *|
|*[2] exit *|
|********************|
+-------------------------+
[0]
now just press the enter key & wait.
Important : Make sure to set your phone screen timeout to the max because Superuser will ask for your permission to allow this script to run. If your screen goes blank, you can't see this prompt and the installation will fail.
after a while you'll get this..
busybox is /system/bin/busybox
rm failed for /etc/mount_sd.sh, No such file or directory
+________________________________+
|********************************|
| finished going reboot now |
|********************************|
+-----------------------------------------+
the both messages above doesn't mean that your installation has failed
Finally after a reboot, your phone is ready with app2sd. From now on when you install any applications it will save into your sd card.
Disclaimer : Do this at your own risk. I will not responsible if any injuries or damage occur to you or your phone
Good, But can someone make a more detail guide on step by step to get this done.
Thank you
How to partition the sd card without bootlodaer?
Sorry if this is a noob question.
Wenner said:
How to partition the sd card without bootlodaer?
Sorry if this is a noob question.
Click to expand...
Click to collapse
Use a MicroSD reader and a linux system?
No need for card reader, just plug the phone and use parted
i will add some pictures if a have the time
if I understand this correctly, this script essentially creates link to sd card directory, where previously is a directory of apps.
nice trick, but without any failsafes.
I mean, if you remove sd card you are without /data/app/ directory at all!
there should be some failsafe...
method 1:
script at startup checking:
if there is a symbolic link to sdcard? (check attributes of /data/app/ )
if directory is a symbolic link and no data exists inside (for example specific directory/file is not existent) ->point the symbolic link to /data/app2/ directory.
to make it work,
/system/app2 directory should be created:
Code:
busybox cp -a /data/app /data/app2
instead of removing it in your script:
Code:
"rm -r /data/app "
also make some specified light flash on the phone, to warn user that old backup copy is used because of sd card malfunction (i've documented a way to do this in:
http://forum.xda-developers.com/wiki/index.php?title=Xperia_X10#Leds_and_backglight )
for example pink led:
Code:
echo 15 > /sys/class/leds/ledc:rgb1:red/brightness
echo 2 > /sys/class/leds/ledc:rgb1:green/brightness
echo 3 > /sys/class/leds/ledc:rgb1:blue/brightness
method 2:
even better way would be that sd card partition is mounted on every start on system OVER old /data/app/.
this works always in linux - you can mount over non-empty directory without a problem
so, if the sd card is not accessible - dont mount sd card apps directory and like in method 1, flash the led or something, and old apps directory would work without doing anything more
to check:
- does mounting over non-empty directory works also in android?
- what is the way to add startup script init in the system?
(possibly executed from sd card - when no card is visible, the script would not execute, right )
- why there is a 1.4GB limit ? is this a ext2 limit on android ?
yes doun't normaly you don't remove your sdcard
devein said:
- does mounting over non-empty directory works also in android?
- what is the way to add startup script init in the system?
(possibly executed from sd card - when no card is visible, the script would not execute, right )
- why there is a 1.4GB limit ? is this a ext2 limit on android ?
Click to expand...
Click to collapse
1. Yes
2. exec your script from either /etc/mount_iso.sh or /system/drm/DxDrm/drm.sh
3. There is no such limit, rather an advised value
So... It works or not?
Can someone post something like the rooting instruction for App2SD?
Eg: Step 1 - Step 2
With all the links to apps required.
That would be a great thread for everyone !
Thank you
if i had the time i make this the folloing days
check this out, i've made partitioning tutorial for windows users:
http://forum.xda-developers.com/wiki/index.php?title=SD_card_partitioning
I will copy any tutorials on X10 wiki at http://forum.xda-developers.com/wiki/index.php?title=Xperia_X10#Fixes.2C_Hints_.26_Tips
I've done all steps but i dont know if it works or not how should i know .....
i installed so many games and app and still 350mb left in device memory
Sent from my X10i using the XDA mobile application powered by Tapatalk
so now i will make/add some screens
hmm
i just keep getting permission denied when it trys to apply apps2sd thru the app2sd.sh i rooted via the one click universal android root
****
I did the commands in the end thru terminal on the device all went well apart from it could not locate busybox which was extracted as stated onto root of sd. The phone restarted and basically will not load past the sonyericsson swirly logo. checked on logcat and its crashing due to being unable to mount applog partition.
So the entire Sdcard need to be format as Ext2 or as mutch as u want , let say around 1 Or 2 GB?
Witch one need to be primary and witch need to be logical?
thx
Sent from my X10i using XDA App
yes you must make a
"second" patition with ext2 wich is a primary partition
androidfanboi said:
I did the commands in the end thru terminal on the device all went well apart from it could not locate busybox which was extracted as stated onto root of sd. The phone restarted and basically will not load past the sonyericsson swirly logo. checked on logcat and its crashing due to being unable to mount applog partition.
Click to expand...
Click to collapse
The same story with me....

[Q] i9000 - internal sdcard gone - problems with boot / external sdcard mounting

Hi,
I have an i9000 and unfortunately, the internal sdcard is not recognised at all.
I can only boot using voodoo 500hz kernel, to bypass this problem.
All other kernels will fail at boot screen (reboot loop).
After booting with voodoo kernel, I've rooted the phone and connected through ssh to it (adb shell)
Listing devices in /dev/block showing nothing like mmcblk (/dev/block/mmcblk0)
I thought it must be the card itself or the controller so I went and bought an external sd card (8gb).
After I insert it, the phone shows it has 0 (zero) capacity , tried to format it to fat32, ext2, etc, both on device (parted) and computer (windows, linux). Not a chance. Tested it using a i9100 I also own and the card was recognised correctly.
Next step was to check if the controller still works so again adb shell and checked for a mmcblk device in /dev/block.
This time, a /dev/block/mmcblk0 and /dev/block/mmcblk0p1 / /dev/block/mmcblk0p2 were listed.
Removed the external card, no device at all so the internal sd card is gone for good.
Next step was to use a hack to swap the internal/external sd cards in (/etc/vold.fstab), but even it is recognized in recovery mode (I can factory format/ wipe data), still 0 size in android interface and I can't use Camera and other apps.
I tried to mount it manually, directly on phone (adb shell), with mount comand and it works! I can create files on it, which are persistent.
So the controller actually works and the card is recognised low level.
BUT, why Android interface (java layer) won't recognize it? It says it's there but size is 0.
Please help, I can't use a lot of features on the phone, I don't know what to do.
Tried to mount it manually (to /mnt/sdcard), and even it get mounted and everything works on shell (creating files, etc), still 0 size in Android.
Running df in shell shows the correct size.
Checked the fstab / vold.fstab / vold.conf , everything seems to be ok.
Can anyone help me to fix this issue? Or at least, to give me some clues / ideas? I've lost several nights and I can't find a fix.
I'm good at linux but don't know very much about Android and it's java layer over linux.
It happenned to me too... not sure it can help you, but this is how i fixed my problem:
1. connect i9000 to the pc thru usb.
2. found a filename "no media" in the root directory.
3. erase the "no media' filename and everything is back to normal.
Did you fix it? I have the same problem and can't find a solution yet

[Q] Sony Xperia L - increase internal storage

Hi, I have Sony Xperia L (C2105) with Android 4.2.2 and it is rooted. My phone should have 8 GB of internal memory. Only 5.57 GB is usable but it would not matter. 4 GB of 5.57 GB is separated and marked as "sdcard0". So I can't install applications there but I can only move data of applications there. Remaining 1.57 GB is used as internal storage and all aplications are installed to this small storage. My memory card is marked as "sdcard1". Is there any way to increase internal storage or merge internal storage and sdcard0 to one big internal storage?
Donald750 said:
Hi, I have Sony Xperia L (C2105) with Android 4.2.2 and it is rooted. My phone should have 8 GB of internal memory. Only 5.57 GB is usable but it would not matter. 4 GB of 5.57 GB is separated and marked as "sdcard0". So I can't install applications there but I can only move data of applications there. Remaining 1.57 GB is used as internal storage and all aplications are installed to this small storage. My memory card is marked as "sdcard1". Is there any way to increase internal storage or merge internal storage and sdcard0 to one big internal storage?
Click to expand...
Click to collapse
If someone could make this Guide for Xperia L!!!
http://forum.xda-developers.com/showthread.php?t=2712253
Till then you could use FolderMount if you have root access and mount obb and app data folders to external storage!
I think i got em
david pro said:
If someone could make this Guide for Xperia L!!!
http://forum.xda-developers.com/showthread.php?t=2712253
Till then you could use FolderMount if you have root access and mount obb and app data folders to external storage!
Click to expand...
Click to collapse
check this out, guys
http://forum.xda-developers.com/xperia-s/s-development/tutorial-increase-data-partition-t2821058
david pro said:
If someone could make this Guide for Xperia L!!!
http://forum.xda-developers.com/showthread.php?t=2712253
Till then you could use FolderMount if you have root access and mount obb and app data folders to external storage!
Click to expand...
Click to collapse
Please look into this post I made a few weeks ago...the thread's name it's posted in doesn't help in finfing it I must admit.
So here it is for our Xperia L:
Open a command window: CMD, then get into shell:
adb shell
Once in shell, type:
umount /storage
parted /dev/block/mmcblk0
print
This prints out the partition information of your phone's memory chip
You will see the partition numbers in the first column, partition names in the last one,
in between you have the start/end memory index and the partition size
------start---end---size
...
31---1795---3506---1711---userdata
32---3506---7818---4312---sdcard​In the above output, consider the values indicated in italic as not to be changed !
Now calculate (open a spreadsheed if you like) the new value for the end of the userdata partition,
and use the same value for the start of the sdcard partition
On your sheet it should look something like this if you added 2048 to the userdata size
------start---end---size
31---1795---5554---3759---userdata
32---5554---7818---2264---sdcard​
Remove userdata and sdcard partitions:
rm 31
rm 32
Create the new userdata and sdcard partitions:
mkpartfs logical ext2 1795 5554
name 31 userdata
mkpartfs logical fat32 5554 7818
name 32 sdcard
Exit parted to go to the adb shell again:
quit
userdata partition (31) needs to have ext4 file system
The following will do the ext2->ext4 conversion:
cd /storage/sdcard1/fs-utils
tune2fs -j /dev/block/mmcblk0p31
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p31
e2fsck -fpDC0 /dev/block/mmcblk0p31
Now you can go to recovery and format the sdcard partition (default)
Then you can restore the backup you made before all this or do a clean install
I'm waiting for this phone which bought few days ago. Do we need to have firmware file for doing that? Could you please explain for dumbs the "
Now you can go to recovery and format the sdcard partition (default)
Then you can restore the backup you made before all this or do a clean install" thing??
My knowledge on this is reduced to flashtool and some root stuff. Thanks in advance
SoulFury said:
I'm waiting for this phone which bought few days ago. Do we need to have firmware file for doing that? Could you please explain for dumbs the "
Now you can go to recovery and format the sdcard partition (default)
Then you can restore the backup you made before all this or do a clean install" thing??
My knowledge on this is reduced to flashtool and some root stuff. Thanks in advance
Click to expand...
Click to collapse
That means: If you have made a backup, use the backup. If not, flash some software (and wipe cache/data == clean install)
So I connect phone to pc, do the thing using ADB, then flash it with stock firmware(for example) wiping cache,huh? Seems easy. Many thanks
I'm trying it but adb won't let me do umount /storage, it sais "invalid argument" :S
SoulFury said:
So I connect phone to pc, do the thing using ADB, then flash it with stock firmware(for example) wiping cache,huh? Seems easy. Many thanks
Click to expand...
Click to collapse
Hey man I just realized that after repartitioning you should better not flash stock firmware as I heard many cases in which the phone was bricked afterwards (with CM there is no problem)
Sent from my C2105 using XDA Free mobile app
I've read about it too, but it seems to happen randomly :S. But my first problem is the "umount" thing
Up this guys, I really would like to do this thing
Kahana82 said:
Open a command window: CMD, then get into shell:
adb shell
Once in shell, type:
umount /storage
parted /dev/block/mmcblk0
print
Click to expand...
Click to collapse
Did you do that first step?
Sent from my C2105 using XDA Free mobile app
GreyLDroid said:
Did you do that first step?
Sent from my C2105 using XDA Free mobile app
Click to expand...
Click to collapse
Did you try that with adb connected tot the phone within CWM recovery mode (not from your Android OS) ?
I've tried different ways
First of all, I have the phone with "usb debug" enabled, with my sdcard out and normally connected. If I do "adb devices" it launches daemon and show me my device connected
But when I enter the shell, if I do the same thing, devices is not showed, but I can access and do "ls" and navigate through the directories.
I can't either adb pull /dev/block/mmcblk0 mmcblk0.img, it sais that "remote object is not a file or directory", but it is.
I'm running Windows 7 SP1 with last version of Android Studio(SDK) and manually added my phone to android_winusb.inf
any idea? Thanks in advance
SoulFury said:
I've tried different ways
First of all, I have the phone with "usb debug" enabled, with my sdcard out and normally connected. If I do "adb devices" it launches daemon and show me my device connected
But when I enter the shell, if I do the same thing, devices is not showed, but I can access and do "ls" and navigate through the directories.
I can't either adb pull /dev/block/mmcblk0 mmcblk0.img, it sais that "remote object is not a file or directory", but it is.
I'm running Windows 7 SP1 with last version of Android Studio(SDK) and manually added my phone to android_winusb.inf
any idea? Thanks in advance
Click to expand...
Click to collapse
Try to navigate to the directory and then just use adb pull mmcblk0.img (without the path)
Sent from my C2105 using XDA Free mobile app
Well, something is going wrong. If I do adb devices at first, it shows my phon, but when I do adb shell, althoug I apparently have acces to my phone directories, adb devices is empty :S
SoulFury said:
Well, something is going wrong. If I do adb devices at first, it shows my phon, but when I do adb shell, althoug I apparently have acces to my phone directories, adb devices is empty :S
Click to expand...
Click to collapse
ah come on guys dont touch this if you are kinda that rookie... want to hardbrick your device?
i will explain you:
you do : adb devices
you do that ON PC
pc looks for devices and show you
then you do : adb shell
you will switch from PC to PHONE comand prompt
then you do again: adb devices
you do that ON PHONE ...
and on your phone there isnt another phone conected
Sent from my C2105 using XDA Free mobile app
Ooooook thanks. First of all, only starting to be a rookie you'll become master XDDD. Until now, I've only flashed,rooted and modded some firmware on all of my xperias since x10 mini pro, and I hope I'll learn more and more.
Next, still having the thing about the umounting of storage.I've tried with sdcard out. Even pull command(out of the shell xD) doen'ts work with dev/block/mmcblk0
SoulFury said:
Ooooook thanks. First of all, only starting to be a rookie you'll become master XDDD. Until now, I've only flashed,rooted and modded some firmware on all of my xperias since x10 mini pro, and I hope I'll learn more and more.
Next, still having the thing about the umounting of storage.I've tried with sdcard out. Even pull command(out of the shell xD) doen'ts work with dev/block/mmcblk0
Click to expand...
Click to collapse
adb devices
adb pull /dev/block/mmcblk0 c:/users/bla/mmcblk0.img
you have to do that ON PC command prompt.... dont switch to shell
Sent from my C2105 using XDA Free mobile app
That's exatcly what I do and I get always "remote object '/dev/block/mmcblk0' not a file or directory"(and I've verified that it exist)

Restore a deleted partition

Hiya! I don't believe my problem is device specific. The background of how I ended up in this crappy situation is, but I believe the resulting issue is general. Should I be wrong, tell me and I'll move this to my device's section.
Short question: how can I (and can I?) restore data in a partition that got deleted, if no new filesystem has been created over it?
Long background: I have a Xiaomi Mi2-S 32GB. It used to have a peculiar layout: a double system partition (/system1 and /system2)¹, a small internal storage (/userdata)², and a big emulated SD card (/storage)³.
Let's explain why:
¹ False dual boot: the active system is installed in the first partition. When installing an update with the official app, the newer system gets installed in the second and that one gets booted. So, should this newer system fail to boot, you have an older one correctly working and ready to boot.
² and ³: so that the whole storage partition containing photos, music, videos, downloads, backups, saved games and such can be accessed with MTP, while the userdata containing apps and complementary system things is kept safe. This last decision, however, brings up a new problem: userdata can't be accessed by user to put his files or by apps without root permissions to store data (like photos), while storage can't be used to install apps, or even to move them using Link2SD or such. Some users might find storage is insufficient for their videos and music, while others might find userdata is too little for their games, and they are both stuck in this situation.
I was in the second group, so I altered my layout using stillka's guide on xiaomi.eu (Sorry, I can't post links). I extended my userdata, so that my storage resulted smaller. Plus, I understood altering a partition would mean deleting all the partitions before that one, and recreating them thereafter.
Until this point, all was OK. I installed Ivan's AOSP Lollipop for unmerged partitions, and found out it would experience random reboots with True Dual Boot. So I stuck with False one and forgot about everything. I kept that version without updating for a long time.
Then, several months later, my phone started rebooting randomly anyway. I figured I would come back to MIUI to get Xiaomi's support for an official ROM.
Little did I know they decided to change layout in the meantime. MIUI got so big the size of the two systems was insufficient. So they decided to merge them into an unique partition big enough. So, while flashing with the official tool MiFlash, it practically altered my system layout, having to delete all that was placed before them (cache, userdata and storage), never telling me what it was going to do, advising me to back my storage up somewhere. All I did was back up my userdata into storage, confident flashing their official ROM with their official tool would just write into system, since nobody told me otherwise.
So this is the result: the old, small size of userdata is back, and everything that comes after is left without any filesystem: these are the last line in parted's print output
20 327MB 336MB 8389kB ext4 persist
21 336MB 1409MB 1074MB ext4 system
22 1409MB 1812MB 403MB ext4 cache
23 1812MB 5570MB 3758MB ext4 userdata
24 5570MB 31.3GB 25.7GB storage
Click to expand...
Click to collapse
I've tried parted's rescue command, but it is unable to find a partition lying there. I don't have my old layout, so I'm not able to precisely know where my old storage began, but I remember it to be around 18 GiB in size. I've tried all ranges possible (from the current end of userdata, 18 G from the end and so on) but no dice.
Can someone tell me if there is any hope, and what can I try?
Now I'm trying to dd the whole eMMC, or even just the last partition, to my computer to work on it using, say, testdisk. There is just one problem.
Obviously, I must issue the commands in my PC's environment, as I've nowhere to dump the biggest partition in my phone to, on it. So it goes something like
Code:
adb shell su -c "cat /dev/block/mmcblk0" | pv > mmcblk0.raw
The problem is, even if my phone was rooted by TWRP and in my options menu, the su binary is not found
/sbin/sh: su: not found
Click to expand...
Click to collapse
What should I do? Should I manually push the su binary in /system/bin? Where should I take su? From my PC?
This link should be helpful to you. Though its for MI3, the guy explains exactly how he recreates all the stock partitions one by one using the parted utility.
However, I think even before you try that, I think you should consider using the shortcut suggested in this link. If you can alter the flash_all.bat slightly and add the gpt_both0.bin, it can re-create the stock partitions (at least this is what the poster has done for Mi3/Mi4, since yours is Mi2, I'm not so sure, you may have to find out).
Finally, here is one more link that you may want to read up.
---------- Post added at 06:34 AM ---------- Previous post was at 06:34 AM ----------
This link should be helpful to you. Though its for MI3, the guy explains exactly how he recreates all the stock partitions one by one using the parted utility.
However, I think even before you try that, I think you should consider using the shortcut suggested in this link. If you can alter the flash_all.bat slightly and add the gpt_both0.bin, it can re-create the stock partitions (at least this is what the poster has done for Mi3/Mi4, since yours is Mi2, I'm not so sure, you may have to find out).
Finally, here is one more link that you may want to read up.
The problem is I don't have to restore stock partitions. That was already done against my knowledge, only that the last partition was left without a filesystem. If anything, I should restore my previous, custom layout, I have no trace left about.
I've managed to use testdisk. It is not able to find any partition in my phone eMMC though...
Testdisk's failure might be because of a wrong geometry setting, even if it sounds strange to me.
This is the ouput of parted's print
parted print said:
Error: Both the primary and backup GPT tables are corrupt. Try making a fresh
table, and using Parted's rescue feature to recover partitions.
Model: (file)
Disk /media/Storage/mmcblk0.raw: 31.4GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
Click to expand...
Click to collapse
This is fdisk's p
fdisk p said:
Disk mmcblk0.raw: 29.2 GiB, 31354139648 bytes, 61238554 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
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
mmcblk0.raw1 1 4294967295 4294967295 2T ee GPT
Click to expand...
Click to collapse
2T? Seriously?
Given that parted doesn't give those errors when run directly in adb, maybe something has gone wrong in the process of dumping my memory. I've issued this command:
Code:
adb shell dd if=/dev/block/mmcblk0 | pv | dd of=/media/Storage/mmcblk0.raw
Did I do something wrong?
This is what testdisk tells me in the analyse menu:
testdisk analyse said:
Disk mmcblk0.raw - 31 GB / 29 GiB - CHS 3812 255 63
Current partition structure:
Partition Start End Size in sectors
1 P EFI GPT 0 0 2 267349 89 4 4294967295
Warning: Bad ending head (CHS and LBA don't match)
No partition is bootable
Click to expand...
Click to collapse
It also detects an Intel table, which is rather odd. Selecting Intel or GPT gives the same result anyway, a big, round zero.
Rather than messing with partition tables using parted, I think there is a simple thing you can try:
1. Restore stock partition tables as it is (using the linked guide or some other means).
2. Restore the stock partitions themselves, something like this:
dd if=/sdcard/system.img of=/dev/block/mmcblk0
dd if=/sdcard/boot.img of=/dev/block/mmcblk1
These are just examples, you know which partition number corresponds to system.img, boot.img, etc. If you can do the above successfully, you will have restored the handset back to stock settings (both partitions and data) and it should start working in theory.
I'm not sure whether I'm not describing my problem clearly or I'm not understanding your suggestion.
The fact is my phone works correctly, it is not bricked. Right now I'm booting MIUI 8. My system partition is alright. My problem is my storage partition (the emulated SD card with all my personal data in it) got deleted, and I'm trying to get it back.
And the layout I had when my storage partition was available was not the stock one, but was already altered by me, as in storage was smaller in order to make more room for userdata (more apps). So, restoring stock layout would not give me my storage's previous start and end points.
k, now I understand your issue! If you want to recover data from a damaged (in this case non-existent) storage partition, have you tried any linux recovery programs (those may be your only option) though I'm not sure how many of them are designed to work with an eMMC.
Or is it the case that you don't care anything about recovering your personal data and just want to fix the storage partition, so the Mi2 file-manager recognizes it?
>> 2T? Seriously?
Yes, that's normal. I've observed even on MediaTek based devices that the partition tables leave that much extra space on the /storage partition (which is typically the last) though its actual physical size is just 2-3GB. You either got the starting/ending points of /storage partition in your MBR/GPT tables wrong (CHS/LBA numbers) or it is just a case of formatting this partition so that the Mi2 recognizes it. In that case, you can just try formatting it to FAT32 or something (but remember that you will loose all your personal data in that case).
Indeed my whole concern is trying to recover what was on it. For all I know, there's the possibility everything was wiped the instant MiFlash destroyed my storage partition, but since no new filesystem was written on it I'm not abandoning hope.
What I did was dump my eMMC to work on it using Linux restore programs (testdisk, mainly), but something must have gone wrong when dumping it. I will try to save the correct partition table and feeding it to TestDisk, but somehow I get the idea this won't solve my problem.
Is there anyway to get the eMMC's geometry parameters to input them manually in TestDisk?
The card is described by parted as "MMC SEM32G", and the parameters I can change are cylinder geometry (number of cylinders, default 3812), head geometry (number of heads: 1-255, default 255), sector geometry (numbers of sectors per track: 1-63, default 63) and sector size.
> What should I do? Should I manually push the su binary in /system/bin? Where should I take su? From my PC?
If you were still unable to take the dump for want of the su binary, then here is an easier way to disk dump the partitions without requiring the su binary at all, but you'll need the CWM image of your Mi2 device:
1. Start phone in Fastboot mode by long-pressing DnVolume+Start buttons.
2. Connect to USB Cable (ensure adb drivers and fastboot are installed).
3. Run this command: fastboot boot /path/to/CWM.img
4. Once phone boots into CWM, adb commands will work! Just mount the system partition in RW.
5. Using adb shell take the dump (you won't be needing root now since the partitions are in RW mode):
dd if=/dev/block/mmcWhatEver of=/sdcard/whatEver.img
EDIT
And if for some reason this doesn't work and you absolutely MUST copy the su binary, you can get the latest zip from the ChainFire.eu site, unzip the su binary and SuperSu.apk files and push the former in /system/xbin/su and the latter in /system/app folders using adb.
Of course, you'll have to provide correct permissions to the su binary, enable the setuid bit on it and finally symlink it to /bin/su.
I got the su binary by letting CWM recovery root my device. However, issuing commands with su copies just the first few bytes. In particular:
Code:
adb shell /system/xbin/su -c "dd if=/dev/block/mmcblk0" | pv | dd of=/media/Storage/mmcblk0.raw
Get 38B, while
Code:
adb shell su -c "cat /dev/block/mmcblk0" | pv > /media/Storage/mmcblk0.raw
Gets 25B.
Anyway, I can't use your suggestion: I don't have an /sdcard partition on my phone anymore: it's the one I'm trying to recover (the last 25.7GB without any filesystem in the partition table I posted in the OP). I must dump them on my PC.

Categories

Resources