Can't mount storage on sony xperia L. Hard brick Xperia L during repartition. - Sony Xperia L

here is what i did in my sony xperia L and now i anything that can help kindly let me know
I rooted my device and then i officially unlocked my bootloader but after unlocking bootloader the phone was stuck in bootlooop so i installed stock recovery in the phone using flashtool and phone was just fine then. I did all this in order to change the partition of my phone.
Now i installed cwm recovery and after that phone i did the following commands
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 when i restart my phone or even open the phone in cwm recovery it says cannot mount storage.
I tried installing the Rom again using flashtool it does not work and device gets disconnected probably coz now i am not able to mount my storage.
I tried to start adb shell and revert the changes i made in the above command in order to bring phone back to normal but now adb says no device is found.
I went to the customer service centre of sony they said they will change the motherboard.
Now my question is there any way i can fix my phone kindly tell me. I will really appreciate it Since i am not a software developer so i do not know any commands. Is there any way i can change my storage settings so they can be mounted again kindly let me know.

py.puneet said:
here is what i did in my sony xperia L and now i anything that can help kindly let me know
I rooted my device and then i officially unlocked my bootloader but after unlocking bootloader the phone was stuck in bootlooop so i installed stock recovery in the phone using flashtool and phone was just fine then. I did all this in order to change the partition of my phone.
Now i installed cwm recovery and after that phone i did the following commands
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 when i restart my phone or even open the phone in cwm recovery it says cannot mount storage.
I tried installing the Rom again using flashtool it does not work and device gets disconnected probably coz now i am not able to mount my storage.
I tried to start adb shell and revert the changes i made in the above command in order to bring phone back to normal but now adb says no device is found.
I went to the customer service centre of sony they said they will change the motherboard.
Now my question is there any way i can fix my phone kindly tell me. I will really appreciate it Since i am not a software developer so i do not know any commands. Is there any way i can change my storage settings so they can be mounted again kindly let me know.
Click to expand...
Click to collapse
Just a question here, why did you want to change the partition of your phone?_? And no there isnt a way to revert thats a hard brick

Changing the motherboard will be the quickest method for Sony, which will not cause any trouble for them. You could ask the price for doing a low level format and restoring the partitions etc. Though I don't if they can do this in this case.

Related

[Question] Converting MTD Partition(s): yaffs2 -> ext2/3/4

hi @all,
is there a way to convert a mtd partition to another filesystem?
i've tryed the following procedure:
1.) boot to recovery
2.) login to system via adb (adb shell)
3.) mke2fs -m 5 -b 4096 /dev/block/mtdblock1
at point 3, it gives errors and nothing is happen.
now, i've tryed to flash a ext3 filesystem on this partition via
flash_image system system.ex3.img (found a explanation on how to create a ex3 system.img), but after mounting the /dev/block/mtdblock1 on /system it shows still device as "yaffs2".
would be nice, if someone can explain me if it's definitvly not possible to convert
mtd partitions or tell me a short tip what can i test
ThX
Andy
An anything known about this in the last year BUMP

A2SD, partitioning and Nand Switching (internal to external) for Optimus 3D

