method to set 0123-4567 as mount point for removable sdcard - General Questions and Answers

This is a very annoying issue but I have not found any thread about it.
I'm trying to upgrade my external/removable sdcard for an android 6 device.
The new sdcard gets mounted to /mnt/media_rw/XXXX-XXXX (i.e. not 0123-4567), so no app works as files can't be found.
The linux way (ln) wont work. Simply creating /mnt/media/0123-4567 causes bad bootloop on my device. This suggests that FolderMount app or Magisk modules such as fbind are a bad idea. selinux is enforcing.
It appears that Android assigns different mount points are to different sdcards and the first sdcard always gets 0123-4567. It that's right, Android probably stores sdcards' identifiers so as to know which mount point to use at boot time. So, deleting the identifiers database would probably mean that the next card inserted would get 0123-4567 as mount point.
I have looked at the data of com.android.externalstorage, but there is nothing there. I don't see other obvious candidate apps.
Where is this ext sdcard data stored?

I was wrong. Android sets mount points matching sdcard uuid
How to change vfat partition UUID?
How do I change the UUID of a vfat partition? For ext2 / ext3 / ext4, this is done with a simple: tune2fs -U <new-uuid> /dev/<partition> Is there a similar command for vfat partitions?
superuser.com

Related

[DEV] Someone ever tried an "init.d/rc0.d" script on Android ?

