FORUMS
Remove All Ads from XDA

[REF] LVM Partition Remapping

14,094 posts
Thanks Meter: 25,504
 
By Entropy512, Senior Recognized Developer on 3rd September 2014, 01:14 AM
Post Reply Email Thread
25th October 2014, 07:54 PM |#51  
Senior Member
Thanks Meter: 43
 
More
deleted
 
 
26th October 2014, 12:21 PM |#52  
Senior Member
Flag Wrocław
Thanks Meter: 112
 
More
@Entropy512

Could write how to restore stoc partitions after LVM? I tried to flash ColorOS recovery and wipe data, but the it seems I lost internal sdcard partition. How to get back stock partitions?
26th October 2014, 12:28 PM |#53  
tork987's Avatar
Senior Member
Thanks Meter: 43
 
More
Quote:
Originally Posted by beton87

@Entropy512

Could write how to restore stoc partitions after LVM? I tried to flash ColorOS recovery and wipe data, but the it seems I lost internal sdcard partition. How to get back stock partitions?

Flash this -> https://docs.google.com/file/d/0BwMu...p=docslist_api
The Following 2 Users Say Thank You to tork987 For This Useful Post: [ View ] Gift tork987 Ad-Free
26th October 2014, 12:38 PM |#54  
Senior Member
Flag Wrocław
Thanks Meter: 112
 
More
thanks mate, totally forgot about that one.

So I went back and through with LVM setup process. TWRP 2.8.0.1 has issues, I used twrp_lvm_09012014.img i had downloaded earlier, so I have no link. This one works with setting up partitions properly
26th October 2014, 06:42 PM |#55  
Member
Thanks Meter: 6
 
More
Question
Quote:
Originally Posted by beton87

thanks mate, totally forgot about that one.

So I went back and through with LVM setup process. TWRP 2.8.0.1 has issues, I used twrp_lvm_09012014.img i had downloaded earlier, so I have no link. This one works with setting up partitions properly

What did you use to downgrade your TWRP from 2.8.0.1 to twrp_lvm ?
TWRP Manager ?
Flashify ?
other ?
26th October 2014, 07:01 PM |#56  
Senior Member
Flag Wrocław
Thanks Meter: 112
 
More
Quote:
Originally Posted by theradec

What did you use to downgrade your TWRP from 2.8.0.1 to twrp_lvm ?
TWRP Manager ?
Flashify ?
other ?

fastboot from adb tools and usb cable

EDIT: Recovery from post: http://forum.xda-developers.com/show...&postcount=558
27th October 2014, 03:53 PM |#57  
OP Senior Recognized Developer
Flag Owego, NY
Thanks Meter: 25,504
 
Donate to Me
More
Quote:
Originally Posted by beton87

@Entropy512

Could write how to restore stoc partitions after LVM? I tried to flash ColorOS recovery and wipe data, but the it seems I lost internal sdcard partition. How to get back stock partitions?

Hmm. That's interesting that a ColorOS factory reset doesn't format the internal SD. "stock" recoveries should wipe everything.

Another option is with any LVM-aware TWRP, esp. TWRP 2.8.0.1: If the recovery detected LVM, format the raw_sd and raw_data partitions. If the recovery did not detect LVM, just format the sdcard and data partitions.

Actually, even a non-LVM-aware TWRP can format data and sdcard. But "downgrading" back to a split partition when you're in an LVM config can be done by formatting raw_sd and raw_data and then rebooting recovery.

(raw_sd and raw_data only appear when TWRP boots and sees an LVM configuration)
27th October 2014, 04:11 PM |#58  
Senior Member
Flag Wrocław
Thanks Meter: 112
 
More
Quote:
Originally Posted by Entropy512

But "downgrading" back to a split partition when you're in an LVM config can be done by formatting raw_sd and raw_data and then rebooting recovery.
(raw_sd and raw_data only appear when TWRP boots and sees an LVM configuration)

This was what I needed.

Oppo stock recovery wiped /data and lost /sdcard
It seems that it was the same in Samsung - /sdcard was always intact when resetting/wiping data.

