yashsingh1/xdaforums huggingface dataset:
[Nexus S General] CryptMan:
Hi,

I followed your guide on an Nexus S (with Clockworkmod 6.0.4.3 and Cyanogen Mod 11-20140712). I got it to work except for one thing related to the /sdcard LV, I guess it is related to some mounting behavior (or just a failure in my editings).

/data and /system are just working fine, BUT /sdcard (/storage/sdcard0) is NOT working as expected.

The main problem is that /sdcard will not recogniced as external storage, several apps (Titanium backup for example) complain about that. Also connection as USB mass storage is not working.

I did "mkfs.vfat /dev/lvpool/media" to format, it is possible to mount and access that logical volume with "mount -t vfat /dev/lvpool/media /storage/sdcard0" but is does not get mounted automatically.

Any suggestion what I did wrong?

Best regards
[Nexus S General] demosf:
did you edit the vold-set-sdcard.for-fstab.board script?

p.s. can you please share your recovery.img and boot.img i couldn't succeed to make mine to boot with the ones i modified, tnx
[Nexus S General] CryptMan:
Well I changed "fstab.BOARD_NAME" to "fstab.herring" if you mean that.

The boot is from "cm-11-20140718-NIGHTLY" (i modifierd the ZIP so I can install/update without loosing the data).

Recovery: http://www19.zippyshare.com/v/49328755/file.html

Boot: http://www47.zippyshare.com/v/51255193/file.html

Please note that the boot has this USB/external storage is not connected problem.

P.S.: Took me ages to write these post, f*cking captcha was NOT working.
[Nexus S General] steven676:
At a glance, your fstab.herring is wrong -- you need to keep the original sdcard0 entry there so that vold-set-sdcard can modify it and vold can find it. (It should be noted that I never did update the sample files for crespo beyond 4.1 ... for 4.4, I'd also suggest modifying the existing entries for /system and /data in fstab.herring instead of removing them and adding explicit pre-4.3-style mount commands in init.herring.rc.)
[Nexus S General] CryptMan:
Hi steven676,

thanks for your reply. I think I have tried what you said

but

all apps tells me that "media storage" is

NOT

mounted.

On boot I have this in logcat, that confuses me a bit. Because I can do "cat /fstab.herring" and it is "-rw-r--r-- root root".

I/installd( 110): installd firing up
I/Vold ( 97): Vold 2.1 (the revenge) firing up
E/Vold ( 97): failed to open /fstab.herring
E/Vold ( 97): Error reading configuration (Permission denied)... continuing anyways

vold_set_sdcard seams to be working:

before: /devices/platform/s3c-sdhci.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0 auto auto defaults voldmanaged=sdcard0:3,noemulatedsd,nonremovable,encryptable=sdcard

after: /devices/virtual/block/dm-2 auto auto defaults voldmanaged=sdcard0:3,noemulatedsd,nonremovable,encryptable=sdcard

I have this 3 mount commands in "init.herring.rc"

mount ext4 /dev/lvpool/system /system wait ro

mount ext4 /dev/lvpool/userdata /data wait noatime nosuid nodev nomblk_io_submit

mount vfat /dev/lvpool/media /storage/sdcard0 wait rw

Because of the last one "sdcard" is accessable, if I remove it sdcard is not there.

Best regards.

---------- Post added at 01:46 PM ---------- Previous post was at 01:25 PM ----------

Hi,

don't know if this is okay but I can get rid of the "sdcard not mounted problem" if i do this in "init.herring.rc":

mount vfat /dev/lvpool/media /mnt/media_rw/sdcard0 wait rw
start fuse_sdcard0

service fuse_sdcard0 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard0 /storage/sdcard0
class late_start
disabled

Sorry stupid questions, I'm not an expert just a "more advanced user" :cyclops:

But still no luck in using the USB connection / exporting as USB-Massstorage.
[Nexus S General] Polaris96:
LVM "light" maybe?

Hi Steven676,

First of all, TYVM, man. this kind of relevant info is damned hard to find!

Here's the biskit: I'm a complete n00b to android, currently running an HTC one M8 (S-off, TWRP, Android Revolution HD 9.1). I bought the thing because I've decided to get a bit into android and the platform seemed like a good fit for modding.

The problem is that I'm a developer in UNIX, BSD, and Linux. The biggest headache I had learning Linux was expecting it to work $EXACTLY like Unix. I don't want to make the same mistake with android. So I'm asking instead of tweaking without fear.

I want LVM to install a parallel debian system on my device (based on debiankit). I don't need LVM on the android partitions, I just need it available AFTER startup to handle my Debian partitions.

It looks like your LVM bin doesn't need weird libraries or, really, anything at all. Can I just add it as an executable to, say, bin, repack it and flash it from recovery and then run LVM as a regular post init service? I'd prefer to do it your way but can't seem to find Recovery or system images (I can get boot by unzipping the rom)

Many apologies for the oddness of the question.

EDIT: This was my last option after a day of trying to understand the differences between android and linux, etc, etc, etc. I now realize your condensed "how to install LVM on other devices..." advice will do the trick. Sorry for wasting time. Will leave the post in case another noob has similar ideas: Updating the RAMdisk with no changes to init scripts will make the service available after boot. In this mode of operation, recovery shouldn't need a mod bc it will be running on a standard partition, as will /System.
[Nexus S General] steven676:
Do you have SELinux in enforcing mode? (Check in Settings -> About phone if not sure.)

This works, but if you make the changes in fstab.herring you can actually keep the mount_all command instead.

What you're discovering is that the Android framework has a very rigid idea of what external storage should look like: it either needs to be managed by vold, or be "emulated" storage (combined with the /data partition) managed directly by the framework itself. Ultimately, you're going to need to get vold working to get this setup to work correctly, so your next step is to figure out why vold can't open the fstab file to read its configuration.

No one's born an expert. You get there by learning; asking questions is one of the very best ways of doing that.

For reference, it's a statically linked binary with no external dependencies -- you can run it on any ARMv5 or later device provided the kernel has the appropriate device-mapper support.

I'm mildly curious here -- what are you using for the LVM PVs? I can't think of any partitions that are safe to steal on most modern devices other than /system and /data, and to use either of those you'll need to make some further changes to the system.

That said, if you really don't need it on startup, I'd suggest storing the LVM tools somewhere other than the initramfs -- that will save you a little bit of memory.
[Nexus S General] CryptMan:
SELinux-Status = Strikt

Not set by me, don't know what that mean's. SELinux is on my "things to learning list".

How can I change it to "Moderat" at boot time?

Using "SELinux Mode Changer" Apps seams to be temporary solution at run-time only.

I tried that but it did not work as expected so I did it this way.

That would be cool if I get there. Okay, if I got you right "fuse_sdcard0" is not the way to go.

Any way thanks for your explanations.
[Nexus S General] frankdrey:
I also spent almost the entire day trying to get this to work with 4.4. No luck.

CryptMan, you had it working without mass storage? Because I'd use that :P

Anyway, I give up for today. But I just got an idea. Wouldn't this theoretically help with dual boot? You could create multiple system partitions, and flash two different boot.img's for two different roms into boot and recovery. And those initrc's are modified to mount their own system partition.

:D I'm going to try dual booting 4.1 and 2.3 tomorrow, since I have already done this LVM mod successfully for 4.1.
[Nexus S General] steven676:
Okay, does making the following change to vold-set-sdcard help?

diff --git a/lvm-bin/sbin/vold-set-sdcard.for-fstab.board b/lvm-bin/sbin/vold-set-sdcard.for-fstab.board
index 7d2d5be..7d76521 100755
--- a/lvm-bin/sbin/vold-set-sdcard.for-fstab.board
+++ b/lvm-bin/sbin/vold-set-sdcard.for-fstab.board
@@ -49,5 +49,6 @@ while read sysfs_path mntpoint fstype mntflags fsmgrflags; do
done

mount -t bind -o bind "$VOLD_CONFIG_NEW" "$VOLD_CONFIG"
+restorecon "$VOLD_CONFIG"
: > /dev/.vold_configured
exit 0
[Nexus S General] Polaris96:
I used an AMD64 jessie platform to split a 64G microSD into 4 physical partitions. I formatted 1 ext4 and PV'ed the other 3, then made them a VG. Created the LV and formatted ext4. Turned off journaling...

My idea was to do maximum work in my comfort zone ("regular" linux).

Then, I put the card into the HTC device and it seems to work well. Android doesn't see the VG but the debian sister system does. I haven't tried to mount it, yet, but the debian system seems to be performing "stock" amd arch debian, so I'm expecting it will work.

So far as storing the LVM executables elsewhere, is there a $PATH I need to set? I still don't fully understand how android finds utilities...

Thanks again for all your help.

---------- Post added at 08:10 AM ---------- Previous post was at 07:42 AM ----------

Just a quick follow up:

Correction, I meant jessie on HTC behaves like debian ARM not debian AMD. Also, have just mounted, R/W'ed and df'ed the LV from the debian ARM system and everything works well, so this kind of thing WILL work, although I doubt it's useful to most people. The only weirdness is that /dev acts like an "early bootspace" system with LVM shares listed in /dev/mapper/"$VG\-$LV" instead of /dev/$VG/$LV.
[Nexus S General] steven676:
What's the output from running "/system/bin/ls -lZ /fstab.herring" once the system is up? Also, could you post a dmesg from the device just after boot?
[Nexus S General] CryptMan:
-rw-r--r-- root root u:object_r:device:s0 fstab.herring

Just for reference, cat /fstab.herring

# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# 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

/dev/lvpool/media /sdcard vfat defaults recoveryonly
cache /cache yaffs2 defaults recoveryonly
misc /misc mtd defaults recoveryonly
boot /boot mtd defaults recoveryonly
recovery /recovery mtd defaults recoveryonly
bootloader /bootloader mtd defaults recoveryonly
radio /radio mtd defaults recoveryonly

/devices/virtual/block/dm-0 /system ext4 ro wait
/devices/virtual/block/dm-1 /data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,encryptable=/efs/userdata_footer
/devices/virtual/block/dm-2 auto auto defaults voldmanaged=sdcard0:3,noemulatedsd,nonremovable,encryptable=sdcard

Best regards
[Nexus S General] steven676:
Bah, restorecon's picked the wrong context for the file. Does this work better?

--- a/lvm-bin/sbin/vold-set-sdcard.for-fstab.board
+++ b/lvm-bin/sbin/vold-set-sdcard.for-fstab.board
@@ -49,5 +49,6 @@ while read sysfs_path mntpoint fstype mntflags fsmgrflags; do
done

mount -t bind -o bind "$VOLD_CONFIG_NEW" "$VOLD_CONFIG"
+chcon u:object_r:rootfs:s0 "$VOLD_CONFIG"
: > /dev/.vold_configured
exit 0
[Nexus S General] CryptMan:
Many thanks for your continous support, sadly it doesn't look like that this is working.

I did this with the new patch from you.

I/cm ( 116): ____ _ _ ____ _ _ ____ ____ ____ _ _ _ _ ____ ___
I/cm ( 120): | \_/ |__| |\ | | | | __ |___ |\ | |\/| | | | \
I/cm ( 124): |___ | | | | \| |__| |__] |___ | \| | | |__| |__/
I/Vold ( 100): Vold 2.1 (the revenge) firing up
E/Vold ( 100): failed to open /fstab.herring
E/Vold ( 100): Error reading configuration (Permission denied)... continuing anyways
I/Netd ( 105): Netd 1.0 starting