While messing around with ext2 and data2ext i noticed that android doesn't umount the sd-ext partition (Vold process unmounts the fat partition just fine as it can be seen with logcat). Also cyanogen states the same in this posting (Im wasn't sure on this but i don't doubt him EDIT: i doubt him now ... ).
I wonder now why the recommended solution for file corruption issues is using ext3/4 (wich slows things down due to the journal and reduces the lifetime of flashdrives due to limited r/w cycles) instead of just make a shutdown script wich unmounts the ext partition? (About lifetime: I think 10.000-100.000 r/w cycles is a rather high value and lifetime is only a theoretical and not a practical issue - but im not sure on this)
Since i'm not really expirenced in scripting on either linux or android i wanted to ask if a script in "init.d/rc0.d" (+"init.d/rc6.d" for reboot) would be possible? I could write one but i don't know if this would be executed and i actually don't know how i could check if it works (i think logcat would be shutdown before this is done).
Edit: At least if rc0.d scripts are run BEFORE logcat stops it doesn't work. Logcat log is empty if i "grep test" an "echo "test"" script.
Need help. Someone ...
melethron said:
While messing around with ext2 and data2ext i noticed that android doesn't umount the sd-ext partition (Vold process unmounts the fat partition just fine as it can be seen with logcat). Also cyanogen states the same in this posting (Im wasn't sure on this but i don't doubt him ).
I wonder now why the recommended solution for file corruption issues is using ext3/4 (wich slows things down due to the journal and reduces the lifetime of flashdrives due to limited r/w cycles) instead of just make a shutdown script wich unmounts the ext partition? (About lifetime: I think 10.000-100.000 r/w cycles is a rather high value and lifetime is only a theoretical and not a practical issue - but im not sure on this)
Since i'm not really expirenced in scripting on either linux or android i wanted to ask if a script in "init.d/rc0.d" (+"init.d/rc6.d" for reboot) would be possible? I could write one but i don't know if this would be executed and i actually don't know how i could check if it works (i think logcat would be shutdown before this is done).
Click to expand...
Click to collapse
Does /system/bin/shutdown get called to turn off the phone?
Logcat looks like its the last thing to stop
coutts99 said:
Does /system/bin/shutdown get called to turn off the phone?
Logcat looks like its the last thing to stop
Click to expand...
Click to collapse
Code:
adb logcat | grep /system/bin/shutdown > ~/shutdowntest.log
Empty file
Although the file is present in ROM's so maybe it IS called after logcat stops. But i don't know if it's added to Custom ROMs and if it's also present in RUU's.
If it's not called do you see any possibility to use "Vold" process? Cause it does the unmounting:
Code:
I/Vold ( 145): /mnt/secure/staging/.android_secure sucessfully unmounted
I/Vold ( 145): /mnt/secure/asec sucessfully unmounted
I/Vold ( 145): /mnt/secure/staging sucessfully unmounted
I/Vold ( 145): /mnt/sdcard unmounted sucessfully
D/Vold ( 145): Volume sdcard state changing 5 (Unmounting) -> 1 (Idle-Unmounted)
melethron said:
Code:
adb logcat | grep /system/bin/shutdown > ~/shutdowntest.log
Empty file
Although the file is present in ROM's so maybe it IS called after logcat stops. But i don't know if it's added to Custom ROMs and if it's also present in RUU's.
If it's not called do you see any possibility to use "Vold" process? Cause it does the unmounting:
Code:
I/Vold ( 145): /mnt/secure/staging/.android_secure sucessfully unmounted
I/Vold ( 145): /mnt/secure/asec sucessfully unmounted
I/Vold ( 145): /mnt/secure/staging sucessfully unmounted
I/Vold ( 145): /mnt/sdcard unmounted sucessfully
D/Vold ( 145): Volume sdcard state changing 5 (Unmounting) -> 1 (Idle-Unmounted)
Click to expand...
Click to collapse
hmm, interesting. Maybe have to poke through the source and see what is called to shutdown the phone.
Sent from my HTC Desire using XDA App
coutts99 said:
hmm, interesting. Maybe have to poke through the source and see what is called to shutdown the phone.
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
I think this would be a major improvement. Since journaling is actually bad for sd's. Im not sure on this, but the journal is in some specific area on the filesystem. If this is the case I'm not sure if algorithms used to distribute r/w on flash drives will help if the journal gets overwritten (as i understand it so far the r/w is distributet over FREE space but not if something gets overwriten). If this is the case the part of the SD with the journal will be stressed heavy.
I've been playing around with data2sd with ext2 for a few weeks now.
I might be wrong but I think that the system is unmounting cleanly /data (and not /dev/block/mtdblock5) because I always have a clean e2fsck log after rebooting the phone.
So basically if you mount something under the /data mountpoint, it won't be cleanly unmounted and you'll end-up with corrupted FS. That what happens for A2SD because /data is still /dev/block/mtdblock5. But if you mount straight over /data, like I do with DATA2SD, the system unmounts /data on shutdown, witch is now your ext partition (whether your ext partition or a file on ext partition mounted via a loop device) and your FS is not corrupted. In that case you don't need journaling and can stick with ext2.
sibere said:
I've been playing around with data2sd with ext2 for a few weeks now.
I might be wrong but I think that the system in unmounting cleanly /data (and not /dev/block/mtdblock5) because I always have a clean e2fsck log after rebooting the phone.
So basically if you mount something under the /data mountpoint, it won't be cleanly unmounted and you'll end-up with corrupted FS. That what happens for A2SD because /data is still /dev/block/mtdblock5. But if you mount straight over /data, like I do with DATA2SD, the system unmounts /data on shutdown, witch is now your ext partition (whether your ext partition or a file on ext partition mounted via a loop device) and your FS is not corrupted. In that case you don't need journaling and can stick with ext2.
Click to expand...
Click to collapse
Im pretty sure for 3 reasons that it doesnt unmount data:
1. Android unmounts "/sdcard" as it can be seen in logcat while other stuff isn't unmounted. It may be still that the other unmount stuff is not not by the "Vold" process. Sdcard needs to be able to get unmounted when the phone is plugged to usb.
2. I also did quite a lot testing with sd-ext directly mounted to /data and i did get quite a lot corruption. But it is situation depended. If my phone was "idle" i didn't get corruption (1 time in 20 reboots) with no corruption. Then to make absolutly sure that it works i shut it down right after it boots up. There is many stuff running then wich means there is a much higher chance that something is still written while it shutdowns. Doing this i had corruption every 3rd reboot.
3. And this is the most important reason why you didn't get corruption but i did : You use sync as a mount option so you there is no need to unmount it ^^ !!!!
Sync is not an option for me for some reason:
-No cache will slowdown write on small files heavily
-Without cache every other process has to wait if some writing is done (lags).
-Much more wear for the sd since small files aren't cached
Using ext2 with sync isn't an option for me. Either i get ext2 with a proper unmount to work or i'll use Ext4 with an "ordered" journal then (or maybe i give a s*** about data2ext then).
melethron said:
Im pretty sure for 3 reasons that it doesnt unmount data:
1. Android unmounts "/sdcard" as it can be seen in logcat while other stuff isn't unmounted. It may be still that the other unmount stuff is not not by the "Vold" process. Sdcard needs to be able to get unmounted when the phone is plugged to usb.
2. I also did quite a lot testing with sd-ext directly mounted to /data and i did get quite a lot corruption. But it is situation depended. If my phone was "idle" i didn't get corruption (1 time in 20 reboots) with no corruption. Then to make absolutly sure that it works i shut it down right after it boots up. There is many stuff running then wich means there is a much higher chance that something is still written while it shutdowns. Doing this i had corruption every 3rd reboot.
3. And this is the most important reason why you didn't get corruption but i did : You use sync as a mount option so you there is no need to unmount it ^^ !!!!
Sync is not an option for me for some reason:
-No cache will slowdown write on small files heavily
-Without cache every other process has to wait if some writing is done (lags).
-Much more wear for the sd since small files aren't cached
Using ext2 with sync isn't an option for me. Either i get ext2 with a proper unmount to work or i'll use Ext4 with an "ordered" journal then (or maybe i give a s*** about data2ext then).
Click to expand...
Click to collapse
To me, the main purpose with data2Sd was to get more storage with at least the same amount of performances than the original NAND. I found that, on top of the extra space I have now, I also have a very good performance, roughly the same as NAND on small files and a much better one on bigger files. And I'm not thinking about quadrant score here
Talking about the unmount, if I run an e2fsck -n on the ext2 file while it's in use by the system, I have a report of a few errors (like deleted inode with nodtime, or wrong count of free blocks) But if I shut down the phone and turn in on again, the e2fsck I run at boot reports no errors at all. I might be wrong but my guess is that there is a clean umount done at some stage...
What I am going to do is an other test. You know that when an ext2 partition is not umounted properly, a flag is activated and this ext2 partition must be checked, regardless of the number of mounts done before running a check. This flag can be check by running a tune2fs -l on the partition before mounting it. It is reported as well by the system that the partition hasn't been unmounted properly when you try to mount it and that it should be checked .
So If i turn off my phone, restart in recovery mode, run a tune2fs -l on the ext2 file or mount it manually, I should be able to see if the partition has been unmounted by the system or not before the actual reboot.
I'll report the results and let you know if I'm wrong
OK
I've just turned off my phone. rebooted in recovery, mounted the 2nd FAT32 partition and run a tune2fs -l ext2 (that's the name of my ext2 file mounted via a loop device over /data)
Here is the result:
Code:
tune2fs 1.40.8 (13-Mar-2008)
Filesystem volume name: userdata
Last mounted on: /data
Filesystem UUID: 296f98d0-21e8-48b6-82ac-6c94c4edf28d
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: ext_attr dir_index filetype sparse_super
Filesystem flags: unsigned_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 60800
Block count: 243056
Reserved block count: 0
Free blocks: 168874
Free inodes: 57516
First block: 0
Block size: 4096
Fragment size: 4096
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 7600
Inode blocks per group: 475
Filesystem created: Tue Dec 7 15:00:51 2010
Last mount time: Thu Dec 9 17:40:16 2010
Last write time: Thu Dec 9 21:16:43 2010
Mount count: 1
Maximum mount count: 21
Last checked: Thu Dec 9 17:40:10 2010
Check interval: 15552000 (6 months)
Next check after: Tue Jun 7 17:40:10 2011
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Default directory hash: half_md4
Directory Hash Seed: 8ff9238f-aef7-48a7-85e1-7d2d45b9e809
You can see that it's reporting that the system is clean. If the ext2 partition wasn't cleanly unmounted by the system at shutdown, it would never report as being clean.
Obviously, if I check the state now that, after booting to android, the FS is mounted over /data, it is reported as being unclean.
It's reporting 1 as mount count because I'm forcing an fsck on boot anyway.
This doesn't mean that I will never get errors tho. I even have some errors from time to time when I reboot my linux home server
melethron said:
-No cache will slowdown write on small files heavily
-Without cache every other process has to wait if some writing is done (lags).
-Much more wear for the sd since small files aren't cached
Using ext2 with sync isn't an option for me. Either i get ext2 with a proper unmount to work or i'll use Ext4 with an "ordered" journal then (or maybe i give a s*** about data2ext then).
Click to expand...
Click to collapse
Remember that there is no writeback cache (AFAIK) with YAFFS2
But I should try with sync off and see if the system is still "clean" after a shutdown. If the systems unmounts ext2 properly, then the cache should be flushed by the system before unmounting the filesystem.
sibere said:
OK
I've just turned off my phone. rebooted in recovery, mounted the 2nd FAT32 partition and run a tune2fs -l ext2 (that's the name of my ext2 file mounted via a loop device over /data)
You can see that it's reporting that the system is clean. If the ext2 partition wasn't cleanly unmounted by the system at shutdown, it would never report as being clean.
Obviously, if I check the state now that, after booting to android, the FS is mounted over /data, it is reported as being unclean.
It's reporting 1 as mount count because I'm forcing an fsck on boot anyway.
This doesn't mean that I will never get errors tho. I even have some errors from time to time when I reboot my linux home server
Click to expand...
Click to collapse
You are right about the "clean" flag being set while unmounted. But you forgot one thing. The "clean" flag must be cleared when the partition is mounted. You should check if it as also reported while it IS mounted .... if so mount doesn't write proberly to the superblock. I would do this myself but im on ext4 and afaik it isn't cleared on mount then. For me this far it shows also "clean" when it is mounted.
My guess that mount doesn't write the superblock proberly is also supported by the fact that your and my mount count both shows 1. This could be a coincidince (chance for this is 0,147928994083 %) but could also support my assumption.
So check again while you mounted your system.
EDIT: I completly agree with you that data2ext is about space. Considering speed i also expirienced that reading larger amounts of data from data/data is faster with data2ext. But i also expirienced some slowdown sometimes on ext 4. It was better on ext2 and with that im really fine.
Remount done: Mount count still 1. I bet you will also get clean when you mount your ext.
melethron said:
Since i'm not really expirenced in scripting on either linux or android i wanted to ask if a script in "init.d/rc0.d" (+"init.d/rc6.d" for reboot) would be possible? I could write one but i don't know if this would be executed and i actually don't know how i could check if it works (i think logcat would be shutdown before this is done).
Edit: At least if rc0.d scripts are run BEFORE logcat stops it doesn't work. Logcat log is empty if i "grep test" an "echo "test"" script.
Need help. Someone ...
Click to expand...
Click to collapse
i think that won't work with rc.0 as init.d script execution is initiated in
init.rc only for "before booting", its not as a "normal" linux init system
# Execute files in /etc/init.d before booting
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot
i wonder if a shutdown.rc could be populated, there is a shutdown.bravo.rc but its empty
for init-handling, in the kernel source its in system/core/init
but im not fit with c/c++ to look into
maybe the init binary would have to be modified by a kernel dev to enable shutdown.rc / also possible that htc has motified it to not to be used.
woti23 said:
i think that won't work with rc.0 as init.d script execution is initiated in
init.rc only for "before booting", its not as a "normal" linux init system
# Execute files in /etc/init.d before booting
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot
i wonder if a shutdown.rc could be populated, there is a shutdown.bravo.rc but its empty
for init-handling, in the kernel source its in system/core/init
but im not fit with c/c++ to look into
maybe the init binary would have to be modified by a kernel dev to enable shutdown.rc / also possible that htc has motified it to not to be used.
Click to expand...
Click to collapse
This would have been to easy ....
Well maybe some Kernel Dev will look into this.... coutts, sibere, anyone ... can you help ?
Btw: i still wonder why /system/bin/shutdown is present in ROMs if it's not used ....
melethron said:
This would have been to easy ....
Well maybe some Kernel Dev will look into this.... coutts, sibere, anyone ... can you help ?
Btw: i still wonder why /system/bin/shutdown is present in ROMs if it's not used ....
Click to expand...
Click to collapse
this works for the script that should be executed part
/system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/shutdown.d
runs every script which is in /system/etc/shutdown.d
if you create /system/etc/shutdown.d before
and put one or more executable script/s that do something in
melethron said:
You are right about the "clean" flag being set while unmounted. But you forgot one thing. The "clean" flag must be cleared when the partition is mounted. You should check if it as also reported while it IS mounted .... if so mount doesn't write proberly to the superblock. I would do this myself but im on ext4 and afaik it isn't cleared on mount then. For me this far it shows also "clean" when it is mounted.
My guess that mount doesn't write the superblock proberly is also supported by the fact that your and my mount count both shows 1. This could be a coincidince (chance for this is 0,147928994083 %) but could also support my assumption.
So check again while you mounted your system.
EDIT: I completly agree with you that data2ext is about space. Considering speed i also expirienced that reading larger amounts of data from data/data is faster with data2ext. But i also expirienced some slowdown sometimes on ext 4. It was better on ext2 and with that im really fine.
Remount done: Mount count still 1. I bet you will also get clean when you mount your ext.
Click to expand...
Click to collapse
Sorry mate, but, like I wrote in my previous post, it shows unclean when mounted.
Sent from my HTC Desire using XDA App
sibere said:
Sorry mate, but, like I wrote in my previous post, it shows unclean when mounted.
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
ROFL! I should learn to read proberly:
Obviously, if I check the state now that, after booting to android, the FS is mounted over /data, it is reported as being unclean.
Click to expand...
Click to collapse
Well thats actually good news thanks for helping me reading. ^^
Well so this isn't a problem. Now its time for ext4 (no loop) without journal mounted to data. About the loopdevice: you might wanna read what ownhere has to say about loop.
melethron said:
If it's not called do you see any possibility to use "Vold" process? Cause it does the unmounting:
Code:
I/Vold ( 145): /mnt/secure/staging/.android_secure sucessfully unmounted
I/Vold ( 145): /mnt/secure/asec sucessfully unmounted
I/Vold ( 145): /mnt/secure/staging sucessfully unmounted
I/Vold ( 145): /mnt/sdcard unmounted sucessfully
D/Vold ( 145): Volume sdcard state changing 5 (Unmounting) -> 1 (Idle-Unmounted)
Click to expand...
Click to collapse
http://android.git.kernel.org/?p=pl...2af4c72427ad069245d0aa572;hb=refs/heads/froyo
Some interesting stuff in this code here
coutts99 said:
http://android.git.kernel.org/?p=pl...2af4c72427ad069245d0aa572;hb=refs/heads/froyo
Some interesting stuff in this code here
Click to expand...
Click to collapse
i'm running this now on btrfs partition
/dev/block/mmcblk0p6** on /system/sd type btrfs (rw,relatime,ssd,noacl)
/dev/block/mmcblk0p6 5.2G 1.3G 3.9G 26% /system/sd
tmpfs 85.8M 24.0M 61.8M 28% /cache
a2sd btrfs *
d2sd btrfs *
dalvik-cache in /data mtd
cache in ram 90M
* without loop mounted img filesystem
** logical partition on extented partition
woti23 said:
i'm running this now on btrfs partition
/dev/block/mmcblk0p6** on /system/sd type btrfs (rw,relatime,ssd,noacl)
/dev/block/mmcblk0p6 5.2G 1.3G 3.9G 26% /system/sd
tmpfs 85.8M 24.0M 61.8M 28% /cache
a2sd btrfs *
d2sd btrfs *
dalvik-cache in /data mtd
cache in ram 90M
* without loop mounted img filesystem
** logical partition on extented partition
Click to expand...
Click to collapse
Running what now?
conventional (not froyo app2sd) a2sd + data2sd both on btrfs without loopmounted filesystem files
/data/dalvik-cache left in nand
/cache tmpfs in RAM
btrfs instead of ext4

[Q] SD Card will not mount after ext4 part.

Attempting to partition sd card with ext4 -a process I completed multiple times successfully on a Nexus One, the process appeared to complete but now the phone will not mount the sd card. I've tried a wipe/reset, to no avail. I can still access and partition the sd card through adb, but the phone cannot mount it to format/partition, restore from recovery, partition sd-card from within ClockWork Recovery, nothing. I've re-partitioned the sd card through adb, which indicated a successful completion, but the phone still refuses to mount the sd card. If this weren't a Nexus S with it's cursed internal sd-card I would simply swap out the sd card with another or format it externally like all the google topics I pull up on the subject suggest.
Is this fixable or has the fused sd-card scenario become a liability?
Common Error messages:
Can't mount /sdcard
Can't mount /sdcard/.android_secure
Phone: Nexus S (US, T-Mobile, manufactured Dec. '10)
Recovery Img: ClockworkMod Recovery 3.0.2.4
Rom: CM 7.0.3 (now wiped, cannot put back on since sd card won't mount)
fstab:
/dev/block/mtdblock4 /cache yaffs2 rw
/dev/block/platform/s3c-sdhci.0/by-name/userdata /data ext4 rw
/dev/block/platform/s3c-sdhci.0/by-name/system /system ext4 rw
/dev/block/platform/s3c-sdhci.0/by-name/media /sdcard vfat rw
Can mount everything except the last one, /sdcard.
I've tried all the recommended procedures garnered from the first 10 or so pages in google, xda, cyanogem forum, etc:
Restore from nandroid: Not possible, can't mount the SD,
Wipe/Reset: can't wipe /media as sd card won't mount,
partition sd card from within Clockwork: indicates success but does nothing,
format from within clockwork: unable to mount,
repartition using adb: works, parted can see them, I can move files to from, but the phone will not mount,
clearing fstab: no effect,
Fastboot works, but I don't have the proper images. ADB works, as do the installed utilities. Have not tried ODIN as again, I don't have the proper images. Should I attempt to compile my own images from source?
Update: SOLVED, Microsoft Windows. To whom it may concern: I was able to mount the /dev/block/platform/s3c-sdhci.0/by-name/media from two different laptops running OSX and Fedora/Ubuntu then successfully been able to partition them with fat32 as the ClockworkMod (and maybe Cyanogen?) expect with 0 progress. Then I pulled out an old Windows machine, installed the JDK/ADK's +tools and performed the same procedure and that time it worked. I'm uncertain as to what particular quality a 'genuine' Windows formatting provides, but either this phone or the particular software combination I'm running require it. I was able to mount & re-partition the /sdcard in Clockwork, then manually remove rebuild them and upgrade to ext4 using tune2fs as usual. In the interim for work and such, I had to find a surrogate (for the SIM) and could only find and old k750i (which still had a full charge and worked flawlessly all day, btw). Wow phones used to be small.
I think I was missing something about the way ClockworkMod handles fstab, because everytime I would modify it specifically to the specs I passed to parted while creating the partitions with mkpartfs, it would either ignore or overwrite them. So be careful messing with the sd-card, the S's aren't like the One's in the sense that if you screw it (the sd-card) up or it goes bad you can't just take it out and format it in another machine/phone, you have to appeal to ClockworkMod. ODIN $ucks by the way, I found fastboot to be much more effective.
If you format the sd partition ext4, then you should change the fstab too.
from
Code:
/dev/block/platform/s3c-sdhci.0/by-name/media /sdcard vfat rw
to from
Code:
/dev/block/platform/s3c-sdhci.0/by-name/media /sdcard ext4 rw
or from
Code:
/dev/block/platform/s3c-sdhci.0/by-name/media /sdcard auto rw
The 2nd last entry there is the file system type.
Likely, this would have solved your problem.
Of course, I don't know, whether the recovery has the vfat type in fstab. You might have to change it there too. On my linux box auto works very well in fstab.
Of course, if you partition your sd partition ext4, you won't be able to use it as usb memory from windows. (At least I am pretty sure you can't, haven't tried)
Well of course I couldn't let it die, I went back and started tinkering again now that I have a way back. I can't change the fstab it seems, whatever I change it to gets over written everytime either Clockwork or the Rom starts. It's weird, I know I'm missing something and I don't know much about CWMod. (had Amon_Ra on the N1, which had the nifty fsupgrade script)
The 2nd last entry there is the file system type.
Likely, this would have solved your problem.
Click to expand...
Click to collapse
I'm quite familiar with unix style fs and fstab, it's the stubbornness I'm not used to. I'm also spoiled by vi and nano. CW has some nice scripts built in as well though.

[IDEA] Need community help! A safer solution for memory woes on Marshmallow.

When I installed Android 5.0 and later 6.0 ROM on our Xperia L experience was much better than stock. These ROM's are simply fantastic! However, we have memory issues. Yeah we can use apps like Link2SD or foldermount, but that's too much of a hassle. Thet's not really a long-term solution.
The main problem is that /data partition is too small to handle modern app file sizes. It's only 1GB.
And /sdcard partition also exists (which is seperate from data) and represents internal memory - that's 4GB.
On top of that our phone has externalSD slot - /extSD option.
When you install an app it always directly installs to /data. Yeah you can move it. But still 1GB is not enough, somehow I keep getting not enough memory notification.
So the first solution by @Kahana82 was to repartition. That way we could remove 2GB from /sdcard and give it to /data. But the problem is that when we change partitions our phone gets bricked when stock ROM is flashed again.
But I have come across a new idea that could work. Just need community help for that as I am not that experienced.
So instead of repartitioning we could simply mount /SDCard as /data (just rename it!) and mount /data as /SDCard. That way we could increase /data from 1GB to 4GB and I think it is enough for basic app needs. And therefore flashing stock ROM should work as it is just change in kernel or system. Only 1GB internal memory wouldn't be a problem since Android 6.0 allows us to mount externalSD as internal memory.
Now how to do it. I have taken a look at this thread for 2011 Xperia Arc. Looks like ramdisk could be modified to do so as I see that mountpoint is there.
EDIT: OK, I've managed to unpack boot.img and ramdisk. Here's what I get:
fstab.qcom file
Code:
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#TODO: Add 'check' as fs_mgr_flags with data partition.
# Currently we dont have e2fsck compiled. So fs check would failed.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults recoveryonly
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check,encryptable=/persist/footer
/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs rw,nosuid,nodev,noatime,nodiratime,inline_xattr wait,formattable,check,encryptable=/persist/footer
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check
/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs rw,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check
/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel /recovery emmc defaults defaults
/devices/platform/msm_sdcc.1/mmc_host/mmc0* auto auto defaults voldmanaged=sdcard0:32,nonremovable,noemulatedsd
/devices/platform/msm_sdcc.3/mmc_host* auto auto nosuid,nodev voldmanaged=sdcard1:auto,encryptable=userdata
I propose another solution.
Format "SD 0" as EXT4.
Then mount during the boot of Android, "SD 0" as DATA partition.
Simply replace "date" with "SD 0" at the time of installation of partitions.
This does not alter the structure of partitions and would give the 4 GB device for apps installation.
I've done tests. It's easy to format using the TWRP "SD 0" as EXT4.
The same process is easy to reverse.
It is safe because it does not change the structure of the partitions. If there is any problem just restore the Stock ROM.
Soon just need help to know which Android configuration files need to change mount "SD 0 in EXT4" like the DATA unit.
The Xperia L pass from 1,57GB to 4 GB !!!
Help, please !!!!
All the MM ROMs for Xperia L should have Adoptable Storage. You could format a partition of your SD Card as Adoptable Storage (using Apps2SD). And you can then move most of the apps to that partition in its entirety. Apps downloaded from Play Store would automatically go to the Adopted Storage.
Only certain apps like WhatsApp and Maps would refuse to move. You could use Link2SD to force move such apps to Internal SD of your device. It will move a big part of it.
On older ROMs, you should be able to setup a partition of your SD as linkable storage, allowing Link2SD or Apps2SD to move the whole app to the partition.
DragonClawsAreSharp said:
All the MM ROMs for Xperia L should have Adoptable Storage. You could format a partition of your SD Card as Adoptable Storage (using Apps2SD). And you can then move most of the apps to that partition in its entirety. Apps downloaded from Play Store would automatically go to the Adopted Storage.
Only certain apps like WhatsApp and Maps would refuse to move. You could use Link2SD to force move such apps to Internal SD of your device. It will move a big part of it.
On older ROMs, you should be able to setup a partition of your SD as linkable storage, allowing Link2SD or Apps2SD to move the whole app to the partition.
Click to expand...
Click to collapse
There are advantages to swap partitions instead of using the SD Card:
- The new partition date would be within the device's NAND memory. So there are the risks involved in using a sdcard always fragile ...
- How the partition is within the NAND memory beyond the security there is the highest performance.
The only downside is that the restriction would increase from 1,57GB to 4GB.
In my case I not use the smartphone for gaming. All of my APPs would fit into 2.5GB.
If I still needed more space, could use "Adoptable Storage".
- Could unmount and remove the SD card when wanted, after all was being used only for personal files and not apps.
Also it would be a great experimental situation of low risk to learn how to configure mount partitions on Android.
ConceptBR said:
There are advantages to swap partitions instead of using the SD Card:
- The new partition date would be within the device's NAND memory. So there are the risks involved in using a sdcard always fragile ...
- How the partition is within the NAND memory beyond the security there is the highest performance.
The only downside is that the restriction would increase from 1,57GB to 4GB.
In my case I not use the smartphone for gaming. All of my APPs would fit into 2.5GB.
If I still needed more space, could use "Adoptable Storage".
- Could unmount and remove the SD card when wanted, after all was being used only for personal files and not apps.
Also it would be a great experimental situation of low risk to learn how to configure mount partitions on Android.
Click to expand...
Click to collapse
Guys, devs are apparently working on unifying partitions. That's the best solution.
It is already working on Xperia T. So it is possible on Xperia L as well.
Let's just wait and see for now.
IMO This is actually top priority for Xperia L lol other that this the device is working just fine.
ConceptBR said:
I propose another solution.
Format "SD 0" as EXT4.
Then mount during the boot of Android, "SD 0" as DATA partition.
Simply replace "date" with "SD 0" at the time of installation of partitions.
This does not alter the structure of partitions and would give the 4 GB device for apps installation.
I've done tests. It's easy to format using the TWRP "SD 0" as EXT4.
The same process is easy to reverse.
It is safe because it does not change the structure of the partitions. If there is any problem just restore the Stock ROM.
Soon just need help to know which Android configuration files need to change mount "SD 0 in EXT4" like the DATA unit.
The Xperia L pass from 1,57GB to 4 GB !!!
Help, please !!!!
Click to expand...
Click to collapse
That's the same thing I was thinking. But yeah, thanks for the info that SDCard can be formatted to ext4. Then I think this can happen:
Code:
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#TODO: Add 'check' as fs_mgr_flags with data partition.
# Currently we dont have e2fsck compiled. So fs check would failed.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults recoveryonly
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait
/devices/platform/msm_sdcc.1/mmc_host/mmc0 /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check,encryptable=/persist/footer
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check
/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs rw,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check
/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel /recovery emmc defaults defaults
/devices/platform/msm_sdcc.3/mmc_host* auto auto nosuid,nodev voldmanaged=sdcard1:auto,encryptable=userdata
Ehh, will try to make boot.img soon. You guys think this code would succeed? Then /sdcard wouldn't exist but let's just see if data would.
I've tried it and it f..ked my phone. I had to reflash stock and go to mm from there ...
cojocar.andrei said:
I've tried it and it f..ked my phone. I had to reflash stock and go to mm from there ...
Click to expand...
Click to collapse
Sorry to hear that...
In my case I need an even simpler solution ...
Using TWRP formatted "SD 0" as EXT4.
I managed to UnMount "/DATA" and "/sdcard".
I would like to reverse the mounts.
Partitioning modifies the structure of partitions.
Mounting is by software changes and safe.
The solution will allow any time to install the ROM Stock since the structure of the partitions will not be changed.
As in TWRP Terminal can ride correct partitions?
if I'm wrong then correct me, please ...
Device Configuration Partitons
sdcard -> /dev/block/mmcblk0p32
Userdata-> /dev/block/mmcblk0p31
CHANGE
sdcard -> /dev/block/mmcblk0p31
Userdata-> /dev/block/mmcblk0p32
------------------------------------------------------------
Is it correct? ADB Shell or Terminal?
unmount /sdcard/
unmount /Userdata/
mount -o rw /dev/block/mmcblk0p32/ /userdata/
mount -o rw /dev/block/mmcblk0p31/ /sdcard/
And reboot smartphone?
/system/init/init.rc?
------------------------------------------------------------
Sorry my bad english...
ConceptBR said:
In my case I need an even simpler solution ...
Using TWRP formatted "SD 0" as EXT4.
I managed to UnMount "/DATA" and "/sdcard".
I would like to reverse the mounts.
Partitioning modifies the structure of partitions.
Mounting is by software changes and safe.
The solution will allow any time to install the ROM Stock since the structure of the partitions will not be changed.
As in TWRP Terminal can ride correct partitions?
if I'm wrong then correct me, please ...
Device Configuration Partitons
sdcard -> /dev/block/mmcblk0p32
Userdata-> /dev/block/mmcblk0p31
CHANGE
sdcard -> /dev/block/mmcblk0p31
Userdata-> /dev/block/mmcblk0p32
------------------------------------------------------------
Is it correct? ADB Shell or Terminal?
unmount /sdcard/
unmount /Userdata/
mount -o rw /dev/block/mmcblk0p32/ /userdata/
mount -o rw /dev/block/mmcblk0p31/ /sdcard/
And reboot smartphone?
/system/init/init.rc?
------------------------------------------------------------
Sorry my bad english...
Click to expand...
Click to collapse
In theory it should work. I've tried it but it didn't come up right for me. I suspect the line in fstab.qcom for the user data that I've replaced (/devices/platform/msm_sdcc.1/mmc_host/mmc0).
I think we should replace
/dev/block/platform/msm_sdcc.1/by-name/userdata
with
/dev/block/platform/msm_sdcc.1/by-name/sdcard
and of course format sdcard as ext4.
I see no reason why it shouldn't work. Probably I'll try it again in a few weeks, when I'll have some spare time ...
So for this to work the fstab.qcom needs to look like this:
#TODO: Add 'check' as fs_mgr_flags with data partition.
# Currently we dont have e2fsck compiled. So fs check would failed.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults recoveryonly
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/platform/msm_sdcc.1/by-name/sdcard /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check,encryptable=/persist/footer
/dev/block/platform/msm_sdcc.1/by-name/sdcard /data f2fs rw,nosuid,nodev,noatime,nodiratime,inline_xattr wait,formattable,check,encryptable=/persist/footer
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check
/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs rw,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check
/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel /recovery emmc defaults defaults
/devices/platform/msm_sdcc.1/mmc_host/mmc0* auto auto defaults voldmanaged=sdcard0:31,nonremovable,noemulatedsd
/devices/platform/msm_sdcc.3/mmc_host* auto auto nosuid,nodev voldmanaged=sdcard1:auto,encryptable=userdata
Great job! It's usable?
Option58 said:
Guys, devs are apparently working on unifying partitions. That's the best solution.
It is already working on Xperia T. So it is possible on Xperia L as well.
Let's just wait and see for now.
IMO This is actually top priority for Xperia L lol other that this the device is working just fine.
Click to expand...
Click to collapse
That's great, but what are people who can't use SD cards are supposed to do? Where will they store their data?
stuckbootloader said:
That's great, but what are people who can't use SD cards are supposed to do? Where will they store their data?
Click to expand...
Click to collapse
Want to hear my advice? Install ROM that gives you most data space, I don't know which ROM that is. And use your device as-is until you buy new one. You could also replace your motherboard.
I know this is not xda-spirit like, but I have to say give up messing with your existent motherboard before you hard-brick your device, I destroyed mine. Had to buy new device. Xperia L can be hard-bricked if you mess with partitions.
stuckbootloader said:
That's great, but what are people who can't use SD cards are supposed to do? Where will they store their data?
Click to expand...
Click to collapse
In Xperia T, i think what @Adrian DC use a sdcard emuled for this...
Option58 said:
Want to hear my advice? Install ROM that gives you most data space, I don't know which ROM that is. And use your device as-is until you buy new one. You could also replace your motherboard.
I know this is not xda-spirit like, but I have to say give up messing with your existent motherboard before you hard-brick your device, I destroyed mine. Had to buy new device. Xperia L can be hard-bricked if you mess with partitions.
Click to expand...
Click to collapse
Other Roms? In Galaxy S2 for example, with PIT partitions(other method), all ROMS working today with pits (official cyanogenmod inclusive) . I'm sorry, but, this is the price of testing
Thread closed at OPs request

Link2SD with S-ON? Yes, I did.

This was driving me up a tree the last few days. I've dealt with Link2SD on quirky devices before, but this one forced me to understand just how Link2SD implemented the mount script, and hooray, I got it.
Now basically, I'm assuming you already know what Link2SD is for, and I'm also assuming that your S-ON device is already rooted and you have a custom recovery partition to the likes of TeamWin or CWM installed and functioning. For my device, I have a recently rooted HTC Desire 510 acquired from FreedomPop.
With the help of DiskInfo, I determined that this device supports ext4, so that's the filesystem I'm using.
____________________
So, What's the magic file anyway? (or, How does Link2SD Work?)
Link2SD has to mount the second SD partition rather early to make sure the files on it are accessible before Android starts looking for the apps. It does this by replacing an existing binary file with its mount script. Don't worry though, before replacing it, it renames the binary file and calls it at the end of the script. The file is:
/system/bin/debuggerd
That's it, and if you want to use Link2SD on your S-ON device (without resorting to quick-reboot every other boot, which on my device at least was spitting an error for every moved app or directory), you'll need to manually do the steps Link2SD would normally do automatically. You'll need to gather some info and other preparation. I'll provide a sample script (which came from my Proscan tablet), which you must edit to match your device information before flashing.
Here's the sample script. Save as "debuggerd" :
Code:
#!/system/bin/sh
#added by link2sd
LOG=/data/link2sd-debuggerd.log
echo "$(date) mounting..." > $LOG
sleep 2
mount -t ext4 -o rw /dev/block/vold/179:2 /data/sdext2 1>>$LOG 2>>$LOG
mount -t ext4 -o rw /dev/block/mmcblk0p2 /data/sdext2 1>>$LOG 2>>$LOG
mount >> $LOG
echo "$(date) mount finished" >> $LOG
echo debuggerd.bin launched >> $LOG
exec /system/bin/debuggerd.bin
You'll notice two mount lines, these are the ones in need of edit. What you'll need to find out:
* The 2nd SD partition type. If you did the partitioning, you should already know this one. As I already mentioned, I used ext4.
* The block number of the second SD partition. I like DiskInfo for that one. The script might be okay for your device, or it might not depending on how storage is set up. The desire was mmcblk1p2.
* The vold id of the second SD partition. Vold is the standard method of managing partition mounts in Android, so is Link2SD's preferred mount method. The block number line is only included as a backup in case the mount by vold id fails. If Link2SD is already installed (and it should be) and the mount script (supposedly) created, it will have already mounted the second partition, so you should be able to go into terminal and type
mount | grep sdext2
to retrieve this number. 179:2 is typical, but my desire was something like 179:58. Best to look it up.
Make the necessary edits, then save the file somewhere accessible to your recovery, such as the root of the sd card (first partition).
Double check the mount info in the script.
____________________
The manual install.
Now for the fun part. Reboot into your custom recovery.
Make sure /system and the sd card are mounted.
Enter the file manager.
Navigate to /system/bin.
Rename debuggerd to debuggerd.bin .
..This is to match the last (exec) line in the script, and what makes the mount stage a seamless insertion into the boot process.
Navigate to where you saved the replacement debuggerd script. Select Copy.
Navigate back to /system/bin and Paste. Confirm if necessary.
Once the custom debuggerd script is copied, you'll need to make sure it's executable. Run chmod on it, something like 755 will be fine. Confirm if necessary.
You also need to make sure the mount directory exists. Navigate to /data , if it doesn't already exist, make a directory called sdext2 .
That should be it. Reboot into the system. If everything is correct, you should boot normally with the second SD partition already mounted before the apps are loaded. I have so far been running Link2SD on the Desire for about a week, and have not run into any *unusual* problems.
____________________
Disclaimer.
This method was successful for me. Your mileage may vary. Editing the system partition always has some inherent risk. What you do to your device is on you; I will not be held responsible for a boot-loop, bricking the device, random interplanetary calls, or any other damages incurred, physical, monetary, or otherwise following your reading of this post. Proceed at your own risk.
---
Sent from my HTCONE using XDA Free mobile app
Having revisited this thread, I noticed I forgot a step, now fixed.
I still use this phone. A couple small glitches have developed over time which may be related to using a cheap sd card, but, basically I have an app with a bad id, it's disabled anyway so I just ignore it on boot (the I'm feeling lucky button). Also, if there is a glitch that prevents a proper shutdown, the second partition may get corrupted. It is impossible to boot with the card unmounted without causing a bunch of other app related issues, so the only way to deal with it cleanly is shut down, remove the card, and fix it on another computer (preferably linux), then reinsert the card before booting the device back up.
Also, after another week, "app data" on the card stopped working right: existing moves caused errors and new moves failed, so I just moved all app data back to internal. Again, this may be just related to using a cheap card, and it was around the same time the bad id occurred, so I'm sure there's some unresolved corruption that just plain isn't getting fixed without a factory reset. It's getting about time to do that, so if I can score a new card and some time to set it up, I'll post how it goes. Apps themselves, dolvik, and libraries continue to work on the sd card without issue on most apps.

Unable to create second partition on SD card

I've been trying to partition my SD card, but all steps I take to try and diagnose why I am unable to partition the card is getting me nowhere.
Initially, I used gparted on my laptop to partition the SD card with a v-fat partition and a f2fs partition, both primary partitiond. This was when I found out that no matter what I do the second partition on the SD card, it doesn't seem like the format actually takes. Whatever tool I use complete the partitioning and formatting steps successfully by all appearances but it doesn't seem like the partition is ever actually formatted. What I mean by that is that no matter what the second partition is it never mounts. I get an invalid argument error or bad super blocks and so forth. I can make the first partition anything I want: fat, v-fat, f2fs, ext4 and so forth and that will mount in my terminal without issue, but no matter what I do the 2nd partition always fails to mount. I've also noticed that blkid never has any fs info for the second partition. It gives me the partition UUID and that's all, while the first partition has both part UUID & fs UUID.
I've even gone so far as to just recently get a brand new SD card thinking that perhaps the first SD card was corrupted but I'm still getting the exact same behavior. Also of note is that in gparted when I try to create a secondary partition, I'm unable to mount the second partition so I don't think it has anything to do with my device. I've tried using fdisk, gdisk, parted in the terminal and I've tried using extended partitions and logical partitions and only primary partitions. I've done this before in the past so I know that it is possible.
It almost seems like the SD cards that I have are simply not capable of being partitioned in any way but it's strange that I now have two 512 GB SD cards and they're both giving the exact same behavior so I'm thinking that I'm missing something obvious. Any help anyone could provide as far as trying to figure this out or debug what's going on what I'm doing wrong would be greatly appreciated.
Thanks,
Ryan
only the first partition is mounted from vold. that is normal behaviour on every device. if you want have all partitions mounted automatically install LineageOS.
furthermore, although sdcardfs supports ext4, f2fs, for file transfer via USB MTP afaik fat32, exfat or ntfs is required.
what do you need f2fs partition for? maybe I can point you to workaround.
aIecxs said:
only the first partition is mounted from vold. that is normal behaviour on every device. if you want have all partitions mounted automatically install LineageOS.
furthermore, although sdcardfs supports ext4, f2fs, for file transfer via USB MTP afaik fat32, exfat or ntfs is required.
what do you need f2fs partition for? maybe I can point you to workaround.
Click to expand...
Click to collapse
I don't need anything to mount automatically. I'm saying I can't manually mount these partitions. I also don't need f2fs, that was just an example. I've tried multiple partitions that are just fat, ext4 and many other combinations. Under no partition scheme can I get anything other than the first partition to mount--using the mount command as root.
can you please try gdisk binary from here
https://forum.xda-developers.com/t/...-on-qmobile-z8-with-bricked-dead-emmc.3712171
please post the result of partitioning and formatting.
if you're interested in alternative solution, you can actually format the whole MicroSD card as exfat, and create ext4 partition image on top as regular file. I have done that for my mothers Huawei for Link2SD because it doesn't support adoptable storage.
aIecxs said:
can you please try gdisk binary from here
https://forum.xda-developers.com/t/...-on-qmobile-z8-with-bricked-dead-emmc.3712171
please post the result of partitioning and formatting.
if you're interested in alternative solution, you can actually format the whole MicroSD card as exfat, and create ext4 partition image on top as regular file. I have done that for my mothers Huawei for Link2SD because it doesn't support adoptable storage.
Click to expand...
Click to collapse
I have tried with gdisk but I can try with that specific version and report back. I understand we can create imaged file systems, but one of the main reasons I do this is that I find fat partitions are fickle and can easily be corrupted where the whole partition requires wiped. By having a non fat partition I use that as a better backup option where I find it's easier to recover data in case of corruption or other issues. For such use, being tied to the fat FS would still incur the possibility of data loss so that doesn't work for my purpose.
Thanks and I'll report back,
Ryan
oh I wouldn't rely on f2fs for backups it still has bugs and there are no recovery tools for f2fs
https://forum.xda-developers.com/t/4550931
https://android.stackexchange.com/q/250389
alecxs said:
oh I wouldn't rely on f2fs for backups it still has bugs and there are no recovery tools for f2fs
https://forum.xda-developers.com/t/4550931
https://android.stackexchange.com/q/250389
Click to expand...
Click to collapse
Thanks for the suggestion to use gdisk. I downloaded the version you linked, but I still get the same behavior. I believe it is related to the fact that only the first partition gets a filesystem UUID in blkid. I'm not sure what this means, but it seems clear that the second filesystem isn't being properly created no matter what I do.
that's strange, especially the fact you tried on PC too. on the phone, can you create partitions inside a blank disk image just for double check to rule out kernel issue?
I'll give that a try and report back
alecxs said:
that's strange, especially the fact you tried on PC too. on the phone, can you create partitions inside a blank disk image just for double check to rule out kernel issue?
Click to expand...
Click to collapse
Yeah I'm able to create an image, partition it into a vfat & ext4, then mount both of those partitions.
can you dd the file into mmcblk1 for testing purposes?
alecxs said:
can you dd the file into mmcblk1 for testing purposes?
Click to expand...
Click to collapse
Sorry this isn't clear to me. What am I using to dd into the partition, and do you mean mmcblk1p1/2? As mmcblk1 is the whole disk.
Thanks,
Ryan
yes, I meant the whole disk you created a test file that contains MBR or GPT and two partitions including UUIDs and file systems? If you dd it into the mmcblk1 it should create 1:1 copy of that disk image with two partitions including partition table.
Well I'll be:
Code:
/dev/block/mmcblk1p2 on /data/data/com.termux/files/home/i2 type ext4 (rw,relatime,seclabel) /dev/block/mmcblk1p1 on /data/data/com.termux/files/home/i2 type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
Code:
/dev/block/mmcblk1p2 23M 46K 23M 1% /data/data/com.termux/files/home/i2 /dev/block/mmcblk1p1 4.9M 0 4.9M 0% /data/data/com.termux/files/home/i1
I can possibly use gparted to just resize those! Any thoughts on what was going on, why this method worked? Hrmm looks like resizing fat could be a challenge, but this certainly gets me closer!
there is also parted binary you can use on phone
I have it and I'm playing around with it, thanks for all your help

Categories

Resources