non-LVM TWPR didn't mount partitions properly and didn't let me to format /sdcard
some CWM based recovery I found on XDA froze on "formatting /data" or "formatting /recovery"

I knew that simple format of both partitions should do it but it seems it would only work with LVM aware TWPR and the key was to format "raw" partition.
28th October 2014, 04:12 PM |#59  
OP Senior Recognized Developer
Flag Owego, NY
Thanks Meter: 25,504
 
Donate to Me
More
Quote:
Originally Posted by beton87

This was what I needed.

Oppo stock recovery wiped /data and lost /sdcard
It seems that it was the same in Samsung - /sdcard was always intact when resetting/wiping data.

non-LVM TWPR didn't mount partitions properly and didn't let me to format /sdcard
some CWM based recovery I found on XDA froze on "formatting /data" or "formatting /recovery"

I knew that simple format of both partitions should do it but it seems it would only work with LVM aware TWPR and the key was to format "raw" partition.

Oddly, the "raw" partition should only appear of an intact LVM config is present, so if you formatted /data, LVM-aware TWRP should still behave as if it is a non-LVM config. (e.g. you would have to format /sdcard - or I think it's called /internal_sd ? Don't have my non-LVM reference device with me)

OEM recoveries are SUPPOSED to fully wipe the device when doing a factory reset (there was a bit of controversy recently regarding the OnePlus not doing this). Although I think SOMETIMES on the Samsungs, whether /sdcard was formatted depended on if you did a wipe in recovery vs. doing it from the Settings menu. (Even if sdcard is hosed, you should be able to boot the device enough to wipe in Settings.)

I also got some more info this morning on why lvmsetup is failing on TWRP 2.8.0.1 - someone who had those issues finally pulled /tmp/recovery.log, and it seems that even if you manually unmount /sdcard, it somehow remains mounted, which causes lvmsetup to fail to create a PV on the sdcard partition. I'm going to look into why this happens later this week.
29th October 2014, 02:30 AM |#60  
OP Senior Recognized Developer
Flag Owego, NY
Thanks Meter: 25,504
 
Donate to Me
More
OK. There's a minor bug in recent TWRP releases where it seems to insist on constantly remounting the internal SD. It also double-mounts the internal SD, also mounting it to /and-sec

This is what causes the following failure in recovery.log:
Code:
  Can't open /dev/block/platform/msm_sdcc.1/by-name/sdcard exclusively.  Mounted filesystem?
run_program: child exited with status 5
when setuplvm attempts to pvcreate on the sdcard partition

Workaround: Explicitly unmount /and-sec in the recovery script.

Attached is:
Updated setuplvm which works with recent TWRP releases (should include 2.8.0.1) - it REQUIRES an LVM-aware recovery now, and no longer flashes its own LVM-aware recovery
A repost of removelvm which should be self-explanatory and should work with nearly any recovery other than stock

Later this week I'm going to work on splitting this into two threads: Reference for developers, and reference for users. This thread was intended to be the developer reference for people wanting to implement LVM into their projects.

EDIT: REMEMBER, AS HAS BEEN STATED BEFORE: YOU MUST FLASH THIS FROM THE EXTERNAL SD. FLASHING FROM THE INTERNAL SD OR ADB SIDELOAD WILL FAIL.
Attached Files
File Type: zip setuplvm_find7_FULL_WIPE_10282014.zip - [Click for QR Code] (862.5 KB, 1497 views)
File Type: zip removelvm_find7_FULL_WIPE.zip - [Click for QR Code] (178.2 KB, 1030 views)
The Following 9 Users Say Thank You to Entropy512 For This Useful Post: [ View ]
29th October 2014, 10:02 AM |#61  
magostinelli's Avatar
Member
Flag Prato
Thanks Meter: 12
 
More
Question
Thank you @Entropy512 can you confirm the following procedure:
  1. backup data (include /sdcard)
  2. flash the twrp recovery 2.8.0.1
  3. reboot into recovery
  4. wipeall
  5. flash setuplvm
  6. reboot into recovery
  7. flash rom.zip
The Following User Says Thank You to magostinelli For This Useful Post: [ View ] Gift magostinelli Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes