FORUMS
Remove All Ads from XDA

The most Powerful Feature of the HP Touchpad (LVM)

474 posts
Thanks Meter: 234
 
By HP_TOUCHPAD, Senior Member on 12th January 2019, 06:29 AM
Post Reply Email Thread
Flash files are available here to automatically create the swap partition:
https://forum.xda-developers.com/hp-...0#post78939182

How to configure the Hp Touchpad internal storage

The most important feature that was ahead of its time and still until today is the use of LVM (Logical Volume Manager) for managing the internal storage.
To the regular user it will be insignificant but it can provide great benefits if deploy properly.
I could be wrong, but the TP could be the first and only mobile device ever shipped with LVM even now. (someone can correct me on this)
What is LVM?
https://en.wikipedia.org/wiki/Logica...anager_(Linux)

I am a regular user and not an expert on LVM in Linux, the only device that I have to play with LVM is the TP and will show you the basics usage and it may not even have the full potential settings.

In webOS there is a program (app) call Tailor ( Formerly Known as Resizah ), a graphical interface to manage LVM.
http://preware.pivotce.com/package/o...ternals.tailor
https://www.webos-internals.org/wiki/Application:Tailor
https://forums.webosnation.com/webos...a-testing.html
https://github.com/rwhitby/tailor
The last alpha version 0.3.1 allows for creating a LuneOS partition.
Also you can create all Android partitions inside WebOS, create and resize all partitions while running WebOS.The magic of LVM!
Attached is a screen shot of my TP running Taylor.

Think of it as creating, deleting , moving, expanding or reducing (files and folders) with your file manager. Instead it will be the actual storage card, partitions, volumes. All done withing the OS no need to reboot or enter any commands. Resizing the android system, cache or data partition live inside android with just touch input.! That is how easy it could have been, but Android does not use LVM and the TP had to follow the rest of the herd. The reason that WebOS, Android, LuneOS (and more OS) can be install together is due to the flexibility of LVM.

The ToolBox by jcsullins provides scripts to create webOS and Android volumes and resize system, cache and data. But is not a live system and limited to pre-configure settings.

All the flexibility and easy to use comes with a risk of data lost as we know not everything in the computer world works as intended, due to the endless configuration and uses of each user.
Code:
This is a 32G Touchpad with WebOS, Android and LuneOS install and perfectly running.
Factory install WebOS (original)
Used ToolBox to create Android system, cache and data
Used Taylor to create luneos-root
List of physical volumes
  /dev/store/root        [      568.00 MB] 
  /dev/store/var         [       64.00 MB] 
  /dev/store/update      [       16.00 MB] 
  /dev/store/log         [       24.00 MB] 
  /dev/store/mojodb      [      256.00 MB] 
  /dev/store/filecache   [      136.00 MB] 
  /dev/store/media       [       19.44 GB] 
  /dev/store/swap        [      400.00 MB] 
  /dev/store/cm-cache    [      200.00 MB] 
  /dev/store/cm-data     [        4.88 GB] 
  /dev/store/cm-system   [        1.17 GB] 
  /dev/store/luneos-root [        1.95 GB] 
  12 disks
  0 partitions
  0 LVM physical volume whole disks
  0 LVM physical volumes

