# Andriod Partitions Question 4 Devs



## vsawri (Nov 18, 2011)

Potentially stupid question here since i'ma a newb, but is there a reason why for the System, Data, Cache partitions to be the sizes they are? Is there a problem with making them bigger?

Like my newb arse was testing Tailor on WebOS and it reported some major wrongs with all the partitions that ACME had created so I wiped them all and recreated them. In hours of playing around to get everything 2 work right with new partitions I have some lingering thoughts: *1) makes sense for System and Cache to be 512MB and 256MB, but 2) why is Data kept so small?*

Originally started playing with tailor cause my SD got jacked when I moved too many apps on to it and couldn't mount it any more. I now have set the DATA partition at 8gb and everything seems 2 be fine still. *shurg* Would this cause a problem later at all? Devs? If not, why doesn't the standard build roll out with 8BG as the default? As that seems to be a good number for apps on all my phones & toys. Would save a lot of headache 2 not deal with apps 2 sd.  just thoughts.


----------



## vsawri (Nov 18, 2011)

HOWTO for anyone interested: Updated on 2011 12-15
Update: resolved 'major:minor pair unavailable'
Update: Works for 32GB HP Touchpad and 16GB HP Touchpad
Update: fixed typo's lmao. thx a_gert.

Credits to: http://www.webos-int...onnects_at_8.25
for the 32GB HP Touchpad filesystem creation example

[FIRST]
1) THIS PROCESS WILL COMPLETELY WIPE YOUR TOUCHPAD! WEBOS, CM7, & ANYTHING ELSE YOU'VE INSTALLED!!
2) This process also assumes you can get functional terminal to your HP Touchpad already via
novaterm, novacom open TTY://, or with putty.
3) This process also assumes you know how to install CM7 already.

YOU WILL ALSO NEED:
webOS Doctor version 3.0.0
webOS Doctor version 3.0.4

[NOW START]
1) Put your HP Touchpad in webOS Recovery Mode:
a. Power off the HP Touchpad or reset it with [Power Button] + [Home]
b. Hold [Up Volume] + [Power Button] until you see a usb symbol on screen.
2) Start up taskmanager in Windows:
a. [CTRL]+[ALT]+[DEL] and select task manager
3) Run webOS Doctor and let it run to 8% then use taskmanager to end task on webOS doctor.
4) Open up windows command prompt and type in: novacom open TTY://
5) Run the following commands [CASE SENSITIVE] type it exactly as shown and make sure
to get the numbers after --minor correct:

[Note: Don't bother customizing webOS partitions because in this process webOS doctor
 will re-size them back to the following anyways.]

a. lvm.static vgscan --ignorelockingfailure
b. lvm.static vgchange -ay --ignorelockingfailure
c. lvm.static vgremove store
d. lvm.static vgscan --ignorelockingfailure
e. lvm.static vgchange -ay --ignorelockingfailure
f. lvm.static vgcreate -s 8M store /dev/mmcblk0p14
g. lvm.static vgscan --ignorelockingfailure
h. lvm.static vgchange -ay --ignorelockingfailure
i. lvm.static lvcreate -l 71 -M y --major 254 --minor 0 -n root store
j. lvm.static lvcreate -l 8 -M y --major 254 --minor 1 -n var store
k. lvm.static lvcreate -l 2 -M y --major 254 --minor 2 -n update store
l. lvm.static lvcreate -l 3 -M y --major 254 --minor 3 -n log store
m. lvm.static lvcreate -l 32 -M y --major 254 --minor 4 -n mojodb store
n. lvm.static lvcreate -l 17 -M y --major 254 --minor 5 -n filecache store

NOTE: THE FOLLOWING --minor JUMPS to 7 from 5 above
o. lvm.static lvcreate -l 64 -M y --major 254 --minor 7 -n swap store

NOTE: THE FOLLOWING MAKES CM7 PARTITIONS, I specified a 5GB cm-data partition,
you can do more or less. 1 Physical Extent (PE) is 8MB.
The number after -l is the number of Physical Extents for the partition.
p. lvm.static lvcreate -l 96 -M y --major 254 --minor 8 -n cm-system store
q. lvm.static lvcreate -l 32 -M y --major 254 --minor 9 -n cm-cache store
r. lvm.static lvcreate -l 640 -M y --major 254 --minor 10 -n cm-data store