Please someone more experienced than me check the prosedure!!! Till I remove this line go with extreme caution
I have an enormous amount of applications inherited from the partition-able optimus 2x. I got optimus 3D as an upgrade but I couldn’t intall not even half of them. So I was trying to find ways to repartition /data as I had done with optimus 2x but with no success.
Then I got an idea... why not A2SD style? So it begins
Disclaimer: Have in mind that I’ve done nasty stuff which could brick the phone badly. I take no responsibility for breaking your phone even if you follow my guide perfectly. I am no developer and I can make mistakes so please don’t continue if you don’t understand what I am telling you to do. Also be careful since I dont know how future lg updates will react
My composition is: Thiaiz Rom V0.1, clockworkmod touch, rooted ofc and I have installed most drivers found on this forum for o3d.
Before you begin get a backup of your internal memory, sd card, titanium backup and nand backup to a pc. You WILL loose internal memory data. The rest just to be safe....
Drawbacks: Your internal memory will be around 2-3gbs smaller and wont be able to be mounted to the pc. You could brick your phone.
While all these can be done with a cwm zip script I did it manually. Also since my phone works fine know and my time is short I dont really want to go to the reformating coping restoring backups again. This means that while I write this guide I dont actually run these command only checking them if they are correct.
Lets start.
First shutdown your phone. Open it to recovery by pressing down button and power for 7-8 seconds. Release when you see LG logo. While in recovery connect your device with the pc with a usb cable. Open command prompt on your windows pc and do a
adb shell
Now you are probably ready to send commands. If not use a guide like this http://www.addictivetips.com/mobile/what-is-adb-and-how-to-install-it-android/
at the shell do a
Code:
# cd /dev/block
#ls
you will see all your partitions. mmcblk0 is the internal memory and mmcblk1 is the sd card.
Code:
# parted mmcblk0
(parted) print
now you see the partitions
You should see something like this
Code:
Number Start End Size File system Name Flags
1 131kB 262kB 131kB x-loader
2 262kB 393kB 131kB nv1
3 393kB 524kB 131kB nv2
4 524kB 1049kB 524kB u-boot
5 1049kB 11.5MB 10.5MB kernel
6 11.5MB 22.0MB 10.5MB recovery
7 22.0MB 651MB 629MB ext3 system
8 651MB 1725MB 1074MB ext3 userdata
9 1725MB 1859MB 134MB fsswap
10 1859MB 1926MB 67.1MB ext3 cache
11 1926MB 1928MB 2097kB ext3 lgdrm
12 1928MB 1929MB 1049kB divxkey
13 1929MB 1950MB 21.0MB fota
14 1950MB 1955MB 4194kB ext3 misc
15 1955MB 7944MB 5989MB fat32 msftres
we are going to work on partition 15 starting by deleting it. Be very carefull here what you delete
Code:
(parted) rm 15
now we want to create 2 more partitions. The 1955-4944 and 4944-7944 will give you around 3gb for apps and 3gb for internal memory. Tweak it at your needs but always follow the numbers. I meant if your print gave you this output
Code:
15 1955MB 7945MB 2989MB fat32
use 7945 and not 7944
Code:
(parted) mkpartfs primary fat32 1955 4944
(parted) mkpartfs primary ext2 4944 7944
now the command print should give you two more partitions
Code:
15 1955MB 4944MB 2989MB fat32 msftres
16 4944MB 7944MB 3000MB ext2
quit parted to update the ext2 to ext3
Code:
(parted) quit
#mke2fs /dev/block/mmcblk0p16
#tune2fs -j /dev/block/mmcblk0p16
Now our phone is ready for A2SD. Reboot the phone.
After finish rebooting continue via adb or terminal (I used terminal because I was in a 3 hours trip with bus ) and es file explorer with root and rw options on
we need to tweak /etc/vold.fstab to change the mount points. You can change it with es file explorer
My file is:
Code:
dev_mount sdcard /mnt/sdcard auto /devices/platform/mmci-omap-hs.0/mmc_host/mmc1
dev_mount extsdcard /mnt/sdcard/_ExternalSD 15 /devices/platform/mmci-omap-hs.1/mmc_host/mmc0
then we need to create the mount point for our new partition. I did it at /mnt/a2sd but you can do it anyware including the standard /system/sd
Code:
#mkdir /mnt/a2sd
#mkdir /mnt/emmc
now we need to mout our new partition everytime the system starts. I opened /etc/init.d/thiaizSDbooster and added few lines
Code:
mkdir /mnt/a2sd
mount -w /dev/block/mmcblk0p16 /mnt/a2sd
mkdir /mnt/emmc
mount -w /dev/block/mmcblk0p15 /mnt/emmc
ln -s /mnt/a2sd/data/app /data/app
ln -s /mnt/a2sd/data/data /data/data
dont forget to make the correct permitions again after the edit
now you need to mount the new partition to your mount point
Code:
#mount -w /dev/block/mmcblk0p16 /mnt/a2sd
and copy the data files you will link there
Code:
#cp -a /data /mnt/a2sd
now careful youll delete the /data/app and /data/data from /data
Code:
#rm -r /data/app
#rm -r /data/data
and create the links
Code:
#ln -s /mnt/a2sd/data/app /data/app
#ln -s /mnt/a2sd/data/data /data/data
Reboot the phone and you are ready to go!
To mount the sd card to the pc you will need an app from market https://market.android.com/details?id=com.rafoid.multimountsdcard.widget.free
Look atached images for what you get
want to give it a try but I need to know if there is a way to revert back if anything goes wrong. Will a restore of a previous backup return things to normal?or flashing a kdz? thanx anyway.any try to improve our phones is worth praize...
jimakos29 said:
want to give it a try but I need to know if there is a way to revert back if anything goes wrong. Will a restore of a previous backup return things to normal?or flashing a kdz? thanx anyway.any try to improve our phones is worth praize...
Click to expand...
Click to collapse
Make a nand back-up in another sd card, if you re lucky and can still boot upto recovery then you can restore or you can boot to download mode. Last resort will be to flash a bin or kdz file then restore your nand back up.
I bricked my phone 5 times in one month 2 times in 1 day. I still figured how to restore, just relax and think before you do crazy stuff, all the answers are in XDA.
---------- Post added at 04:44 AM ---------- Previous post was at 03:49 AM ----------
@orlox tested it and gives me phone memory damage, forgot to pull the logs and do some ss, well anyways I won't be doing this one, I was setting up for the s2e and link2sd stuff -- that one is not that risky.
mtvtitan said:
tested it and gives me phone memory damage, forgot to pull the logs and do some ss, well anyways I won't be doing this one, I was setting up for the s2e and link2sd stuff -- that one is not that risky.
Click to expand...
Click to collapse
The "damage part" is because you probably didnt change the vold file. Its not something to worry. After you tell vold what partition to mount (15) it will be ok
orlox said:
The "damage part" is because you probably didnt change the vold file. Its not something to worry. After you tell vold what partition to mount (15) it will be ok
Click to expand...
Click to collapse
I figured that one...
have you finished the guide? all ok?
orlox said:
have you finished the guide? all ok?
Click to expand...
Click to collapse
not yet, got other stuff in hand... i'll try to report tom* its already 2am here and have work at 4am -- cooked.
I made a mistake somewhere and am stuck. Can't sleep now, I'll have to figure this thing thorough.
---------- Post added at 07:20 AM ---------- Previous post was at 07:12 AM ----------
btw you can try this --> install link2sd let it install the script needed to mount 2nd sd part, then edit it (init.d folder)
--> add this before mounting sdext2
sleep 2
mkdir /sd-ext
sleep 2
--> then after mounting sdext2 insert this
sleep 2
mount -o bind /data/sdext2 /sd-ext
-----------------------------------------
install s2e
move dl cache (dont move any apps, let link2sd do that)
reboot.
----------------------------------------------
works with thiaz boot image only
the risk is low and would not probably brick your phone but try it at your own risk (disclaimer) --> this is generic, do your mods.
any problems will discuss after I unbrick my phone lol.
Generic scripts are not working well. I was trying with dark tremors first. I think manual is safer. Also Someone may want to partition sd instead of nand. Its safer but I think its a waste of space.
The good thing is that parted works so we don't need a tool like nvflash. Also /data had a limit at 2GB I think. With a2sd there is no limit.

