• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Proposal/Theory for External SD storage solution on F6

After using the new setup for while, I am encountering slow down and freezes. Maybe my Class 10, 32GB Kingston microSDHC card is not fast enough. Had to uninstall and went back to original memory setup.

Original firmware. It was installed using TWRP.

If i'm not mistaken, you want a card with high RANDOM read/write speed. I dont think the class rating has to with the random speed. Im pretty sure i read that somewhere in this thread. I think the guy who started this thread said it. Which reminds me, whatever happened to jvene? Did he die? kidnapped by pirates? buried in an avalanche? Did lg and metro take him out for helping us with our phones?get stuck in an alternate universe? We should have sent out a search party....
 
Upvote 0
Thanks to all for giving feedback and reporting issues.

I got two apps that won't connect to the internet to download the additional files they need. They worked before this mod, but not since I got this mod working. I'm on the Carbon Rom, KK 4.4.4.
If you don't care about saving the app's progress, you can try to clear app cache and app data. Perhaps even try to uninstall and then reinstall. My guess is when the apps were installed, they detected insufficient primary storage and used secondary storage (fat32 on SD) to store extra files. But with expanded primary storage, they are now confused. There may be a way to save app data, reinstall, and then restore app data, but I don't know for sure.

I'm on carbon as well this script breaks the kernal and I followed everything
I know you've solved the problem already, but I'll make a comment about the issue here. Kernel crashes and kernel panics are bugs in the kernel. They should really not happen in a stable system. My scripts and binary used in this hack don't modify the kernel or the boot image. If a script triggers a kernel crash, the bugs are already there. My guess is that your partition wasn't formatted properly as ext4 (rather than ext2/3) and the kernel had a problem dealing with it, or that the file system on the partition was missing some features needed by KitKat's SELinux security features. One reason a lot of mods/hacks that have worked in JB but fail in KK is SELinux. If you've followed the thread, then you might notice I had to make some extra effort to get the hack working in KK and TWRP (which is based on KK's boot environment).

After using the new setup for while, I am encountering slow down and freezes. Maybe my Class 10, 32GB Kingston microSDHC card is not fast enough. Had to uninstall and went back to original memory setup.
Like I've said before (#179, #251, #301, etc.), one of the prerequisites is to use a card with fast random r/w performance, like a Samsung or SanDisk. There may be other brands, but Samsung and SanDisk are two brands with well-known great random r/w characteristics. You can try to run a benchmark on your SD card (e.g. Advanced benchmarking with random I/O test using A1 SD Bench), I think you'll find the random write performance of your card lower than that of the internal storage. Just for comparison, a class 6 Samsung I have has better random I/O write performance than the phone's internal storage. A class 10 Samsung I'm using now is even better.

Another thing is SD cards don't support trim (neither does 4.1.2 JB), so as the SD gets used, writes get slower. Cards with good firmware and good garbage collection algorithm should perform better in this regard. Unfortunately, there isn't too much information or testing on this topic.

One question I have is how can I tell when the copying of all the files is finished?
Nice SD card you got there.

Thanks for letting me know about the issue with MiniTool. Maybe MiniTool was using GPT instead of MBR. Maybe it didn't create the partition in the right ordering. I'm not going to try to find out what the problem was, now that you've figured out another way to deal with the problem. If people are having problems with partitioning, I can maybe look into making a script to do partitioning right on the phone.

If you didn't interrupt the file copying process or observe failure during the process, the copying was most likely okay. It's possible something went wrong in the process, like an I/O error caused by bad memory. But if you have that problem, your phone will probably misbehave anyway, and there isn't a lot my script can do. To check files are copied, like ksjd0414 said, you can check the sizes of space usage right before and right after. The space taken up by the files should be nearely identical before and after.
 
Upvote 0
Thanks to all for giving feedback and reporting issues.

Nice SD card you got there.

Thanks for letting me know about the issue with MiniTool. Maybe MiniTool was using GPT instead of MBR. Maybe it didn't create the partition in the right ordering. I'm not going to try to find out what the problem was, now that you've figured out another way to deal with the problem. If people are having problems with partitioning, I can maybe look into making a script to do partitioning right on the phone.

If you didn't interrupt the file copying process or observe failure during the process, the copying was most likely okay. It's possible something went wrong in the process, like an I/O error caused by bad memory. But if you have that problem, your phone will probably misbehave anyway, and there isn't a lot my script can do. To check files are copied, like ksjd0414 said, you can check the sizes of space usage right before and right after. The space taken up by the files should be nearely identical before and after.

I must have missed the reboot as everything appears to be working and the phone seems a bit faster now. Prior to attempting the mod, I uninstalled every app that I could and removed most pics, videos and such to make the copy process as quick as possible. Combined with a fast SD card, I'm guessing that the copy process didn't take long.

I purposely bought that memory card with this mod in mind. It was $30something but I figured that it wasn't worth the risk going with a cheapo card.

I attempted to partition the card with 20 gig for pics and photos and 10 gig for internal storage and apps. Since that was my first time using Apart I don't know if I partitioned it to the MB as the instructions said.

Below are screen shots of my storage.

I have since installed a bunch of apps so that is why so much memory is now used.

2014-11-17-22-47-12_zpsczi9wyc6.jpg


2014-11-17-22-47-55_zpsmco8awyv.jpg
 
Upvote 0
If you don't care about saving the app's progress, you can try to clear app cache and app data. Perhaps even try to uninstall and then reinstall. My guess is when the apps were installed, they detected insufficient primary storage and used secondary storage (fat32 on SD) to store extra files. But with expanded primary storage, they are now confused. There may be a way to save app data, reinstall, and then restore app data, but I don't know for sure.

I did try several combinations of that, no dice. Day off tomorrow, I'll be copying all files from storage space on SD card. Then completely starting over with my SD card. It's a class 10 Samsung, 16 gigs. We'll see if there is something buggered up after that.

Several apps, like Slacker Radio and Facebook work fine. I came across the two games mentioned previously, as well as Waze, so far, that didn't want to access internet to download additional data to function.
 
Upvote 0
Frogggy, did you create the ext4 file system (i.e. format the partition)? What did you use to make the partition? That's my guess, and if so, fix the problem in your partitioning software. Remember to make it a primary partition (not extended nor logical).

If you want to format the partition on the phone, it's possible. Assuming you're running the stock LG firmware, there's a command to do it. First make sure you do indeed have the partition with:
Code:
ls -l /dev/block/mmcblk1p*
You should see both mmcblk1p1 and mmcblk1p2. Most likely you should see only those two. If you see exactly mmcblk1p1, mmcblk1p2, and mmcblk1p5, then most likely your ext4 partition ends up being a logical drive and not a primary partition. In this case, you need to repartition.

If your partitions are okay and you only need to format the partition, you can do it on the phone. BE CAREFUL with the next step. It has the potential to mess up your SD and/or the phone's internal storage if you don't type the command correctly! To format the 2nd partition on the SD card (i.e. /dev/block/mmcblk1p2, the "1" means external SD and the "2" means 2nd primary partition. mmcblk0 means the internal storage, so DO NOT MESS IT UP):
Code:
make_ext4fs /dev/block/mmcblk1p2
The partition should be mountable after the ext4 file system is created.

I hope this makes sense to you and it fixes your issue. If not, let me know. Good luck.
 
Upvote 0
I followed your instructions and now i got the No such file or directory when trying to mount. tried everything and still no success. Both partitions are ok but no luck. Please Help




C:\ADB Files>adb shell
shell@android:/ $ su
su
root@android:/ # mount -t ext4 -o nosuid,nodev /dev/block/mmcblk1p2 /mnt/asec/te
mp2
dev/block/mmcblk1p2 /mnt/asec/temp2 <
mount: No such file or directory
255|root@android:/ # ls -l /dev/block/mmcblk1p*
ls -l /dev/block/mmcblk1p*
brw------- root root 179, 33 2014-11-23 15:08 mmcblk1p1
brw------- root root 179, 34 2014-11-23 15:08 mmcblk1p2
root@android:/ # make_ext4fs /dev/block/mmcblk1p2
make_ext4fs /dev/block/mmcblk1p2
Creating filesystem with parameters:
Size: 15728640000
Block size: 4096
Blocks per group: 32768
Inodes per group: 8144
Inode size: 256
Journal blocks: 32768
Label:
Blocks: 3840000
Block groups: 118
Reserved block group size: 943
Created filesystem with 11/960992 inodes and 102519/3840000 blocks
root@android:/ # mount -t ext4 -o nosuid,nodev /dev/block/mmcblk1p2 /mnt/asec/te
mp2
dev/block/mmcblk1p2 /mnt/asec/temp2 <
mount: No such file or directory
255|root@android:/ #
 
Upvote 0
WarrantyVoider and ALL the others that contributed

THANK YOU !!!

really appreciate everyone's' efforts
Finally got this to work. First
several attempts kept failing, finally figured out that somehow my SDcard's partition scheme got corrupted. re-formatted with mini-part and all is good.

Now to figure out how to back this up, so that if something goes poof, it won't take me a 1/2 day to get my phone set back up again.

That and I'm looking at the other ROMs but not sure if any are worth switching to-stock metro seems to do everything I need

Thanks again
 
  • Like
Reactions: WarrantyVoider
Upvote 0
Warranty can you please upload the zips again they got deleted during the forum move. Would it be ok to start a fresh thread with instructions for JB and KK
Looks like the files are restored now.

Now to figure out how to back this up, so that if something goes poof, it won't take me a 1/2 day to get my phone set back up again.
You should be able to put the SD card in a PC and make a partition image with partitioning/imaging software. TWRP supposedly is able to backup the sd-ext partition, but I don't know if it works correctly. Besides, it doesn't make sense to store backup on the other partition because if the SD card goes bad, you lose both your data and the backup. It's possible to make a special tool for this purpose, but that's an idea for another time.
 
Upvote 0
I followed your instructions and now i got the No such file or directory when trying to mount. tried everything and still no success. Both partitions are ok but no luck. Please Help
When you did "mount -t ext4 -o nosuid,nodev /dev/block/mmcblk1p2 /mnt/asec/temp2", you probably forgot to create the directory "/mnt/asec/temp2" beforehand. So make it first.
Code:
mkdir /mnt/asec/temp2
mount -t ext4 -o nosuid,nodev /dev/block/mmcblk1p2 /mnt/asec/temp2
Doing this is just to see if the partition is mountable. Since make_ext4fs was able to create the file system, the partition is probably okay now. So you should be able to go ahead and install the hack. Go through the diagnostic procedure again if the hack still fails to work. Let me know if you need more thorough instructions.
 
Upvote 0
Is there a final version, or was that it?
Can this be made into an apk file and be put onto app stores?
If not, can it all be ever be combined into a single flashable zip?
The current version seems to work for quite a few people. I wouldn't call it the final version, because there are a few more advanced, experimental things I might offer. I haven't decided if those are actually beneficial to other users though.

This can probably be made into an apk. But right now I'm focused on other projects, so doing an apk is not high on my priority list. Even if an apk is made, it probably won't be in the app store. This hack (the binary version) messes with an Android system file, so Google probably wouldn't like it.

As for a single flashable zip. I doubt it. The recovery's scripting engine (edify) is severely limited. I see no way to get user input to make a more interactive script. It might be possible to create a custom script interpreter, but that seems like a lot of work for little gain. Right now I've deliberately made separate zips so users can apply "-copy", "-install", or "-uninstall" as needed. This way, I don't think the users get confused what the scripts do. If you think it makes more sense to have a single zip, feel free to try to convince me.
 
Upvote 0
WarrantyVoider tried that and then i got


C:\ADB Files>adb shell
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
shell@android:/ $ su
su
root@android:/ # mkdir /mnt/asec/temp2
mkdir /mnt/asec/temp2
root@android:/ # mount -t ext4 -o nosuid,nodev /dev/block/mmcblk1p2 /mnt/asec/te
mp2
dev/block/mmcblk1p2 /mnt/asec/temp2 <
mount: No CSI structure available
255|root@android:/ #

Tried TWRP recovery after and didnt work either
 
Last edited:
Upvote 0
Tried TWRP recovery after and didnt work either
What did you use to partition the SD card? I'm guessing the partitions are causing your problem. I'd suggest redoing them to see if that solves the problem. Repartitioning will destroy all data on the SD card, so backup first if needed.

Since you have TWRP installed, you can actually partition the SD card with TWRP (choose ext4 and no swap). Unfortunately, TWRP's partitioning software does not align partitions. If you don't care about that, using TWRP's GUI is probably the easiest way.

If you want to do partition alignment on the phone itself, I can post instructions to do it manually using TWRP and ADB.

TWRP comes with 2 tools to manipulate the partition table: fdisk and parted. The issue with fdisk is you need to do some math calculations yourself. The issue with parted is the old version included with TWRP has a bug that requires a workaround to get partition alignment. I'll go with parted for this post.

In TWRP, go into "Mount" and uncheck all partitions. Connect the USB cable if not already. Open an ADB window and type "adb shell". You should get a superuser prompt "#". Then:
Code:
~ # parted /dev/block/mmcblk1
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
Now you're inside parted with prompt "(parted)". The test card I'm using is 8GB. I'm going to make a 4GiB(GiB=1024*1024*1024 bytes) ext4 partition. The first fat32 partition will take the space in front of the ext4 partition. To see your existing partition table:
Code:
(parted) unit MiB print
unit MiB print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 7580MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
1  0.00MiB  4406MiB  4406MiB  primary  fat32  lba
2  4406MiB  7580MiB  3174MiB  primary  ext4
Here, MiB=1024*1024 bytes. If you can, let me know what the table says, in particular, Type and File system. I wonder if there's anything strange there. I think you have 2 partitions, 1 and 2 under Number. Delete them:
Code:
(parted) rm 1 rm 2 print
rm 1 rm 2 print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 7580MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
The table should be empty. Next, create partitions. I'll work around the aforementioned bug by making a dummy 1st partition:
Code:
(parted) mkpart primary fat32 1 2
mkpart primary fat32 1 2
(parted) mkpart primary ext4 -4GiB -1s
mkpart primary ext4 -4GiB -1s
(parted) print
print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 7580MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
1  0.03MiB  2.00MiB  1.97MiB  primary  lba
2  3484MiB  7580MiB  4096MiB  primary
In "mkpart primary ext4 -4GiB -1s", "-4GiB" specifies 4GiB from the back. So for a 15GiB ext4 partition, the line would be "mkpart primary ext4 -15GiB -1s". Adjust to your preferred size. Next, delete the dummy partition and create the actual fat32 partition:
Code:
(parted) rm 1
rm 1
(parted) mkpart primary fat32 4MiB -4GiB
mkpart primary fat32 4MiB -4GiB
(parted) print
print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 7580MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
1  4.00MiB  3484MiB  3480MiB  primary  lba
2  3484MiB  7580MiB  4096MiB  primary
Same deal with the "-4GiB" here. Adjust to the size you used earlier. Double check, showing sectors:
Code:
(parted) unit s print
unit s print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 15523840s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
1  8192s  7135231s  7127040s  primary  lba
2  7135232s  15523839s  8388608s  primary
Notice the 2nd partition starts right after the 1st partition ends and both start sectors are divisible by 8192. Partitioning is done. Type "quit". Next, create the file systems:
Code:
(parted) quit
quit
Information: You may need to update /etc/fstab.

~ # mkdosfs -v -F 32 /dev/block/mmcblk1p1
mkdosfs 3.0.12 (29 Oct 2011)
/dev/block/mmcblk1p1 has 4 heads and 16 sectors per track,
logical sector size is 512,
using 0xf8 media descriptor, with 7127040 sectors;
file system has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 6952 sectors, and provides 889138 clusters.
There are 32 reserved sectors.
Volume ID is c716e965, no volume label.
~ # make_ext4fs /dev/block/mmcblk1p2
Creating filesystem with parameters:
  Size: 4294967296
  Block size: 4096
  Blocks per group: 32768
  Inodes per group: 8192
  Inode size: 256
  Journal blocks: 16384
  Label:
  Blocks: 1048576
  Block groups: 32
  Reserved block group size: 255
Created filesystem with 11/262144 inodes and 34891/1048576 blocks
~ # exit
After file systems are created, you should be able to proceed with installation. Hopefully everything is clear and it works for you. Let me know what happens. Good luck.
 
Last edited:
Upvote 0
What did you use to partition the SD card? I'm guessing the partitions are causing your problem. I'd suggest redoing them to see if that solves the problem. Repartitioning will destroy all data on the SD card, so backup first if needed.

Since you have TWRP installed, you can actually partition the SD card with TWRP (choose ext4 and no swap). Unfortunately, TWRP's partitioning software does not align partitions. If you don't care about that, using TWRP's GUI is probably the easiest way.

If you want to do partition alignment on the phone itself, I can post instructions to do it manually using TWRP and ADB.

TWRP comes with 2 tools to manipulate the partition table: fdisk and parted. The issue with fdisk is you need to do some math calculations yourself. The issue with parted is the old version included with TWRP has a bug that requires a workaround to get partition alignment. I'll go with parted for this post.

In TWRP, go into "Mount" and uncheck all partitions. Connect the USB cable if not already. Open an ADB window and type "adb shell". You should get a superuser prompt "#". Then:
Code:
~ # parted /dev/block/mmcblk1
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
Now you're inside parted with prompt "(parted)". The test card I'm using is 8GB. I'm going to make a 4GiB(GiB=1024*1024*1024 bytes) ext4 partition. The first fat32 partition will take the space in front of the ext4 partition. To see your existing partition table:
Code:
(parted) unit MiB print
unit MiB print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 7580MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
1  0.00MiB  4406MiB  4406MiB  primary  fat32  lba
2  4406MiB  7580MiB  3174MiB  primary  ext4
Here, MiB=1024*1024 bytes. If you can, let me know what the table says, in particular, Type and File system. I wonder if there's anything strange there. I think you have 2 partitions, 1 and 2 under Number. Delete them:
Code:
(parted) rm 1 rm 2 print
rm 1 rm 2 print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 7580MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
The table should be empty. Next, create partitions. I'll work around the aforementioned bug by making a dummy 1st partition:
Code:
(parted) mkpart primary fat32 1 2
mkpart primary fat32 1 2
(parted) mkpart primary ext4 -4GiB -1s
mkpart primary ext4 -4GiB -1s
(parted) print
print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 7580MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
1  0.03MiB  2.00MiB  1.97MiB  primary  lba
2  3484MiB  7580MiB  4096MiB  primary
In "mkpart primary ext4 -4GiB -1s", "-4GiB" specifies 4GiB from the back. So for a 15GiB ext4 partition, the line would be "mkpart primary ext4 -15GiB -1s". Adjust to your preferred size. Next, delete the dummy partition and create the actual fat32 partition:
Code:
(parted) rm 1
rm 1
(parted) mkpart primary fat32 4MiB -4GiB
mkpart primary fat32 4MiB -4GiB
(parted) print
print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 7580MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
1  4.00MiB  3484MiB  3480MiB  primary  lba
2  3484MiB  7580MiB  4096MiB  primary
Same deal with the "-4GiB" here. Adjust to the size you used earlier. Double check, showing sectors:
Code:
(parted) unit s print
unit s print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 15523840s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
1  8192s  7135231s  7127040s  primary  lba
2  7135232s  15523839s  8388608s  primary
Notice the 2nd partition starts right after the 1st partition ends and both start sectors are divisible by 8192. Partitioning is done. Type "quit". Next, create the file systems:
Code:
(parted) quit
quit
Information: You may need to update /etc/fstab.

~ # mkdosfs -v -F 32 /dev/block/mmcblk1p1
mkdosfs 3.0.12 (29 Oct 2011)
/dev/block/mmcblk1p1 has 4 heads and 16 sectors per track,
logical sector size is 512,
using 0xf8 media descriptor, with 7127040 sectors;
file system has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 6952 sectors, and provides 889138 clusters.
There are 32 reserved sectors.
Volume ID is c716e965, no volume label.
~ # make_ext4fs /dev/block/mmcblk1p2
Creating filesystem with parameters:
  Size: 4294967296
  Block size: 4096
  Blocks per group: 32768
  Inodes per group: 8192
  Inode size: 256
  Journal blocks: 16384
  Label:
  Blocks: 1048576
  Block groups: 32
  Reserved block group size: 255
Created filesystem with 11/262144 inodes and 34891/1048576 blocks
~ # exit
After file systems are created, you should be able to proceed with installation. Hopefully everything is clear and it works for you. Let me know what happens. Good luck.

I used minitool partitioning. please post instructions so i can use TWRP and ADB thanks.
 
Upvote 0
What did you use to partition the SD card? I'm guessing the partitions are causing your problem. I'd suggest redoing them to see if that solves the problem. Repartitioning will destroy all data on the SD card, so backup first if needed.

Since you have TWRP installed, you can actually partition the SD card with TWRP (choose ext4 and no swap). Unfortunately, TWRP's partitioning software does not align partitions. If you don't care about that, using TWRP's GUI is probably the easiest way.

If you want to do partition alignment on the phone itself, I can post instructions to do it manually using TWRP and ADB.

TWRP comes with 2 tools to manipulate the partition table: fdisk and parted. The issue with fdisk is you need to do some math calculations yourself. The issue with parted is the old version included with TWRP has a bug that requires a workaround to get partition alignment. I'll go with parted for this post.

In TWRP, go into "Mount" and uncheck all partitions. Connect the USB cable if not already. Open an ADB window and type "adb shell". You should get a superuser prompt "#". Then:
Code:
~ # parted /dev/block/mmcblk1
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
Now you're inside parted with prompt "(parted)". The test card I'm using is 8GB. I'm going to make a 4GiB(GiB=1024*1024*1024 bytes) ext4 partition. The first fat32 partition will take the space in front of the ext4 partition. To see your existing partition table:
Code:
(parted) unit MiB print
unit MiB print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 7580MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
1  0.00MiB  4406MiB  4406MiB  primary  fat32  lba
2  4406MiB  7580MiB  3174MiB  primary  ext4
Here, MiB=1024*1024 bytes. If you can, let me know what the table says, in particular, Type and File system. I wonder if there's anything strange there. I think you have 2 partitions, 1 and 2 under Number. Delete them:
Code:
(parted) rm 1 rm 2 print
rm 1 rm 2 print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 7580MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
The table should be empty. Next, create partitions. I'll work around the aforementioned bug by making a dummy 1st partition:
Code:
(parted) mkpart primary fat32 1 2
mkpart primary fat32 1 2
(parted) mkpart primary ext4 -4GiB -1s
mkpart primary ext4 -4GiB -1s
(parted) print
print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 7580MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
1  0.03MiB  2.00MiB  1.97MiB  primary  lba
2  3484MiB  7580MiB  4096MiB  primary
In "mkpart primary ext4 -4GiB -1s", "-4GiB" specifies 4GiB from the back. So for a 15GiB ext4 partition, the line would be "mkpart primary ext4 -15GiB -1s". Adjust to your preferred size. Next, delete the dummy partition and create the actual fat32 partition:
Code:
(parted) rm 1
rm 1
(parted) mkpart primary fat32 4MiB -4GiB
mkpart primary fat32 4MiB -4GiB
(parted) print
print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 7580MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
1  4.00MiB  3484MiB  3480MiB  primary  lba
2  3484MiB  7580MiB  4096MiB  primary
Same deal with the "-4GiB" here. Adjust to the size you used earlier. Double check, showing sectors:
Code:
(parted) unit s print
unit s print
Model: SD SU08G (sd/mmc)
Disk /dev/block/mmcblk1: 15523840s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags
1  8192s  7135231s  7127040s  primary  lba
2  7135232s  15523839s  8388608s  primary
Notice the 2nd partition starts right after the 1st partition ends and both start sectors are divisible by 8192. Partitioning is done. Type "quit". Next, create the file systems:
Code:
(parted) quit
quit
Information: You may need to update /etc/fstab.

~ # mkdosfs -v -F 32 /dev/block/mmcblk1p1
mkdosfs 3.0.12 (29 Oct 2011)
/dev/block/mmcblk1p1 has 4 heads and 16 sectors per track,
logical sector size is 512,
using 0xf8 media descriptor, with 7127040 sectors;
file system has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 6952 sectors, and provides 889138 clusters.
There are 32 reserved sectors.
Volume ID is c716e965, no volume label.
~ # make_ext4fs /dev/block/mmcblk1p2
Creating filesystem with parameters:
  Size: 4294967296
  Block size: 4096
  Blocks per group: 32768
  Inodes per group: 8192
  Inode size: 256
  Journal blocks: 16384
  Label:
  Blocks: 1048576
  Block groups: 32
  Reserved block group size: 255
Created filesystem with 11/262144 inodes and 34891/1048576 blocks
~ # exit
After file systems are created, you should be able to proceed with installation. Hopefully everything is clear and it works for you. Let me know what happens. Good luck.
(windows) adb not connecting to phone while TWRP running
 
Upvote 0
@Frogggy
Hmm... So Windows driver doesn't include the correct id used in recovery mode. There are ways to deal with that... manually selecting the driver, or using a universal adb driver (google it). If you ever need to "adb sideload" in TWRP, you'd have to deal with the driver issue. For now, I pulled out the "parted" used in TWRP so you can do this in regular adb. I've already posted the instructions. Check inside the "spoiler."

On PC, unzip "parted" somewhere. Put it in an executable location on the phone using adb and make it executable:
Code:
adb push <parted file location on your PC> /data/local/tmp
adb shell
su
cd /data/local/tmp
chmod 777 parted
./parted /dev/block/mmcblk1
Then do the parted commands. When creating the fat32 file system, you can't use "mkdosfs" because that's only in TWRP. Instead, do "newfs_msdos":
Code:
newfs_msdos -F 32 /dev/block/mmcblk1p1
Afterwards, clean up by deleting "parted" before exiting adb:
Code:
rm /data/local/tmp/parted
exit
exit

I've run through the full TWRP instructions myself to get the output, but instructions in this post, I'm only going by memory. If I've made a mistake, I'll correct it later. Otherwise, good luck.

Edit: file removed.
 
Last edited:
Upvote 0
OK, it's probably best to start from the beginning. I'm going to assume your SD card is already properly partitioned (1st=fat32, 2nd=ext4).
Restore your backup.
Reboot into system to make sure it's fine.
Use the TWRP app to reboot into recovery.
(This step is normally not necessary, but let's do it to make sure nothing weird: Settings->check "use rm -rf..."->back to main screen->Wipe->Advanced Wipe->check only "sd-ext"->swipe to wipe->back to main screen->Settings->uncheck "use rm -rf..."->back to main.)
Install the new DataOnSD-copy.zip, hopefully no error this time.
Install the new DataOnSD-install.zip.
Reboot into system.

You should get no error after each step. The order of -install and -copy is not too important, but since you had trouble with copying, do that first this time. Copying would take a while. Let me know what happens. Good luck.

Ok got partitions lined up ok, now getting trouble with this part.
Copying data for DataOnSD Failed
Installed DataOnSD-install.zip seemed to have worked but not DataOnSD-copy.zip

Thanks so much for your help with this, awaiting your response.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones