Repartition Linux swap - G1 Q&A, Help & Troubleshooting

Hi, ive searched around but cannot seem to find a complete answer, but basically is there a way to just repartition my linux swap from 32MB to 96MB.
I dont have a linux cd and so if theres a way to do it through ADB or recovery, that would be great.
Thanks.

D3NNY said:
Hi, ive searched around but cannot seem to find a complete answer, but basically is there a way to just repartition my linux swap from 32MB to 96MB.
I dont have a linux cd and so if theres a way to do it through ADB or recovery, that would be great.
Thanks.
Click to expand...
Click to collapse
i'll give you the short answer then i will edit this post with the long answer
short answer.
you use the resize command in parted on your ext3 and linux-swap partition. if you have used parted from the recovery console a few times before this will be easy but i will post through instructions in a minute
Long answer
go into the recovery console. (recovery screen then last option)
then type (if you want to use adb just type adb shell then do the commands)
Code:
parted /dev/block/mmcblk0
print (you will need the start and end points for your ext3 and linux-swap partitions)
resize 2 [start point] [end - 64mb]
resize 3 [start - 64mb] [end]
print (to verify it worked)
quit
upgrade_fs
reboot
there you go.
I have not tested the resize command on an ext3 partition but i do not think (key word think) it will destroy your data on ext3, but back up just to make sure.
to back up your ext3
with adb (since i assume you have it from the first post)
Code:
adb pull /system/sd [dir on computer]
to restore on empty card
Code:
adb shell mkdir /system/sd
adb push [dir on computer] /system/sd

thanks for the great reply. Will test out now and see what happens!

Can anyone verify if this works?
My only concern is the resizing of ext3. Will it cut out any data since I am shortening the partition?

mr_roboto said:
Can anyone verify if this works?
My only concern is the resizing of ext3. Will it cut out any data since I am shortening the partition?
Click to expand...
Click to collapse
Yes, it works. And yes it *can* corrupt/delete some data from the ext3 depending on how much extra space you have. To be safe, just back-up. The easiest way is doing a BART or switchrom backup (Which backs up you ext) move the backup from the FAT partition to a computer (not necessary but you seem worried about your ext, so just to be safe) resize the partitions and restore your backups.

or just use amon recovery

Thanks for the response guys, I went and started reading about switchrom.
I am planning to do the following steps:
switchrom.sh -s // to store my rom
resize my partitions
switchrom.sh -r
The thread says it stores the nandroid and the app data, I am assuming that means nandroid and ext partition right?

D3NNY said:
Hi, ive searched around but cannot seem to find a complete answer, but basically is there a way to just repartition my linux swap from 32MB to 96MB.
I dont have a linux cd and so if theres a way to do it through ADB or recovery, that would be great.
Thanks.
Click to expand...
Click to collapse
I don't think this is the same, but I am running a hero rom and was wondering what "swappiness" is? I keep reading stuff like "swappiness of 96mb", etc. Is this just referencing the linux swap file size? and with me running a hero rom, what is the best setup for my SD card? I am currently running simply a fat32 partition and an ext3- thanks

Related

How do i enable compcache on CM 3.9.2 and higher? [SOLVED]

I have been searching for a clear guide to enabling compcache on 3.9.2, but there is so much info about swap and compcache in this forum i feel like im running around like a chicken with its head cut off.
so far i have pushed 3 different userinit.sh files into my /system/sd with no change.
#free shows 0 swap , #cat /proc/ramzswap says doesnt exist , #cat /proc/swaps comes up blank.
So i searched more and ended up making a 32mb linuxswap partition on my sd and cant figure out how to get that moving either.
Im bogged down with information and have no idea where to start.
Someone point me in the right direction please. Im a swap/compcache noob...
i would like to run them both together, but as i said i need a noob setup guide
Your /system/sd is a mounted ext filesystem, correct?
Push the userinit.sh from here:
http://forum.xda-developers.com/showthread.php?t=542304
Then run it as root and report back any results:
# /system/sd/userinit.sh
i pushed userinit.sh to /system/sd/ with adb
then put in console
su
# /system/sd/userinit.sh and got /system/sd/userinit.sh: permission denied
should i be doing this in the recovery console?
and what did u mean by: is my system/sd/ a mounted ext filesystem?
i did adb remount to mount /system/ as r/w if thats what you meant.
let me apologize once again. i have almost no knowledge of linux commands. a step by step would really save some time. the only thing i hate more than not understanding something, is wasting others time while i do it.
ShatBag1105 said:
and what did u mean by: is my system/sd/ a mounted ext filesystem?
Click to expand...
Click to collapse
sounds like you did not set up a second partition (or a 3rd for that matter) on your sdcard.
there are many different ways to do this (I prefer gparted in linux), but here's one guide that uses parted in cyanogen's 1.4 recovery image:
http://forum.xda-developers.com/showthread.php?t=534714
hit me up if you hit a snag
gl
im pretty sure you are right. My mmcblk0p2 exists (of course) but when I check # /dev/block/mmcblk0p3 it says not found. And if I # ls /dev/block/mmcbl0p3 it says no such file or directory.
Im guessing i botched something in paragon partition 9. if i remember correctly i put the 32mb linuxswap partition between my fat32 and ext3.
Do u think i should create a new linuxswap partition after my ext3 with paragon9, or is there a workaround for my mistake? does the phone even recognize my poorly placed partition as anything?
thanks so much for your help. after a few hours of reading all these threads Ive come to realize you are the resident expert in swap compcache scripts. as for myself.... not so much
ext should be 2nd partition.
...and linux swap 3rd if you're using it (but it's not needed for compcache -- only as a backing swap).
I'd kill them both and readd with some variant of parted -- i've read that some are having trouble w/ paragon partitioning
Very well then. Ill reformat today and report back.
First of all! Paragon Partition Manager is a FARCE!
Gparted Live CD was awesome. Paragon had my sdcard looking pretty bad. I had 32mb of unallocated space between my FAT32 and EXT3. Even though paragon was telling me it was formatted to linuxswap.
I moved my ext3 over and created a 32mb linuxswap at the end of the sdcard with no loss of data. wow
But sadly, i pushed the userinit.sh #free shows 0 swap and #cat /proc/swaps shows nothing.
Im going to try this >> http://forum.xda-developers.com/showthread.php?t=542899 <<<WORKED!!
What ive learned:
Use Gparted to create a linuxswap partition AFTER your EXT3. Paragon is pure ****.
Get the user.conf and userinit.sh file from the link in above post.
Put them in the root of your sd card
I DID THIS WITH TERMINAL
su
mount -o remount,rw /dev/block/mtdblock3 /system
cp /sdcard/userinit.sh /system/sd
cp /sdcard/user.conf /system/sd
chmod 755 /system/sd/user.conf
chmod 755 /system/sd/userinit.sh
type #sh /system/sd/userinit.sh into console to activate the script.
type #sh /system/sd/userinit.sh -s to get a pretty well detailed report of the goings on.
OOOh being a linux noob is much headache.
Alpapa Thanks for giving me your time and pointing me in the right directions. Thanks man.
ShatBag1105 said:
Use Gparted to create a linuxswap partition AFTER your EXT3. Paragon is pure ****.
push the user.conf file (from link in above post) to /system/sd along with your userinit.sh.
type #sh /system/sd/userinit.sh into console to activate the script.
type #sh /system/sd/userinit.sh -s to get a pretty well detailed report of the goings on.
OOOh being a linux noob is much headache.
Alpapa Thanks for giving me your time and pointing me in the right directions. Thanks man.
Click to expand...
Click to collapse
I'm a newb as well... so did you chmod either of those files after moving them to ext2/3?
Yes. You have to chmod both of them.
And this works on 3.9.4.
V 0.1 files work best.
http://forum.xda-developers.com/showthread.php?t=542899
And these files come with everything disabled, so you have to edit both of them and enable what u want before putting them on your sd.
0=disabled
1=enabled