Clean Your File Systems!

Ok, lately we have had a rash of errors and undesired performance. In my opinion, this is unacceptable... So I am trying to fix it. Now, I can't fix every issue, but boy can I sure help most of them...lol
So let's get started. We will call this:
The File System Cleaner
Linux has a few tools for us to see if we have a "Dirty" or "Clean" filesystem.
They are tune2fs, e2fsck, and fsck_msdos.
Now, you can't use all of them for every file system or partition (we will refer to them all as partitions from here on out). Each one works on certain filesystems. For example, e2fsck works on ext type partitions where fsck_msdos works on vfat type partitions, and tune2fs only works on large partitions.
While tune2fs is a tool that gives detailed information about a partition, it can still give us an idea on where we stand on those larger partitions as well as change certain options/features on that partition such as journaling, mount point, mount as rw or ro, etc. But the biggest thing we are going to focus on is 1 line:
Code:
Filesystem state
If you run tune2fs and the filesystem state is anything other than clean, you have some sort of gremlin floating about it and it needs to be fixed. Now what about those partitions in which we get these errors:
t
Code:
tune2fs 1.41.11 (14-Mar-2010)
tune2fs: Attempt to read block from filesystem resulted in short read while trying to open /dev/block/mmcblk0p4
Couldn't find valid filesystem superblock.
1|[email protected]:/ # tune2fs -l /dev/block/mmcblk0p28
tune2fs 1.41.11 (14-Mar-2010)
tune2fs: Bad magic number in super-block while trying to open /dev/block/mmcblk0p28
Couldn't find valid filesystem superblock
It doesn't mean that they are corrupt. It means they are either not in a format that tune2fs can read or they are not a large partition.
So for those partitions that are not compatible with tune2fs, we can use fsck.
The fsck works much like scan disk and defrag in windows. It scans the partition for several different things like bad blocks, missing/corrupt information, etc. Although you can run tune2fs on any large partition whether it is mounted or not, you DO NOT want to fsck ANY partition that is mounted or it WILL result in TOTAL data LOSS! You have been warn!
Keep in mind all this information is at your own risk, but know that I have been using this for quite some time and it hasn't failed me yet. But then again, I follow my instructions to a TEE, as you should as well...
So, here's how we use all this.
First make sure you have adb installed on your computer
To be safe, boot into recovery, plug your phone into your computer and start adb shell
Now type:
Code:
mount /system
cp /system/bin/tune2fs /tmp
cp /system/bin/e2fsck /tmp
cp /system/bin/fsck_msdos /tmp
chmod -R 777 /tmp
cd tmp
Now that our tools are set, we can now begin cleaning house.
First and most important, make sure you umount ALL partitions.
I personally unmount them manually via mounts and storage in CWM.
In terminal (with adb running) type:
Code:
./tune2fs -l <partition>
./e2fsck <partition>
./fsck_msdos <partition>
**NOTE**If you have an error "/sbin/sh: <command>: not found" when executing one of these commands simply mount /system and copy to tmp, and chmod 777 again.**
For more information on the commands, run <command> -h. here you will see additional options for that command.
Now, I didn't break down which partitions work with tune2fs, but /system, /data, and /cache can be scanned with tune2fs.
However, I did break as to what partitions need which fsck command to be cleaned.
Code:
e2fsck
|mount point| |Filesystem type|
/dev/block/mmcblk0p21 /efs
/dev/block/mmcblk0p24 /system
/dev/block/mmcblk0p25 /data
/dev/block/mmcblk0p26 /cache
/dev/block/mmcblk0p27 /tombstones
/dev/block/mmcblk1p2 unknown
Code:
fsck_msdos
|mount point| |Filesystem type|
/dev/block/mmcblk0p4 fsinfo
/dev/block/mmcblk0p13 /system/etc/firmware/misc
/dev/block/mmcblk0p17 /system/etc/firmware/misc_mdm
/dev/block/mmcblk0p28 emmc
/dev/block/mmcblk1p1 /sdcard
Example:
Code:
/tmp # e2fsck /dev/block/mmcblk0p24
e2fsck 1.41.12 (17-May-2010)
/dev/block/mmcblk0p24: clean, 4220/38320 files, 93625/153088 blocks
This should resolve many of your laggy performance and random reboot issues. As well as the issue of freezes after a reboot.
If you are a flash addict, tuning your partitions between flashes my be a GREAT idea...
If you do not have those binaries in your ROM, let me know and I will upload them here...
Now, there is a little more destructive way to clean a partition, and that is to reformat it. Most of us format /system /cache and dalvik in CWM before flashing, but sometimes that isn't enough. All CWM does is erase the files/folders contained in one of those partitions.
Here's how we do a complete reformat:
Reboot to recovery, plug phone in and start adb shell
Type:
Code:
mount /system
cp /system/bin/make_ext4fs /tmp
chmod 777 /tmp/make_ext4fs
mount <system, data or cache partition>
./make_ext4fs <partition>
This only works with ext4 partitions, so use it ONLY on these:
Code:
/dev/block/mmcblk0p24 /system
/dev/block/mmcblk0p25 /data
/dev/block/mmcblk0p26 /cache
I know there are other ext partitions, like tombstone and efs, but DO NOT use this command on them. You may BRICK or damage your device. I will say this again, ONLY DO THIS on data, cache, system!
**NOTE** If you format system partition, you WILL have to flash your ROM and Gapps again...
I have not had windows on this pc for over 2 years now and I think ADB is MS only right? I do flash a lot but I normally run ultimate kernel cleaning script and plus run the wipes a couple times myself and sumtimes format cache partitons before I install a new rom.... I like to make sure I do most I can to clean before I flash...and I always run the LZ kernel Cause its AWESOME!! but I guess my question is how can I look to see if my partitons need to be cleaned.. on AOKP with LZ kernel at moment and it is smooth fast and no bugs or reboots. is there a way to vew the partitions with ubuntu 12.04? or dose ubuntu even need ADB... linux seems very good at haveing the right drivers and software already available without installing to many extras.
not even sure your a linux desktop user but thought I would go ahead and ask.
Many thanks for everything
woodyjlw said:
I have not had windows on this pc for over 2 years now and I think ADB is MS only right? I do flash a lot but I normally run ultimate kernel cleaning script and plus run the wipes a couple times myself and sumtimes format cache partitons before I install a new rom.... I like to make sure I do most I can to clean before I flash...and I always run the LZ kernel Cause its AWESOME!! but I guess my question is how can I look to see if my partitons need to be cleaned.. on AOKP with LZ kernel at moment and it is smooth fast and no bugs or reboots. is there a way to vew the partitions with ubuntu 12.04? or dose ubuntu even need ADB... linux seems very good at haveing the right drivers and software already available without installing to many extras.
not even sure your a linux desktop user but thought I would go ahead and ask.
Many thanks for everything
Click to expand...
Click to collapse
Yeah, I'm completely windows free too...YAY! lol
You still need to install the adb binary/command and put it in your path. The good news is, it's very simple in Linux, unlike wincrapdows...
And then just follow the tutorial to check your partitions...

[Q] Mount loop device on rooted android devices

I have been trying to mount an image file on my device with no success. The image was created on a linux PC with dd and formated with a DOS partition table and a single ext2 partition. All three devices I have tried this on do not find the partition (should be /dev/block/loop5p1 according to fdisk on the android device).
Code:
busybox losetup /dev/block/loop5 /sdcard/m.img
busybox mount -t ext2 /dev/block/loop5 /sdcard/mnt
This returns invalid argument, probably because it is not a partition.
Code:
busybox losetup /dev/block/loop5 /sdcard/m.img
busybox mount -t ext2 /dev/block/loop5p1
This returns device not found because android will not find the partitions.
Is there a way to make this image mount or could I create a file system on the image without a partition table (mkfs.ext2 /dev/block/loop5) and try to mount it?
I have got the image to mount on one device by making a filesystem on the image without a partition table
Code:
mkfs.ext3 /dev/loop0
and mounted it successfully on the device by using
Code:
busybox mount /dev/block/loop0 /sdcard/mnt/
however on one of the other devices the same thing results in only the cd and ls commands being able to see the mounted files (not chroot or other android apps).
Is there anything I'm doing wrong or is it just the device?

Nexus 5 32GB shows only 12.55GB. Cannot Use Stock Recovery, gets stuck on formating.