Back on the shell I tried to execute this manually, but also no luck.

2|root@crespo:/ # /system/bin/ls -lZ /fstab.herring
-rw-r--r-- root root u:object_r:device:s0 fstab.herring
root@crespo:/ #
root@crespo:/ # restorecon /fstab.herring
SELinux: Loaded file_contexts from /file_contexts
SELinux: Could not set context for /fstab.herring: Permission denied
Could not restorecon /fstab.herring: Permission denied
root@crespo:/ #
root@crespo:/ # chcon u:object_r:rootfs:s0 /fstab.herring
chcon: Could not label /fstab.herring with u:object_r:rootfs:s0: Permission denied

Then I added "/dev/fstab\..* u:object_r:rootfs:s0" to "/file_contexts" but that also changes nothing.

I case I hardcode the /fstab.herring there sames to to be another problem as well. Or is it correct to see that?

SD card is still reported as NOT available ... but it IS mounted - that gives me headaches.

I/cm ( 113): ____ _ _ ____ _ _ ____ ____ ____ _ _ _ _ ____ ___
I/cm ( 119): | \_/ |__| |\ | | | | __ |___ |\ | |\/| | | | \
I/cm ( 124): |___ | | | | \| |__| |__] |___ | \| | | |__| |__/
I/cm ( 128): Welcome to Android 4.4.4 / CyanogenMod-11-20140718-NIGHTLY-crespo
I/Vold ( 97): Vold 2.1 (the revenge) firing up
D/Vold ( 97): Volume sdcard0 state changing -1 (Initializing) -> 0 (No-Media)
I/Netd ( 102): Netd 1.0 starting
W/InterfaceController( 102): Warning (dlopen failed: library "/system/lib/libnetcmdiface.so" not found) while opening the net interface command library
D/Vold ( 97): Volume sdcard0 state changing 0 (No-Media) -> 1 (Idle-Unmounted)
[Nexus S General] steven676:
Blargh -- can we see a dmesg (kernel log, not a logcat) from the device?