NOTE: The following creates the media partition used as SDCARD and sets it to
--minor 6, make sure you set it to --minor 6, the SDCARD is specified as dm-6
in CM7. This will save you from having to edit /etc/vold.fstab in CM7.
s. lvm.static vgscan --ignorelockingfailure
t. lvm.static vgchange -ay --ignorelockingfailure
u. lvm.static vgdisplay
i. this command displays information on the Volume Group: store
at the bottom you should see:
Free PE/Size X / XX
where X is the number of Physical Extents free and XX is the size free.
ii. write down the number of X (Physical Extents free) to use in the next command
v. lvm.static lvcreate -l X -M y --major 254 --minor 6 -n media store
w. lvm.static vgscan --ignorelockingfailure
x. lvm.static vgchange -ay --ignorelockingfailure
y. mkdosfs -f 1 -s 64 -F 32 /dev/store/media
z. mkfs.ext4 /dev/store/cm-system or mkfs.ext3 /dev/store/cm-system
za. mkfs.ext4 /dev/store/cm-cache or mkfs.ext3 /dev/store/cm-cache
zb. mkfs.ext4 /dev/store/cm-data or mkfs.ext3 /dev/store/cm-data
zc. run webOS Doctor 3.0.0 and let it complete and let it reboot to
the language selection screen
zd. reset the HP Touchpad with [POWER BUTTON] + [HOME] and put it into
webOS Doctor recovery mode with [POWER BUTTON] + [VOLUME UP].
ze. run webOS Doctor 3.0.4 and let it complete and let it reboot and complete
webOS install and go into webOS.

If you did everything right, you now have an HP Touchpad tablet with a fresh webOS 3.0.4 and pre-created CM7 partitions. Now, just follow the standard CM7 install procedure after you boot into webOS 3.0.4 to install CM7. ACMEInstaller will use the cm-system, cm-cache, and cm-data file system you've already created.  Enjoy.


----------



## nevertells (Oct 29, 2011)

vsawri said:


> HOWTO for anyone else interested:
> This is for 32GB SD Touchpad & people who already have moboot and CWM Recovery and CM installed before. I'm assuming you can moboot, get into CWM Recovery, and flash CM on-demand.
> 
> 22) go into settings, Wifi, advance Wifi settings, change to 14 channels, and always on.


And what does changing this to 14 channels do? Also, dalingrin has said that he hard coded alpha 3 to wifi never turning off, so changing that setting has no effect.


----------



## peterclauterbach (Dec 12, 2011)

OK, thanks for this.

However, I think I have a problem.

Given:
WebOS 3.0.4
Installed CM 7 alpha 3 for TouchPad

So I had CM 7 alpha 3 up for several days, and really like it. However, I kept running out of disk space, as it tried to reinstall all the apps I have on my phone.

I went to go resize the partitions as suggested above.
When I go to recreate the cm-data partition, I get the following error:

PetersHPTouchPad / # lvcreate -l 1024 -M y --major 254 --minor 12 -n cm-data store
File descriptor 11 (socket:[21605]) leaked on lvcreate invocation. Parent PID 4147: /bin/sh
The requested major:minor pair (254:12) is already used
Aborting. Failed to activate new LV to wipe the start of it.

it looks like there is a existing device with the same major, minor number (store-cryptofilecache)
Am I hosed, or can I pick a different, unique major,minor device for cm-data?

I also just noticed the double dash in the store-cm--cache and store-cm-system names, that does not look right?

Please advise soonest.

PetersHPTouchPad / # ls -Rl /dev |grep 254
crw-rw----	1 root tty 2, 254 Dec 12 02:35 ptyee
crw-rw----	1 root root 254, 0 Dec 12 02:35 rtc0
crw-rw-rw-	1 root tty 3, 254 Dec 12 02:35 ttyee
brw-------	1 root root 254, 9 Dec 12 12:05 store-cm--cache
brw-------	1 root root 254, 8 Dec 12 12:04 store-cm--system
brw-------	1 root root 254, 11 Dec 12 02:35 store-cryptodb
brw-------	1 root root 254, 12 Dec 12 02:35 store-cryptofilecache
brw-------	1 root root 254, 5 Dec 12 02:35 store-filecache
brw-------	1 root root 254, 3 Dec 12 02:35 store-log
brw-------	1 root root 254, 4 Dec 12 02:35 store-mojodb
brw-------	1 root root 254, 0 Dec 12 02:35 store-root
brw-------	1 root root 254, 7 Dec 12 02:35 store-swap
brw-------	1 root root 254, 2 Dec 12 02:35 store-update
brw-------	1 root root 254, 1 Dec 12 02:35 store-var

Here is the full log of what I did:

