[Question] Converting MTD Partition(s): yaffs2 -> ext2/3/4 - Android Software/Hacking General [Developers Only]

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

Related

Boot loop Unresolvable? Hardware problem?

Hey all, new to xda. Hope I'm not asking stupid questions.
My friend gave me a Galaxy S to fix. Model: GT-I9003.
It has a boot loop problem, cycling the Samsung introduction animation (and sound first time round). The recovery mode didn't work to start with - also trapped in a boot loop.
I followed the instructions here (using Odin3 v1.85) and flashed XXKPE. It seemed to all work fine, but the boot loop remained. I booted it into recovery mode and the following error messages appear.
E:failed to mount /data (No such file or directory)
Click to expand...
Click to collapse
and under -- Wiping data...
E:format_volume: rfs format failed on /dev/block/mmcblk0p3
Click to expand...
Click to collapse
then
Data wipe failed.
Click to expand...
Click to collapse
From my research I believe it's a corrupted internal SD-Card and is fixed via parted? Could anyone go into more detail on how I would do this?
Many thanks.
I am facing a similar problem on my Galaxy SL... Need a solution too... I would appreciate any help...
Data partition has been corrupted, try flashing userdata.rfs with heimdall. A friend of mine had an stock/untouched phone and this happened to it, even with the corrupted partition i was able to boot cyanogenmod, and tried a lot of things, but nothing worked, it was on warranty, so i flashed back the original firmware and he took it to the service center.
If you want to try do this:
Flash bam kernel PDA_BCK_CF-root_universal_beta14fix.tar (http://forum.xda-developers.com/showthread.php?t=1355675)
Then from CWM flash cyanogenmod (i used cm7, but you can try with cm9)
after that the phone should boot into cyanogemod and give an error on the notification bar
extract the 6 files off the zip i attached and copy them to /xbin
from terminal emulator or adb shell run this for the 6 files:
Code:
chmod 0755 <file>
then run:
Code:
parted /dev/block/mmcblk0 mkfs ext2
When it asks for the partition number, enter 3
finally reboot, and if it worked you can flash a stock rom again, thats it, good luck
My phone boots up, but there are random reboots. Tried a lot of stock and custom ROMs... Nothing works... Warranty expired last week...
Thanks for your time. I appreciate it.
bruisedcrow said:
Thanks for your time. I appreciate it.
Sorry, I'm very new at this - my first hour doing this kind of thing. Could you explain the procedure in more detail - I would like to learn (make the best of a bad situation).
Am I right to say that the Bam Custom Kernel gives super-root level privileges? Allowing the CWM to fiddle with partions?
I've downloaded the normalboot.img for BCK. How do I flash this to my device? Could you link me to a tutorial?
EDIT: Alternatively could you point me to all the prerequisites I need to properly understand the problem and the methods required to fix it?
Click to expand...
Click to collapse
I tried that... My phone was booting up...
I have Android SDK on my PC... It includes some tools like ADB.
If your phone is rooted, you can use ADB to do things, like formatting...
Connected my phone. Booted into recovery. From Command Prompt, I went to ADB folder, then typed "adb shell". Then, typed in the parted command, and followed steps. Successfully done...
But the problem continues...
I have found many other users have faced this problem -- http://forum.xda-developers.com/showthread.php?t=1736118
I am disappointed. My phone is no longer in warranty... I am too late...
it is possible that using cyanogenmod and S2E (simple2ext) will work as a workaround until you send it to service center.
grab a copy of s2e and push it to /system/app/
Repartition your External-SD using the same method used for phones with low storage capacity, warning: it will erase all the data in it, so make backups
Start s2e and mark to move:
App and Private app
Applications data
Dalvik and download cache
This makes another partition, and it does not fix data, but at least you should be able to install apps.
I face this problem too. Please someone give us the solution.
Update: I flashed BAM Custom Kernel and put it in recovery mode. Attached it to the computer, but I'm stuck at this error message.
Thanks again.
More information
EDIT: There doesn't seem to be a /data partition at all! I feel I'm getting closer to fixing this.
There are 2 storages chips on this phone, one is mmc and the other is onenand.
I think the mmc chip is dead... it contains both /data and internal-SD, the onenand still works, it contains (system cache and dbdata), you can still use the phone with cyanogenmod if you mount everything that should go on /data on a partition in the external-SD, (the method i described with s2e). However there are some drawbacks, the SD needs to be class 6 or above to maintain the system speed, and the life of the sd is going to be reduced because of the more intensive use.
alfrix said:
There are 2 storages chips on this phone, one is mmc and the other is onenand.
I think the mmc chip is dead... it contains both /data and internal-SD, the onenand still works, it contains (system cache and dbdata), you can still use the phone with cyanogenmod if you mount everything that should go on /data on a partition in the external-SD, (the method i described with s2e). However there are some drawbacks, the SD needs to be class 6 or above to maintain the system speed, and the life of the sd is going to be reduced because of the more intensive use.
Click to expand...
Click to collapse
Thanks. Is there a way to replace the mmc chip without sending it to Samsung?
I've flashed XXFPE then Bam Custom Kernel then when I try install cm7 from CWM it gives:
Checking state of RFS/EXT4...
assert failed: run_program("/tmp/updater.sh") == 0
E: Error in /emmc/update-cm-7.1.0-GalaxySL-Kang-singed.zip
(Status 7)
Installation aborted.
Trying with MIUI instead.
EDIT: MIUI does this too.
How do I get around this? Can't I flash cm7 via Odin like the stock roms?
bruisedcrow said:
Thanks. Is there a way to replace the mmc chip without sending it to Samsung?
I've flashed XXFPE then Bam Custom Kernel then when I try install cm7 from CWM it gives:
Checking state of RFS/EXT4...
assert failed: run_program("/tmp/updater.sh") == 0
E: Error in /emmc/update-cm-7.1.0-GalaxySL-Kang-singed.zip
(Status 7)
Installation aborted.
Trying with MIUI instead.
EDIT: MIUI does this too.
How do I get around this? Can't I flash cm7 via Odin like the stock roms?
Click to expand...
Click to collapse
I think that the problem is when /tmp/updater.sh tries to mount /emmc your internal memory (EDIT: I've just noticed you tried with CM7, so, if I remember correctly, /emmc is the external memory, but I think that the problem is always the impossibility to mount the internal memory.) to backup your /efs directory. Because of the not avaible internal memory (/emmc) it simply exits and aborts the installation.
A simple change in updater.sh will allow you to install CyanogenMod, but wait for a confirmation from alfrix, maybe there's something more.
Anyway here there's a thread of a user with the same problem, he solved this by using the external SD as internal SD, as alfrix suggested.
strange, before touching anything try with the release i used that time (14.12.2011), if it doesn't work, then edit the updater.sh and remove
Code:
if ! /tmp/busybox mount -t ext4 /dev/block/mmcblk0p3 /data ; then
/tmp/busybox umount /data
/tmp/make_ext4fs -b 4096 -g 32768 -i 8192 -I 256 -a /data /dev/block/mmcblk0p3
fi
EDIT: is there any mmcblk on /dev/block?
Code:
ls /dev/block/
Weird the has mmcblk0 reappeared.
Code:
~ # ls /dev/block
ls /dev/block
bml0!c bml6 loop6 ram13 ram9 stl6 tfsr2
bml1 bml7 loop7 ram14 stl1 stl7 tfsr3
bml10 bml8 mmcblk0 ram15 stl10 stl8 tfsr4
bml11 bml9 mmcblk0p1 ram2 stl11 stl9 tfsr5
bml12 loop0 platform ram3 stl12 tfsr0!c tfsr6
bml13 loop1 ram0 ram4 stl13 tfsr1 tfsr7
bml2 loop2 ram1 ram5 stl2 tfsr10 tfsr8
bml3 loop3 ram10 ram6 stl3 tfsr11 tfsr9
bml4 loop4 ram11 ram7 stl4 tfsr12
bml5 loop5 ram12 ram8 stl5 tfsr13
So I tried
Code:
C:\Users\Bruised>adb shell
~ # /sbin/parted /dev/block/mmcblk0 mkfs ext2
/sbin/parted /dev/block/mmcblk0 mkfs ext2
Warning: The existing file system will be destroyed and all data on the
partition will be lost. Do you want to continue?
/sbin/parted: invalid token: ext2
Yes/No? y
y
y
Partition number? 3
3
3
Error: Partition doesn't exist.
~ #
That mmcblk is you externalSD its 0 because the internal is missing/broken and it has only 1 partition, because you didn't do the Repartition yet.
Sent from my GT-I9003 using xda app-developers app
alfrix said:
That mmcblk is you externalSD its 0 because the internal is missing/broken and it has only 1 partition, because you didn't do the Repartition yet.
Sent from my GT-I9003 using xda app-developers app
Click to expand...
Click to collapse
What should I try next? 14.12.2011 download link is down.
try with this:
https://dl.dropbox.com/u/5013311/test_for_broken_mmc_cm-9-20120626-UNOFFICIAL-galaxysl.zip
alfrix said:
try with this:
https://dl.dropbox.com/u/5013311/test_for_broken_mmc_cm-9-20120626-UNOFFICIAL-galaxysl.zip
Click to expand...
Click to collapse
It installs it.
Code:
Checking state of RFS/EXT4...
Install from sdcard complete.
After I reboot CM9 boot screen loads then I get "Encryption unsuccessful" as shown here
After rebooting I get
Code:
CWM-based Recovery v5.5.0.4
Formatting /data...
E:format_volume: make_extf4fs failed on /dev/block/mmcblk0p3
Formatting /cache...
Data wipe failed.
Heres the log file from the sdcard:
Code:
+ /tmp/busybox test -e /sdcard/backup/efs/nv_data.bin
+ /tmp/busybox mount -t ext4 /dev/block/stl9 /system
+ /tmp/busybox mount -t ext4 /dev/block/stl10 /dbdata
+ /tmp/busybox mount -t ext4 /dev/block/stl11 /cache
+ /tmp/busybox umount -l /system
+ /tmp/busybox umount -l /cache
+ /tmp/busybox umount -l /data
umount: can't forcibly umount /data: Invalid argument
+ /tmp/busybox umount -l /dbdata
+ /tmp/busybox umount -l /efs
umount: can't forcibly umount /efs: Invalid argument
+ exit 0

Where is the kernel image on an Android device

On a typical Linux system the kernel exists as a file vmlinuz-* (often in /boot). Where is the kernel image on an Android device? On my physical device (Samsung Galaxy Tabl 10.1 WiFi) and emulators, I don't see it anywhere.
Thanks.
unclestoner said:
On a typical Linux system the kernel exists as a file vmlinuz-* (often in /boot). Where is the kernel image on an Android device? On my physical device (Samsung Galaxy Tabl 10.1 WiFi) and emulators, I don't see it anywhere.
Thanks.
Click to expand...
Click to collapse
On android its a zImage and is found in the boot partition. In custom roms its generally found in boot.img
HypoTurtle said:
On android its a zImage and is found in the boot partition. In custom roms its generally found in boot.img
Click to expand...
Click to collapse
Thanks. On my Samsung Galaxy Tab 10.1 WiFi, I don't see any boot partition and there is no file name "zImage" anywhere on the device. Is it possible that the boot loader mounts a partition to load the kernel, but then the kernel itself doesn't mount its own partition?
Code:
C:\>adb -d shell
[email protected]:/ $ su
su
[email protected]:/ # ls boot
ls boot
boot: No such file or directory
[email protected]:/ # df
df
Filesystem Size Used Free Blksize
/dev 362M 76K 362M 4096
/mnt/asec 362M 0K 362M 4096
/mnt/obb 362M 0K 362M 4096
/system 568M 560M 8M 4096
/cache 440M 11M 429M 4096
/data 13G 463M 12G 4096
/efs 11M 4M 7M 4096
/mnt/sdcard 13G 463M 12G 4096
[email protected]:/ # find . -name "*zImage*"
find . -name "*zImage*"
[email protected]:/ # find . -name "*zimage*"
find . -name "*zimage*"
[email protected]:/ #
unclestoner said:
Thanks. On my Samsung Galaxy Tab 10.1 WiFi, I don't see any boot partition and there is no file name "zImage" anywhere on the device. Is it possible that the boot loader mounts a partition to load the kernel, but then the kernel itself doesn't mount its own partition?
Click to expand...
Click to collapse
I'm in no way a dev, but know a thing or two. The ROM is built/installed onto NAND, which is split into partitions, primarily boot, system, cache and data. And the boot partition won't be available to adb.
I d'loaded a custom ROM for the Galaxy Tab yesterday to take a look, and you can see the boot.img which can be opened to see the zImage. If you have busybox installed you do have some options to flash the boot partition on the fly and possibly able to pull it, or you can use something like Rom dump which I don't have experience of but should work.
(ROM I downloaded was an alpha jelly build and if you take a look there is a system folder which will be copied into the system partition and a boot.img which is copied to the boot partition, then there may be a cache partition, and any remaining space in NAND becomes the data partition).
unclestoner said:
Thanks. On my Samsung Galaxy Tab 10.1 WiFi, I don't see any boot partition and there is no file name "zImage" anywhere on the device. Is it possible that the boot loader mounts a partition to load the kernel, but then the kernel itself doesn't mount its own partition?
Code:
C:\>adb -d shell
[email protected]:/ $ su
su
[email protected]:/ # ls boot
ls boot
boot: No such file or directory
[email protected]:/ # df
df
Filesystem Size Used Free Blksize
/dev 362M 76K 362M 4096
/mnt/asec 362M 0K 362M 4096
/mnt/obb 362M 0K 362M 4096
/system 568M 560M 8M 4096
/cache 440M 11M 429M 4096
/data 13G 463M 12G 4096
/efs 11M 4M 7M 4096
/mnt/sdcard 13G 463M 12G 4096
[email protected]:/ # find . -name "*zImage*"
find . -name "*zImage*"
[email protected]:/ # find . -name "*zimage*"
find . -name "*zimage*"
[email protected]:/ #
Click to expand...
Click to collapse
Apart some dirs ( /system, /data, /cache, /efs ) that are mounted fs, and some links...
what you see in / is mounted by boot/kernel, or populated during init.
If you do cat /proc/partition/ you'll see a list of block devices ...
some of this are the FS you mounted, some are internal memory partition not mounted ... between this should be boot and recovery (i.e. the kernels of normal start mode and recovery mode). Between this radio kernel, bootloaders - pay attention .
This is what i know on my samsung devices, hope it works for yours...
stepph said:
Apart some dirs ( /system, /data, /cache, /efs ) that are mounted fs, and some links...
what you see in / is mounted by boot/kernel, or populated during init.
If you do cat /proc/partition/ you'll see a list of block devices ...
some of this are the FS you mounted, some are internal memory partition not mounted ... between this should be boot and recovery (i.e. the kernels of normal start mode and recovery mode). Between this radio kernel, bootloaders - pay attention .
This is what i know on my samsung devices, hope it works for yours...
Click to expand...
Click to collapse
Thanks. Now I see the paritions represented as block devices in /dev/block. I tried mounting the partitions that were not already mounted using filesystem type "ext4", and was only able to mount one of them. Assuming the other partitions have the main kernel, the recovery kernel, etc, should I be able to mount them? How does one know what filesystem is on the partitions?
unclestoner said:
Thanks. Now I see the paritions represented as block devices in /dev/block. I tried mounting the partitions that were not already mounted using filesystem type "ext4", and was only able to mount one of them. Assuming the other partitions have the main kernel, the recovery kernel, etc, should I be able to mount them? How does one know what filesystem is on the partitions?
Click to expand...
Click to collapse
It's not quite that easy.
It is the kernel implementing file system such as ext4, hence the kernel itself does not live on an ext4 partition (the bootstrap problem).
The kernel and the root file system in the form of an initramfs is combined into an image stored in the boot partition. The boot loader unpacks this image, creates the root file system in ram (tmpfs, rootfs) and starts the kernel. Because of this, you'll never see your kernel binary in any of your mounted file systems, and you can not mount the boot image because it's not a regular file system.
To extract your kernel, get hold of the boot image either from your device, or maybe easier, by downloading your firmware here from XDA or so. Then split this image into the kernel and initramfs using a tool such as split_bootimg.pl. Now you've got your kernel binary along with the initramfs root file system.
See thread http://forum.xda-developers.com/showthread.php?t=1477845
The boot partition has to be the first one on the device.
It's probably a simple file system like vfat.
There will be a simple bootloader that only uses SOC RAM.
Then there will be a more comprehensive loader that uses external RAM.
The kernel may be in a single file or split between image and ramdisk.
On my device it's MLO, u-boot.bin, uImage, uRamdisk on /dev/block/mmcblk0p1
kuisma said:
It's not quite that easy.
It is the kernel implementing file system such as ext4, hence the kernel itself does not live on an ext4 partition (the bootstrap problem).
The kernel and the root file system in the form of an initramfs is combined into an image stored in the boot partition. The boot loader unpacks this image, creates the root file system in ram (tmpfs, rootfs) and starts the kernel. Because of this, you'll never see your kernel binary in any of your mounted file systems, and you can not mount the boot image because it's not a regular file system.
To extract your kernel, get hold of the boot image either from your device, or maybe easier, by downloading your firmware here from XDA or so. Then split this image into the kernel and initramfs using a tool such as split_bootimg.pl. Now you've got your kernel binary along with the initramfs root file system.
See thread http://forum.xda-developers.com/showthread.php?t=1477845
Click to expand...
Click to collapse
Hmm, sounds like I have a lot to learn...
One thing I'm curious about: does the description you give apply to a normal Linux desktop distro? On my Ubuntu 10.10 system I do see the kernel binary in /boot. And looking at the output of "mount", /boot isn't a special filesystem...it's just a directory in the root file system which is ext4. In the past on other systems I've replaced the /boot/vmlinuz-* binary with one I built, and upon rebooting the system that new kernel was used. So I guess the bootloader was reading the vmlinuz-* kernel binary from the ext4 file system.
Doesn't this imply the bootloader has support to mount the ext4 file system in order to load the kernel binary?
On my Ubuntu desktop system I see vmlinuz-* is ~4MB and initrd-* is ~8MB. Why not just compile everything into vmlinuz-* and have it be ~12MB?
Code:
[email protected]:/$ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
<snip>
[email protected]:/$ ls -la /boot
total 15164
-rw-r--r-- 1 root root 8362756 2012-07-18 08:19 initrd.img-2.6.32-38-generic
-rw-r--r-- 1 root root 4061376 2012-01-04 06:57 vmlinuz-2.6.32-38-generic
<snip>
unclestoner said:
Doesn't this imply the bootloader has support to mount the ext4 file system in order to load the kernel binary?
Click to expand...
Click to collapse
GRUB is a more capable and more complex boot loader than the one Android use. GRUB loads in several stages, and stage one is quite similar to Android reading a raw image. Then they differs, GRUBs starts stage two capable of reading real file systems, but Android kick-starts the kernel directly using the initramfs file system.
unclestoner said:
On my Ubuntu desktop system I see vmlinuz-* is ~4MB and initrd-* is ~8MB. Why not just compile everything into vmlinuz-* and have it be ~12MB?
Click to expand...
Click to collapse
vmlinuz is the kernel, initrd the (initial) root file system. Different things. You'll need the kernel to access the root file system. In Android they are bundled, but in a trivial way so the loader can separate them itself without the need of implementing an entire file system.

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?

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

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.

Categories

Resources