LVM is reporting to each OS its own disks and each OS mounts its own Disk using f stabs. In reality there is only one storage, not 12 ( the magic of LVM !

This is a 32G Touchpad that was completely reset using the Toolbox.
  /dev/block/mmcblk0p8  [      10.00 MiB] 
  /dev/block/mmcblk0p9  [       1.46 MiB] 
  /dev/block/mmcblk0p1  [     100.00 MiB] 
  /dev/block/mmcblk0p10 [       3.00 MiB] 
  /dev/block/mmcblk0p11 [       3.00 MiB] 
  /dev/block/mmcblk0p3  [       1.46 MiB] 
  /dev/block/mmcblk0p12 [       4.00 MiB] 
  /dev/block/mmcblk0p13 [      32.00 MiB] 
  /dev/block/mmcblk0p14 [      29.09 GiB] LVM physical volume
  /dev/block/mmcblk0p6  [     750.00 KiB] 
  /dev/store/media      [      29.09 GiB] 
  /dev/block/mmcblk0p7  [       2.44 MiB] 
  1 disk
  10 partitions
  0 LVM physical volume whole disks
  1 LVM physical volume

/dev/block/mmcblk0p13 ( is the boot partition ) 32 MB where all the uImages are boot it from.

This is the physical volume the real internal storage.
  PV                    VG    Fmt  Attr PSize  PFree
  /dev/block/mmcblk0p14 store lvm2 a-   29.09g    0 

This is the logical volume of the physical volume which is part of the volume group "store"
The media USB storage in Android. This is the logical volume to resize and create other logical volume.
  --- Logical volume ---
  LV Name                /dev/store/media
  VG Name                store
  LV UUID                WhFWig-xwTY-0SK3-OnrS-32mq-gADG-7mLY7c
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                29.09 GiB
  Current LE             3723
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Persistent major       254
  Persistent minor       6
  Block device           253:6

This is all done loading TWRP mounting /boot and adb shell.
The working directory for lvm.static is:
/boot/usr/sbin
to execute ./lvm.static plus command.

Resizing Logical volume /dev/store/media to 1GB

./lvm.static lvresize --size 1G /dev/store/media

  PV                    VG    Fmt  Attr PSize  PFree 
  /dev/block/mmcblk0p14 store lvm2 a-   29.09g 28.09g

Now there is 28.09g free to be allocated to any volume (disk) we want to create
Keep in mind the Persistent minor is 6 of the major 254 ( the next disk can be from 0 to 5 and 7 to 254 ) but 6 is already taken.

Creating Android volume cm-system
./lvm.static lvcreate -L 1.3G -M y --major 254 --minor 0 -n /dev/store/cm-system

Creating Android volume cm-cache
./lvm.static lvcreate -L 200M -M y --major 254 --minor 1 -n /dev/store/cm-cache 

Creating Android volume cm-data (4GB)
./lvm.static lvcreate -L 4G -M y --major 254 --minor 2 -n /dev/store/cm-data

Activating the new logical volume
/boot/usr/sbin # ./lvm.static vgchange -ay
  4 logical volume(s) in volume group "store" now active

/boot/usr/sbin # ./lvm.static pvs
  PV                    VG    Fmt  Attr PSize  PFree 
  /dev/block/mmcblk0p14 store lvm2 a-   29.09g 22.59g

There is 22.59GB free to create more volume or disk!

Let's create volumes to install Linux as chroot
./lvm.static lvcreate -L 2G -M y --major 254 --minor 5 -n /dev/store/Linux-root

Another chroot as Debian! 
./lvm.static lvcreate -L 2G -M y --major 254 --minor 7 -n /dev/store/debian-root

Create LuneOS volume
./lvm.static lvcreate -L 2G -M y --major 254 --minor 4 -n /dev/store/luneos-root

There is 16.59GB free
/boot/usr/sbin # ./lvm.static pvs
  PV                    VG    Fmt  Attr PSize  PFree 
  /dev/block/mmcblk0p14 store lvm2 a-   29.09g 16.59g

Let's create another Android installation ( completely independent )
Android PIE system
./lvm.static lvcreate -L 1.3G -M y --major 254 --minor 8 -n /dev/store/A_PIE-system
Android PIE cache
./lvm.static lvcreate -L 200M -M y --major 254 --minor 9 -n /dev/store/A_PIE-cache
Android PIE Data (4GB)
./lvm.static lvcreate -L 4G -M y --major 254 --minor 10 -n /dev/store/A_PIE-data

There is 11.09GB free
/boot/usr/sbin # ./lvm.static pvs
  PV                    VG    Fmt  Attr PSize  PFree 
  /dev/block/mmcblk0p14 store lvm2 a-   29.09g 11.09g

Let's create SailFishOS!
./lvm.static lvcreate -L 2G -M y --major 254 --minor 11 -n /dev/store/Sailfish_OS

Another Installation Android 10 Queso!
A_Queso-system
./lvm.static lvcreate -L 1.3G -M y --major 254 --minor 12 -n /dev/store/A_Queso-system
A_Queso-cache
./lvm.static lvcreate -L 200M -M y --major 254 --minor 13 -n /dev/store/A_Queso-cache 
A_Queso_data
./lvm.static lvcreate -L 2G -M y --major 254 --minor 14 -n /dev/store/A_Queso_data

There is 5.59GB free
  PV                    VG    Fmt  Attr PSize  PFree
  /dev/block/mmcblk0p14 store lvm2 a-   29.09g 5.59g

What about a swap volume!
./lvm.static lvcreate -L 1G -C y -M y --major 254 --minor 15 -n /dev/store/swap

Now we can give the command to LVM to extend media to use the 4.59GB available and use it all.
/lvm.static lvresize -l 100%FREE /dev/store/media

  15 logical volume(s) in volume group "store" now active

Here is the summary of all the disks available:

/boot/usr/sbin # ./lvm.static lvmdiskscan 
  /dev/block/mmcblk0p8      [      10.00 MiB] 
  /dev/store/cm-system      [       1.30 GiB] 
  /dev/block/mmcblk0p9      [       1.46 MiB] 
  /dev/block/mmcblk0p1      [     100.00 MiB] 
  /dev/store/cm-cache       [     200.00 MiB] 
  /dev/block/mmcblk0p10     [       3.00 MiB] 
  /dev/store/cm-data        [       4.00 GiB] 
  /dev/block/mmcblk0p11     [       3.00 MiB] 
  /dev/block/mmcblk0p3      [       1.46 MiB] 
  /dev/block/mmcblk0p12     [       4.00 MiB] 
  /dev/store/luneos-root    [       2.00 GiB] 
  /dev/block/mmcblk0p13     [      32.00 MiB] 
  /dev/store/Linux-root     [       2.00 GiB] 
  /dev/block/mmcblk0p14     [      29.09 GiB] LVM physical volume
  /dev/block/mmcblk0p6      [     750.00 KiB] 
  /dev/store/media          [       4.59 GiB] 
  /dev/block/mmcblk0p7      [       2.44 MiB] 
  /dev/store/debian-root    [       2.00 GiB] 
  /dev/store/A_PIE-system   [       1.30 GiB] 
  /dev/store/A_PIE-cache    [     200.00 MiB] 
  /dev/store/A_PIE-data     [       4.00 GiB] 
  /dev/store/Sailfish_OS    [       2.00 GiB] 
  /dev/store/A_Queso-system [       1.30 GiB] 
  /dev/store/A_Queso-cache  [     200.00 MiB] 
  /dev/store/A_Queso_data   [       2.00 GiB] 
  /dev/store/swap           [       1.00 GiB] 
  15 disks
  10 partitions
  0 LVM physical volume whole disks
  1 LVM physical volume

Now we can format every disk with ext2, ext3, ext4 and vfat
Example to format Android system volumen

mke2fs -E lazy_itable_init=0 -t ext4 /dev/store/cm-system

mke2fs -E lazy_itable_init=0 -t ext4 /dev/store/cm-cache

mke2fs -E lazy_itable_init=0 -t ext4 /dev/store/cm-data

To make swap
mkswap /dev/store/swap 

This is very easy to create, and quick there is no waitting time is done as soon as you press enter.

We have create it a Touchpad that is capable of running the following OS independently.

Current Version of Android
A version of Android PIE 9
A version of Android Queso 10
LuneOS
SailfishOS
Linux-root (to run as chroot or native)
debian-root (to run as chroot or native)
A 1GB swap file

The volume size of the disk created are minimum or below requirement but this is to show how powerful and simple LVM is to set up.
Attached Thumbnails
Click image for larger version

Name:	tailor_on_Webos.png
Views:	128
Size:	75.0 KB
ID:	4684799  
 
 
13th February 2019, 01:47 PM |#2  
Member
Thanks Meter: 13
 
More
Hi @HP_TOUCHPAD !

Good to see someone with your structured approach sharing tutorials and hints! Cheers for that!
I stumbled upon my 16GB and 32GB Touchpads on the weekend and I want to give them a new spin.
Especially LuneOS was not known to me before your post!

Any chance of you sharing your current setup and how you managed to set it up?

I am curious to factory reset my Touchpads (at least the 32GB one) and set them up with webOS + LuneOS + Android (which ROM do you use?)...

You being the knowledgable 'tutor' around here - would you share your 'webOS + LuneOS + Android' experience and how to set it up?

Cheers!
Curious greetings, raimerik
13th February 2019, 02:14 PM |#3  
OP Senior Member
Thanks Meter: 234
 
More
Thank you for your comments!
As of right now I am working on just that, a simple way for anyone just to flash a zip file and have everything that you need to have the Tablet set up. There is a lot of steps to do and gets confusing, hopefully the new process will work for everyone.
I will post when done!
13th February 2019, 02:31 PM |#4  
Member
Thanks Meter: 13
 
More
Quote:
Originally Posted by HP_TOUCHPAD

Thank you for your comments!
As of right now I am working on just that, a simple way for anyone just to flash a zip file and have everything that you need to have the Tablet set up. There is a lot of steps to do and gets confusing, hopefully the new process will work for everyone.
I will post when done!

Wow - cheers! - looking forward to testing it once it's done! :] raimerik
14th February 2019, 01:38 PM |#5  
Senior Member
Thanks Meter: 55
 
More
I will try it and test it out too. My Touchpad is afraid of nothing.
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