This (probably) isn't supposed to work -- being able to relabel things from a root shell on the running device would defeat the point of having SELinux confinement.

Did you then try having vold-set-sdcard run restorecon again? /file_contexts isn't consulted except by restorecon.

This looks correct -- vold won't attempt to mount the volume until much later in the boot process.
[Nexus S General] steven676:
Sigh, okay, it looks like there's no way around remounting / read-write to modify fstab.herring.

The entries for /system and /data in fstab.herring should be block devices (/dev/lvpool/system and such), not sysfs paths; you only use the sysfs dev path for vold entries (yes, that's confusing; blame Google).
[Nexus S General] CryptMan:
Okay, thanks for this hint. You are right, I'm confused ... now :D
[Nexus S General] KreAch3R:
[MENTION=3698928]CryptMan[/MENTION], [MENTION=4353291]steven676[/MENTION]

I managed to get to the same point, with a 4GB user data and 10GB sdcard, on a crespo running CM11-M8. I don't get the permissions error. Depending what I try, I may get MountService to crash or Vold to throw "OperationFailed" errors.

I also have "OneNand correctable block errors" or sth like that, all over my dmesg.

On the phone, USB storage is not working, and TiB is reporting "media not mounted". But the apps like Dropbox, etc can save files on the sdcard storage.

Do you want to post dmesg/logcats or my boot file to take a look?

Is it possible that all these errors are due to KitKat security changes? Did they work for older versions?

If we can't make it work like this, can we try to make the whole storage a emulated SD card storage, like Nexus 4? [MENTION=4353291]steven676[/MENTION], I saw your previous reply. Searching the net the only information I found about that is this: http://source.android.com/devices/tech/storage/config-example.html

If we use the Nexus 4 example, these changes are enough? I can't build from source in this PC yet, and I can't test it. What would then happen with the vold-set-sdcard service etc?

I hope you find the time to reply, we are SO close to make Nexus S internal storage usable! :)
[Nexus S General] CryptMan:
Hi KreAch3R,

I can give you a "cm-11-20140802-NIGHTLY-crespo-mod.zip" which works, except for the media export via USB.

As I understand the flash set in these three partions, error should be no problem because we are not acsessing the flash directly so that the flash controller should be able to map defects away.
[Nexus S General] KreAch3R:
I would be glad if you would, please do share the .zip! :)

When you say it works, you mean that you made it "mount" the media storage, so that apps don't complain? For example, TiB can show the SDcard but says that media is unmounted, Dropbox works and can save files to SDcard but Wallbase or Camera e.g. can't.

Ok about the error, just thought I could see if others have the same problem.
[Nexus S General] CryptMan:
Had to split it in two pieces, should be possible to flash it directly to a LVM modified Nexus S.

http://www26.zippyshare.com/v/37083583/file.html

http://www26.zippyshare.com/v/96625359/file.html
[Nexus S General] KreAch3R:
I just saw your post, thank you! These last days I managed to make the external storage emulated (like Nexus 4) and I don't have any problems, as far as I can tell (no vold problems and obviously no USB storage, only MTP, but it works).

I will try to make a guide for those interested. :)
[Nexus S General] CryptMan:
That sounds fantastic.

I experimented with that too but MTP was not working, I'm looking forward for your guide.

Best regards.
[Nexus S General] KreAch3R:
I just posted the guide here. I hope you can make it work, too. Thanks [MENTION=4353291]steven676[/MENTION].

(mention to [MENTION=3743663]chrisgestapo[/MENTION], to catch this guide too)
[Nexus S General] ILCAMPIONE:
sorry [MENTION=3190122]KreAch3R[/MENTION] but i dont understat this point

"MODIFY FRAMEWORK-RES.APK"

which changes i must intergrate? where i can find them?

thanks

Ps. May be saturday i will try on my grilsfriend's smarthphone .... will you be online, saturday or sunday??? (If i will need help???)
[Nexus S General] KreAch3R:
This is the wrong thread, go to my thread and find the necessary changes in my git repository (link included). It is a small change in storage-list.xml. Be careful when following my guide, do not use the files from this thread, you should only apply the procedure used here, to my guide.

I could help you but I don't know if I am going to be free/close to a PC on the weekend. I am currently studying for exams. I am notified however, when posts come up to my threads, so shoot there and I will try to answer ASAP.:)
[Nexus S General] ILCAMPIONE:
Sorry to all i wrote in wrong threads. Sorry again[emoji15] [emoji15] [emoji15]
[Nexus S General] Eleanor1967:
Hey guys,

I just wanted to ask if this thread is the right solution for my problem (because I'm a noob and I haven't understand to much after reading whole thread). I have a Galaxy S1 with a super slow internal memory (2mb/s read / 0.5 mb/s write ) and the internal sd isn't doing to hot, too. So I wanted to use a externel sdcard as system partition and maybe use the internal stuff for extra space. Am I right in thinking that this thread will help me achieving this ? (sorry for the probably dumb question, last time I played with something linuxlike ext4 was the new hot ****.)

All the best

Eleanor1967
[Nexus S General] Spacexplosion:
I have the newest ClockworkMod recovery image and the 4.1.2+ boot image with LVM if anyone is interested. How do I attach them to a post?

---------- Post added at 06:51 AM ---------- Previous post was at 06:41 AM ----------

Eleanor,

The general approach of using LVM could theoretically do what you're looking for, but everything might be different with a Galaxy S1.
[Sony Xperia P, U, Sola, Go] shoz_on4u:
Hi,

I recently flashed my phone with .73 Central Europe FW and strangely sometimes(not always) my phone wakes up while listening music. It turns on for some time and then turns off after a second this repeats 3-4 times and then stops.

Also i listen some creaking sound when the volume is full and the volume automatically sometimes becomes low and then suddenly high. Any ideas about this? Is my phone OK or did i messed up anything while flashing this FW?

Thanks for helping.

Regards
[Galaxy S II Q&A, Help & Troubleshooting] craigyb:
After upgrading to ICS from CheckROM V6 (ginger bread) I seem to have lost the rSAP or SIM access profile. Has this been removed from ICS, can anyone confirm which profiles are supported in ICS?

I could go back to GB to test that it's not my car that is at fault as it stopped working after I got my car back from the dealership.

Thanks for your help.
[Galaxy S II Q&A, Help & Troubleshooting] craigyb:
Well it's not my car, I downloaded the rSAP application from the market and installed it. This now gives me the rSAP profile and I can connect to my car in rSAP mode or HFP mode.

So it seems it's missing from ICS, that might make the SIII a no go depending on how good this little app is in the real world.

Apps from the market

Remote SIM access installation

Remote SIM access trial
[Galaxy S II Q&A, Help & Troubleshooting] raglits:
Which ICS ROM did you upgrade to? I would expect Stock based ROMS to have rSAP and AOSP/AOKP ones to not have this support...
[Galaxy S II Q&A, Help & Troubleshooting] hx4700 user:
If you look on the google android code site, you will find it is a common problem so it seems to be stock roms that it refers to.
[Galaxy S III General] GS3Central:
The official Samsung store at the Westfield Shopping centre in Stratford city will be handing out the Galaxy S3 on the 29th at 6pm for those who pre-ordered it from them in-store or online. It's not too late to pre-order. They will then go on sale the next day.
[Galaxy S III General] nikzDHD:
Sucks I'll be in Turkey then! It's only 10 minutes away from me doh! The joys of having a large shopping centre near you ;)
[Galaxy S III General] JupiterdroidXDA:
Pre-Orderd today in there, will be picking mine up @6pm on the 29th;)

I wrote in the pre-order topic the other day and got laughed at when they said they would receive their pre-orders before the shops have them....

That has never happened ever......

Means a trip from lovely Greenwich to ****ty Stratford but will be worth it;P

JD
[Galaxy S III General] xdn:
whats the store website? i cant find it
[Galaxy S III General] Isadora:
But Westfield Stratford? *shudders at the thought* I'm on the Isle of Dogs so not too far but that shopping centre is a utterly horrible experience. I'll just wait for my little package to be delivered :p
[HTC One X] crimsonnight:
Would someone mind explaining the advantages of each one over the default as loads have suddenly popped up and it's a new area for me? (http://xdaforums.com/showthread.php?t=1654982)
[HTC One X] forumhookersdotcom:
I am using faux kernel with ARHD and it is working flawlessly and i have now better battery life.

Use the repacked version of faux kernel.
[HTC One X] Paulst30:
Why everyone didnt just sit round an e-table and make one 'amazing' kernel instead of there being loads is beyond me, but this could be a good thread.

like most, my One X is my daily driver and swapping out Roms/kernels and mods isnt something i have the time to do.

Faux' has been attributed to better battery life, and it would be nice to know what the other kernels offer in difference to stock.

The changelogs mean nothing to anyone who doesnt understand what an I/O scheduler is, if you know what i mean.

Paul
[HTC One X] marcospmr:
You can ask the same about the problems with multiple linux distros. I think this is a open source thing.
[XPERIA X8 Q&A, Help & Troubleshooting] Delta Mykos:
Hello every1, please help....i think i broke my phone for good :confused:....i instaled cm9 without flashing a kernel before...studip thing to do, i don't know why i did it, didn't read instruction, just downloaded the ROM:(

Now the phone won't budge, it keep turning on, it don't load into anything no rom, no recovery, i tryed to connect him with sony update and unroot it in order to bring stock rom up, but PC don't see the phone couse it didn't loaded into ROM....

Any suggestion before i trash it into garbage.....many thx
[XPERIA X8 Q&A, Help & Troubleshooting] jhon rotor:
leave batterry and then take back, try to flash with PC companion (back to esclair),,,

don't be affraid, just conect it.,.,,

(because i done this experience month yesterday.,.

#sorry my bad english.,. :D
[XPERIA X8 Q&A, Help & Troubleshooting] hackergnome:
well ur a murderer and ull go to jail! lol jk... hope u bring ur phone back to life...
[XPERIA X8 Q&A, Help & Troubleshooting] dagger:
No dont throw your phoe in garbage..

Visit this link

http://xdaforums.com/showthread.php?p=10879507#post10879507