Switching SD Cards

I just received my new class 6 SD card in the mail today, and I was wondering how I can transfer all my files over to it. I don't mean like music and stuff like that, but like my Apps2SD. I don't exactly know what all I have to transfer over, but if someone can give me the adb commands and what I'm trying to transfer, that would be great.
Go to the recovery console
mount /sdcard
mkdir /sdcard/ext
cp /system/sd/* /sdcard/ext/
the copy the ext folder to your new card, put it in your phone and go back to recovery
mount -o rw /dev/block/mmcblk0p2 /system/sd
cp /sdcard/ext/* /system/sd/
I've probably made a couple of mistakes with mounting the partitions correctly, so you may have to mount /sdcard on the second batch of commands.
Anartic said:
I just received my new class 6 SD card in the mail today, and I was wondering how I can transfer all my files over to it. I don't mean like music and stuff like that, but like my Apps2SD. I don't exactly know what all I have to transfer over, but if someone can give me the adb commands and what I'm trying to transfer, that would be great.
Click to expand...
Click to collapse
Use Adrian's method
awesome, i've been wanting to know how to do this myself so this will definitely come in useful.
B-man007 said:
pretty sure the adb command is
adb pull /system/sd/*
then use adb push to get it back on the new one.
that should get everything on your ext partition. (note: do this while phone is booted into the rom. else you will need to mount the ext partition)
(if you need clarification, dont mind asking)
Click to expand...
Click to collapse
What? Pushing apps to the ext is not a good idea when the phone is in the ROM (when I tried half of them showed and half of those FCed)
You can easily mount your ext - mount -o rw /dev/block/mmcblk0p2 /system/sd
AdrianK said:
What? Pushing apps to the ext is not a good idea when the phone is in the ROM (when I tried half of them showed and half of those FCed)
You can easily mount your ext - mount -o rw /dev/block/mmcblk0p2 /system/sd
Click to expand...
Click to collapse
i don't push i use adb install that way all of them get installed and i don't have the problem with certain apps not showing up right.
you say that like i want to type a really long command, i just use adb remount, or if i am forced to use my phones keyboard for command i just go to the recovery console and use mount system or mount system/sd depending on how specific i feel . (i hate typing commands on the g1s keyboard, and its and epic fail if you mess a long one up.)
david1171 said:
i don't push i use adb install that way all of them get installed and i don't have the problem with certain apps not showing up right.
you say that like i want to type a really long command, i just use adb remount, or if i am forced to use my phones keyboard for command i just go to the recovery console and use mount system or mount system/sd depending on how specific i feel . (i hate typing commands on the g1s keyboard, and its and epic fail if you mess a long one up.)
Click to expand...
Click to collapse
easiest way i have done this is do a switchrom backup, make sure its saved to your old sd, get your new sd partitioned correctly, and copy the switchrom folder from your old sd to your new one, then do the normal steps to restore a switchrom backup... this will restore your rom to the exact moment it was when you saved it. had me back up and running in 10 minutes after a new sd was here.
Thanks so much for the help guys, I just noticed that I left my USB cord at work :/, so tomorrow I'll get back to you guys about this.
AdrianK said:
What? Pushing apps to the ext is not a good idea when the phone is in the ROM (when I tried half of them showed and half of those FCed)
You can easily mount your ext - mount -o rw /dev/block/mmcblk0p2 /system/sd
Click to expand...
Click to collapse
ya i started my response and saw you already answered so i was like mehhhh
i wrote my own script to do all this stuff below for me, and its done through the recovery.
Back up apps
Remove app_s folder
Reformat ext3 partition
Restore apps
Enter Recovery
SwitchRom Backup/Restore
Clear Dalvik-Cache
adb push while booted works fine for me, it just slows the crap outta the phone for a good 2-3 minutes, but it works fine. i use push because adb install hasnt always worked 100% for me (i have ~130 apps, and some of them don't install.)
anyways ill edit out my post to stop confusion
i have no more then 40 apps so adb install doesn't really flunk out on me
the only thing i don't like is the protected apps that show up in the fugly system default app icon and the long name.

How to remove Apps2sd or ext partition

Hey guys first off I'd like to apologize if this thread is already up somewhere but I couldn't find anything in the search
I'm selling my secondary G1 to a non tech savvy user but I'm leaving CM on there, I have an ext partition on the SD card and I was wondering if there was a way I could get rid of the Apps2SD so there wouldn't be a risk of them messing up the phone by switching the card
Thanks
You cann just reformat the whole card to FAT32
or you can delete the ext partition through parted and increase the size of the FAT32 to fill the unused space
How would I reformat the card from adb or recovery console?
AimanF said:
How would I reformat the card from adb or recovery console?
Click to expand...
Click to collapse
you can format with your pc or to format in phone settings either should work for you.
The format option in the phone settings is grayed out, and my sd card reader doesn't seem to be working, is there another way to do it through the phone?
AimanF said:
The format option in the phone settings is grayed out, and my sd card reader doesn't seem to be working, is there another way to do it through the phone?
Click to expand...
Click to collapse
recovery mode
parted dev/block/mmcblk0
print
rm 2
You can use AmonRA's recovery image and format the sdcard with that. You can install it from the terminal in the phone.
su
flash_image recovery/sdcard/recovery-dream-RA-v1.3.2G.img
Yes h/o
adb shell
parted /dev/block/mmcblk0
print
rm 1
rm 2
rm 3
Click to expand...
Click to collapse
This will remove all the data on the SDcard
Go to where it says Disk /dev/block/mmcblk0: XXXXMB
use the number in place of XXXX
mkpartfs primary fat32 0 XXXX
Click to expand...
Click to collapse
type "print" w/o quotes and see if it worked
type quit to exit parted
that should be all
EDIT: all this is while in recovery mode. Ace's method will only remove ext partition but it will not fill the empty space, wasting it
alright cool parted did the trick! Thanks alot everyone!
Tempestrs4 said:
You can use AmonRA's recovery image and format the sdcard with that. You can install it from the terminal in the phone.
su
flash_image recovery/sdcard/recovery-dream-RA-v1.3.2G.img
Click to expand...
Click to collapse
Make sure that there is a space between flash_image recovery and /sdcard
thank you. was a lot of help.
Hey guys, how do I get into the ADB shell?
you just answered your own question.
"adb shell"
After used "rm 1" I typed "print" and shows me same things. I can't format the microSD or delete the partitions, any help?.

Switchrom -s / Re-Parition SD / Switchrom -r

So if I have a few roms that I save with switchrom and then I decide to backup my sd to my computer.....
Then format my sd card in a different way (ie used to be ext2, now I want ext4)
And then I copy the files back onto my sdcard after the repartition....will I be able to restore those switchroms?
Because from what I have tried...it usually doesn't work...(I forget the exact error message) is there some command I am forgetting in between?
I have done this with BART, which is basically switchrom with a few modifications...
Here is what I did just the other day:
Reboot into recovery (Amon-RA)
Drop down into console
Run :
Code:
bart -s myRomName
After completed, type
Code:
reboot recovery
Then choose to Mount the SD card and copy everything over to your PC
Once completed, un-mount the SD card and then move onto partitioning...
I went from 128MB swap to 256MB swap
I went from 640MB ext2 to 1024MB ext2
After that, I upgraded to ext3... I have heard that ext2 is better, but every
time I use that format, my SD card gets corrupted in a matter of days.
(Hence the reason why I sent through this process recently.) I will "three
finger salute" the phone at times due to a hanging app, from the countless
ones that I download to try out, so this might be causing the problem.
After the upgrade, mount the SD card and copy your FAT32 section back.
Drop down into the console and type
Code:
bart -l
You should see the ROM that you just stored...
Type
Code:
bart -r myRomName
Once completed type
Code:
reboot recovery
Then go the Wipe section and Clear the Dalvik cache...
Finally reboot...
I have done this numerous times on both my and my wife's G1... I have also
done the above steps keeping the same sizes of the partitions and moving
from ext2 -> ext3 -> ext4 to give each of them a try...
Using BART will only back up the files on the ext partition, not the filesystem...
It is like a fresh install... At least that has been my experience with it...
Cool well I might use Bart then instead of switchrom since it seems to have worked for you without any hiccups.
Essentially I am doing the same process as above except with switchrom rather than bart (although i have used all 3 forms of backup in Amon Ra's Recovery)
Just wanted to make sure there wasnt some special command in console to fix something outta whack.
I figured my method would work but for some reason it doesn't like the repartitioning of the sdcard in between switchrom -s and switchrom -r
Thinking it might have been a fluke.....
Yep, I had to migrate my switchROM folder when I got my new SD Card and had no issues.

Sudo-App2SD (IE: How to install /DATA to SD Card EXT2 Partition)

For those of us who want more space but want to use Myn's Warm Donut, here is how you install your data into the SD card Ext2 Partition.
First you must have your SD card formatted correctly, If you wish to format it a different way then use the following partition layout:
1: Fat32
2: Swap
3: Ext2 (512mb recomended)
You have to have all 3, otherwise it may not work.
Pro's
- More space
- Can still mount the card through the phone on the computer
- easy to switch between NAND and haret.exe
Con's
- Slower Access
- Can't remove the SD card
Required
- Micro SD card, obviously, any size.
- ADB Shell or if your VERY persistant you can do formatting all through the terminal on the phone
- Basic knowledge on how to use your computer, phone, and adb, i'm not here to hold your hand
FORMATTING
*WARNING*
BACK UP ALL DATA ON SD CARD, THIS WILL DELETE EVERYTHING ON IT.
Here's how to access adb shell and such http://forum.xda-developers.com/showpost.php?p=5544939&postcount=568
If you want to do it through adb with the phone booted or with the on phone console then skip steps 1 & 2, else skip step 2B
1 - Boot into the install console and go into recovery mode
2 - Connect your phone to your computer and go into ADB Shell
2B - Type 'su' [enter]
3 - Type the following
Code:
parted /dev/block/mmcblk0 [enter]
print [enter]
4 - Find the line that says "Disk /dev/block/mmcblk0: xxxxMB". Write this down!
5 - Delete all partitions then check to make sure they were deleted.
Code:
rm 1 [enter]
rm 2 [enter]
print [enter]
6 - Once the SD card is blank, create the primary partition. (This is the amount of space you want for your music, pictures, etc.)
Code:
mkpartfs primary fat32 0 XXXX [enter]
(XXXX = How many MB of storage you would like. Remember to leave 256-512 MB for your app partition, and about 64 MB for swap. You may need to put the number you wrote down for start in place of the zero if you are having trouble.)
7 - Create a swap partition. (Large sizes are unlikely to be useful, try 64MB or so.)
Code:
mkpartfs primary linux-swap XXXX YYYY [enter]
(XXXX = This will be the same XXXX number from step 6)
(YYYY = XXXX + [256 or 512] (or whatever size you want to make this partition)
8 - Create the ext2 (application) partition.
Code:
mkpartfs primary ext2 YYYY ZZZZ [enter]
(YYYY = This will be the same YYYY number from step 7)
(ZZZZ = The end of your SD card (the initial size you wrote in step 6)
9 - Exit parted and reboot then re-enter the install console.
Code:
quit [enter]
INSTALLING DATA
Once you have your card partitioned correctly then do the following to change /data
You must have space on the fat32 partition, 300~mb
1 - If you had the third option selected "( ) Data on Ext2 Data.img" then restore your Data.img to an andboot folder on your sd card.
2 - Load phone into the kernel install console.
3 - Ensure that your current data location is selected.
4 - Select option "5. Backup /data" and hit enter and wait for it to finish with no errors.
5 - Move up and select "( ) Data on SDCard Partition" and hit enter.
6 - Select option "6. Restore /data" and hit enter and wait for it to finish with no errors.
7 - Reboot phone and check the phone storage in the settings.
8 - Go on an installing spree with the market.
Note:
Formatting instructions taken from http://wiki.cyanogenmod.com/index.php/Apps2SD
Nice work man!!!
Thanks for documenting this.
I've linked this from Post 1 in the Warm Donut thread.
How do you enter the recovery console??
thebulletfromhell said:
How do you enter the recovery console??
Click to expand...
Click to collapse
Hold down the center button or vol up when you see the prompt while booting
That just say press enter to quit recovery mode. I just use that to mount the SD card.
thebulletfromhell said:
That just say press enter to quit recovery mode. I just use that to mount the SD card.
Click to expand...
Click to collapse
yeah when that message is on the screen just connect it to the computer and go into the adb shell
i've created fat32, swap and data partition |10k,3k,3k (roughly) is it ok?
Is there a way to do this in Windows using my card reader? This seems overly complicated.
slow88lx said:
Is there a way to do this in Windows using my card reader? This seems overly complicated.
Click to expand...
Click to collapse
no, it won't allow you to create multiple partitions on removable media.
mrkite38 said:
no, it won't allow you to create multiple partitions on removable media.
Click to expand...
Click to collapse
Windows doesn't support ext formatted partitions
mrono said:
Windows doesn't support ext formatted partitions
Click to expand...
Click to collapse
Right, but the installer will format them for you. You just need partitions. You could use diskpart to create the right structure on a hard disk, but not on a removable disk.
I don't even know where to begin with these instructions. What is "recovery mode"? What is "adb shell"?
slow88lx said:
I don't even know where to begin with these instructions. What is "recovery mode"? What is "adb shell"?
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=5544939&postcount=568
mrkite38 said:
http://forum.xda-developers.com/showpost.php?p=5544939&postcount=568
Click to expand...
Click to collapse
First post updated
mrono said:
yeah when that message is on the screen just connect it to the computer and go into the adb shell
Click to expand...
Click to collapse
thanks. I just did it with the builtin term emu.
I used gparted to create the partitions, and I'm not sure if I did it right.
First I simply resized my existing Fat32 partition. Second, I created a 512MB ext2 partition. Third I created a 64MB ext2 partition.
I'm trying to install Android sys on NAND and data on SD ext2 partition. How will I know if it's using the 512MB ext2 partition instead of the 64MB one?
Also, any reason not to use ext3 or ext4?
Dukenukemx said:
I used gparted to create the partitions, and I'm not sure if I did it right.
First I simply resized my existing Fat32 partition. Second, I created a 512MB ext2 partition. Third I created a 64MB ext2 partition.
I'm trying to install Android sys on NAND and data on SD ext2 partition. How will I know if it's using the 512MB ext2 partition instead of the 64MB one?
Also, any reason not to use ext3 or ext4?
Click to expand...
Click to collapse
The installer looks at the partitions in order, from the 'left' side of the card. system can only go to the 2nd partition and data can only go to the third partition.
we don't have drivers for ext3/4 iirc
So, in gparted it was 6gig Fat32>512 ext2>64 ext2. Does that mean that the data is going onto the 64 MB ext2? Does having sys on NAND even use the 3rd ext2 for swap file?
Dukenukemx said:
So, in gparted it was 6gig Fat32>512 ext2>64 ext2. Does that mean that the data is going onto the 64 MB ext2? Does having sys on NAND even use the 3rd ext2 for swap file?
Click to expand...
Click to collapse
1. yes.
2. i'm not sure, i don't ever use swap.
mrkite38 said:
The installer looks at the partitions in order, from the 'left' side of the card. system can only go to the 2nd partition and data can only go to the third partition.
we don't have drivers for ext3/4 iirc
Click to expand...
Click to collapse
If install app is hardcoded for...
- Partition-1 is for Fat32
- Partition-2 is for EXT2 (System installation)
- Partition-3 is EXT2 (Data installation)
What partition number is for the Linux Swap?
Thanks...

Categories

Resources