PetersHPTouchPad / # umount /media/internal
PetersHPTouchPad / # mount |grep internal
PetersHPTouchPad / # umount -f /dev/store/media
umount: can't forcibly umount /dev/store/media: Invalid argument
PetersHPTouchPad / # mount
rootfs on / type rootfs (rw)
/dev/root on /boot type ext3 (ro,relatime,errors=continue,barrier=0,data=writeback)
/dev/mapper/store-root on / type ext3 (rw,relatime,errors=continue,barrier=0,data=writeback)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/mapper/store-root on /dev/.static/dev type ext3 (ro,relatime,errors=continue,barrier=0,data=writeback)
tmpfs on /dev type tmpfs (rw,relatime,size=2048k,mode=755)
none on /dev/cpuacct type cgroup (rw,relatime,cpuacct,cpu)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
/dev/mapper/store-var on /var type ext3 (rw,noatime,errors=continue,barrier=0,data=writeback)
/dev/mapper/store-log on /var/log type ext3 (rw,noatime,errors=continue,barrier=0,data=writeback)
tmpfs on /tmp type tmpfs (rw,relatime,size=40960k)
tmpfs on /var/run type tmpfs (rw,relatime,size=16384k)
tmpfs on /var/tmp type tmpfs (rw,relatime,size=32768k)
tmpfs on /media/ram type tmpfs (rw,relatime)
cryptofs on /media/cryptofs type fuse.cryptofs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
none on /dev/cpuset type cgroup (rw,relatime,cpuset)
/dev/mapper/store-cryptodb on /var/db type ext3 (rw,noatime,errors=continue,barrier=0,data=ordered)
/dev/mapper/store-cryptofilecache on /var/file-cache type ext3 (rw,noatime,errors=continue,user_xattr,barrier=0,data=writeback)
extractfs on /var/luna/data/extractfs type fuse.extractfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
PetersHPTouchPad / # mount |grep media
tmpfs on /media/ram type tmpfs (rw,relatime)
cryptofs on /media/cryptofs type fuse.cryptofs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
PetersHPTouchPad / # lvremove /dev/store/media
File descriptor 11 (socket:[21605]) leaked on lvremove invocation. Parent PID 4147: /bin/sh
Do you really want to remove active logical volume "media"? [y/n]: y
Logical volume "media" successfully removed
PetersHPTouchPad / # lvremove /dev/store/cm-system
File descriptor 11 (socket:[21605]) leaked on lvremove invocation. Parent PID 4147: /bin/sh
Do you really want to remove active logical volume "cm-system"? [y/n]: y
Logical volume "cm-system" successfully removed
PetersHPTouchPad / # lvremove /dev/store/cm-cache
File descriptor 11 (socket:[21605]) leaked on lvremove invocation. Parent PID 4147: /bin/sh
Do you really want to remove active logical volume "cm-cache"? [y/n]: y
Logical volume "cm-cache" successfully removed
PetersHPTouchPad / # lvremove /dev/store/cm-data
File descriptor 11 (socket:[21605]) leaked on lvremove invocation. Parent PID 4147: /bin/sh
Do you really want to remove active logical volume "cm-data"? [y/n]: y
Logical volume "cm-data" successfully removed
PetersHPTouchPad / # vgscan --ignorelockingfailure
File descriptor 11 (socket:[21605]) leaked on vgscan invocation. Parent PID 4147: /bin/sh
Reading all physical volumes. This may take a while...
Found volume group "store" using metadata type lvm2
PetersHPTouchPad / # vgchange -ay --ignorelockingfailure
File descriptor 11 (socket:[21605]) leaked on vgchange invocation. Parent PID 4147: /bin/sh
7 logical volume(s) in volume group "store" now active
PetersHPTouchPad / # lvcreate -l 64 -M y --major 254 --minor 8 -n cm-system store
File descriptor 11 (socket:[21605]) leaked on lvcreate invocation. Parent PID 4147: /bin/sh
Logical volume "cm-system" created
PetersHPTouchPad / # lvcreate -l 32 -M y --major 254 --minor 9 -n cm-cache store
File descriptor 11 (socket:[21605]) leaked on lvcreate invocation. Parent PID 4147: /bin/sh
Logical volume "cm-cache" created
PetersHPTouchPad / # lvcreate -l 1024 -M y --major 254 --minor 12 -n cm-data store
File descriptor 11 (socket:[21605]) leaked on lvcreate invocation. Parent PID 4147: /bin/sh
The requested major:minor pair (254:12) is already used
Aborting. Failed to activate new LV to wipe the start of it.
PetersHPTouchPad / # lvcreate -l 1024 -M y --major 254 --minor 12 -n cm-data store
File descriptor 11 (socket:[21605]) leaked on lvcreate invocation. Parent PID 4147: /bin/sh
The requested major:minor pair (254:12) is already used
Aborting. Failed to activate new LV to wipe the start of it.
PetersHPTouchPad / # ls -lrta /dev/store