I'm having the issue of missing storage with a 32GB phone.
Trying the instructions here - https://forum.xda-developers.com/showpost.php?p=47156078&postcount=2
The issue is the stock recovery doesn't seem to work for me. When you go to recovery mode with it flashed it gets stuck on the android symbol standing up with the spinning gear. I've left this overnight for over 10 hours.
I can resolve this if I flash TWRP recovery which then enables the phone to boot into android setup properly but it then reverts back to the issue of missing storage.
32 become 16 GB, the last last last attempt to solve the issue
Quote:
Originally Posted by GioVIP
i did just like you said but got again 16 instead of 32
Click to expand...
Click to collapse
I was in the same situation, metod 1, metod 2 any method to fix it did not work
I've solved it by doing this (make this at your own risk, FIRST be sure that your emmc is not damaged):
root your device, and put parted binary ( find it in the forum) in system/bin with execution permission.
Then reboot in twrp recovery, then in twrp recovery terminal or in adb root shell, type this :
Code:
Code:
mount system
umount /dev/block/mmcblk0p28
parted /dev/block/mmcblk0
check 28
it should say something like
Code:
Code:
Error: The backup GPT table is not at the end of the disk, as it should be.
This might mean that another operating system believes the disk is smaller.
Fix, by moving the backup to the end (and removing the old backup)?
Fix/Ignore/Cancel? Fix
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be
used, you can fix the GPT to use all of the space (an extra xxxxxx blocks) or
continue with the current setting?
Fix/Ignore?Fix
answer Fix and Fix.
now type:
Code:
Code:
print
the last two partitions should be:
Code:
28 2032MB 15.8GB 13.7GB userdata
29 15.8GB 15.8GB 5632B grow
if EVERYTHING is like that, let's make a try, type:
Code:
Code:
mkpart primary ext4 15.8GB 25.8GB name 30 trypart
name 30 trypart
print
if you can make trypart without errors and you can see trypart with the print command then
you can proceed to the next step, that will ERASE your data ( worse your userdata partition, before recreating it), type:
Code:
Code:
rm 30
rm 29
rm 28
mkpart primary ext4 2032140288B 31268511743B name 28 userdata
name 28 userdata
mkpart primary 31268511744B 31268517375B name 29 grow
name 29 grow
print
you should see the userdata partition with the new size, and the grow partition after.
Exit from parted by typing
Code:
Code:
quit
Now reboot in fastboot mode and from pc terminal type:
Code:
Code:
fastboot format userdata
ok reboot (wait it take its time) it should be solved.
16 to 32
1.Flash stock rom
2.Wait for opening
3.Reset ur nexus 5 (using options in setting app)
4.*important* Reset when phone boot completely..

Categories

Resources