----------



## dragonfly1113 (Dec 6, 2011)

wish there was an easier way to do this lol.


----------



## Aganar (Oct 29, 2011)

Any reason why we can't make a script to do all of this? That looks like standard linux console text to me. Is there any reason it can't be automated?


----------



## a_gert (Dec 12, 2011)

With the process listed above, is it possible to restore a CWM backup with all apps/data, or are those dependent on the original partition structure being in place? Simply put, is there a way to do the process that is ultimately non-destructive (even if a restore is necessary), or do you need to restart from a fresh CM7 install? I've hit the 1.5 GB limit and the 50 app limit for the SD Card, and I haven't used WebOS since installing Android, so there is no reason for the shared partition to remain quite so large. Thanks!


----------



## Deuce (Oct 16, 2011)

I'd assume you could just use "Tailor"from webOS alpha feeds to shrink the media partition slightly and increase the Android data partition.

This is the procedure i used after borking my Android sdcard partition:

I wouldn't recommend an amateur try my methods unless you are perfectly clear on my instructions. Improper configurations can brick your device permanently

First, i made a nandroid backup of my CM system, then copied it to my PC. I didn't have any webos data i cared to backup.this will wipe your sdcard partitions, so backup the whole sdcard to pc!

I had problems with my partitions, so i installed "Tailor" from preware alpha feeds, removed all partitions (ext3fs from ubuntu chroot, 3x Android, and the large "internal" partition shared between webos and Android "sdcard" too. Then added a full usb partition (26-27gb on 32g TP)). It gave errors, but i rebooted and tailor allowed creation of 1 big media partition (as it came stock).

Webos lost all my apps and data, so I then performed a standard webOS doctor and webOS was nice and clean, then i reinstalled Android through the normal documented novacom methods. Then copied my nandroid backup to sdcard/clockworkmod/backup and restored it. This reclaimed all space and fixed my Android sdcard mount issues. Android restored just like i left it, but with a working sdcard partition.

That being said, i think the problem was really just a simple drive mapping that i couldn't figure out.


----------



## vsawri (Nov 18, 2011)

yes you can script this, but where's the fun in that! lmao!

and i updated it so it works for everyone.


----------



## dragonfly1113 (Dec 6, 2011)

vsawri said:


> yes you can script this, but where's the fun in that! lmao!
> 
> and i updated it so it works for everyone.


Might give this a go tonight







thanks.


----------



## nevertells (Oct 29, 2011)

@vsawri,

Do you know the answer to my original post to you: "And what does changing this to 14 channels do? Also, dalingrin has said that he hard coded alpha 3 to wifi never turning off, so changing that setting has no effect."

Thanks


----------



## vsawri (Nov 18, 2011)

well, if that's what dalingrin says then that's that. lol. i didn't read, i assumed it's a functional setting. Dual Band routers, like mine, that has Wireless G and Wireless N in like one of my cisco routers puts G on from 1-11 and does N from 1-14. And then N band is usually on one of the high bands. i just assumed this was a functional setting since I didn't read. I assumed that if a setting wasn't functional the dev would gray it out, common sense you know. LoL. if it's a useless setting, then it's a useless setting.  I hope it's hard coded at 14. LoL.


----------



## a_gert (Dec 12, 2011)

For the described process, is there some reason the second restore has to start with 3.0.0 and then go to 3.0.4? Or could you just go straight to 3.0.4? Also, are there any slight hardware revisions that would prevent 3.0.0 from working? My Touchpad came with 3.0.2 preinstalled, just want to check before I screw something up.


----------



## a_gert (Dec 12, 2011)

Just FYI, in the process of this now, noticed for the part about creating the CM partitions you provided the partition naming flags as "-m" instead of "-n" in your update. This is a typo, correct?

Update: Process worked beautifully, used "-n" flags where appropriate, not "-m", to name partitions. cm-data "X" value of 1024 sets internal storage partition to 8 GB. Only pitfall I had was the 3.0.4 doctor failing at the end, but I couldn't care less whether I'm running 3.0.0. Thanks!


----------



## nevertells (Oct 29, 2011)

vsawri said:


> well, if that's what dalingrin says then that's that. lol. i didn't read, i assumed it's a functional setting. Dual Band routers, like mine, that has Wireless G and Wireless N in like one of my cisco routers puts G on from 1-11 and does N from 1-14. And then N band is usually on one of the high bands. i just assumed this was a functional setting since I didn't read. I assumed that if a setting wasn't functional the dev would gray it out, common sense you know. LoL. if it's a useless setting, then it's a useless setting.  I hope it's hard coded at 14. LoL.


I'm better understanding what you are saying now. Wireless N uses those upper channels, so it makes sense to turn on all 14. However, in previous threads, so many people were having problems with their wifi and were able to resolve it by changing their router from automatic channel selection to locking it to channel 6 or lower. What I have suggested is they use an app called Wifi Analyzer to look at what channels are being used the most in their area and lock their router to channel 1 or 6, whichever has the least people using it. It seems the TouchPad does not like the upper channels when running CM7. Using channel 1 or 6 gives one the most separation between the two. Even people using wireless N seemed to have some luck locking down the router to a lower channel.


----------



## vsawri (Nov 18, 2011)

it seems that unless you restore to 3.0.0 the process usually fails for the others.  i've tested on multiple touchpads. restore to 3.0.0 first makes restore to other versions work. it seems 3.0.0 restore does code for partitions or something. It re-sizes and formats them properly.


----------



## peterclauterbach (Dec 12, 2011)

vsawri, thanks very much! Even though the process is still manual, it is a lot clearer what is going on.


----------



## peterclauterbach (Dec 12, 2011)

Excellent! was able to get this reset and loaded in about an hour. Thanks again, vsawri!

The only trouble I had was the -n typo (noted above), and still ran out of disk space when trying to update from the market. Deleting the Updates just from the Android Market made this problem go away.


----------



## Zzed (Oct 20, 2011)

Thanks for a nice piece of documentation. What software would you suggest to script this? I'm a fresh noob when it comes to webOS/Linux/Andriod terminal talk.


----------



## Zzed (Oct 20, 2011)

vsawri said:


> yes you can script this, but where's the fun in that! lmao!
> 
> and i updated it so it works for everyone.


Thanks again for the info. At first I didn't think I needed it as I started with a semi brick that got stuck in webOS doctor at 12%. 
I thought I resolved with: mkfs.msdos /dev/mapper/store-media ... just to get all the way through CM7.1 alpha 3.5 reload that booted but complained that the SD card was corrupt and needed format.

I decided to give this procedure a spin to "wipe clean" all file system issues. If I were smarter I probably could have dealt with just the affected partition but I needed the experience.

Good job and many thanks.


----------



## tzzoooma (Oct 14, 2011)

After steps Z, ZA, and ZB, I get the message:

mke2fs 1.41.4 (27-Jan-2009)
mkfs.ext4: invalid blocks count -- or

Please tell me if this is correct, or if I have a problem somewhere?


----------



## jcsullins (Sep 27, 2011)

For a MUCH safer way to resize /data, check this thread: http://rootzwiki.com/topic/13277-cm7-fixes-for-sdcard-issues/


----------



## Zzed (Oct 20, 2011)

tzzoooma said:


> After steps Z, ZA, and ZB, I get the message:
> 
> mke2fs 1.41.4 (27-Jan-2009)
> mkfs.ext4: invalid blocks count -- or
> ...


There are two commands listed on those lines. I used the first part and omitted all from the "or" on.


----------



## Zzed (Oct 20, 2011)

jcsullins said:


> For a MUCH safer way to resize /data, check this thread: http://rootzwiki.com...-sdcard-issues/


Great work on that thread JC. I'd wish I saw that to begin with. I'm going to use it as a preventative measure.


----------



## Varemenos (Aug 23, 2011)

Deuce said:


> I'd assume you could just use "Tailor"from webOS alpha feeds to shrink the media partition slightly and increase the Android data partition.
> 
> This is the procedure i used after borking my Android sdcard partition:
> 
> ...


after hours of searching on how to reallocate some space i lost and couldnt get back by lvresize, im finally able to do it through Tailor.
Thanks a lot!


----------



## nevertells (Oct 29, 2011)

dragonfly1113 said:


> wish there was an easier way to do this lol.


There is!!!! Go to this thread and read, read, read! http://rootzwiki.com...-sdcard-issues/

This is as about as easy as it gets. Make sure you follow JC's instructions. Just be aware that you may have
to completely uninstall CM7 and reinstall it to get the memory update to work correctly. Also after restoring
your backup you will need to run the fsck fix again as your backup overwrites the file it installs. Once you have
done a new backup after running fsck, then the file is saved in your backup. It's really nice to have 3.5 gigs of
internal memory instead of the 1.5 that CM7 reserves. Hopefully one will never have to move apps off onto one's
SD card for lack of internal memory.

BTW, if you have been moving apps onto your SD card and run into the 50+ app limit, JC has a fix for that too.

And I'll say it again, read JC's instruction and all of the thread. There is a lot of good information that will help
you successfully accomplish these fixes.


----------

