maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Upgrading (https://talk.maemo.org/forumdisplay.php?f=8)
-   -   How to upgrade the internal memory by extending the root filesystem to a memory card (https://talk.maemo.org/showthread.php?t=1165)

mk500 2006-02-09 11:40

Quote:

Originally Posted by Jus
the command free will show memory usage.

Thanks, that's just what I needed. I've learned I need more VM.

rjungmann 2006-02-09 22:08

I must say : thank you
 
thank you Wolfram Ravenwolf !

thank you for doing the tutorial to explain how to extend the
memory to a swap on the mmc...

it seems to work on my 770.

thank you for your .deb wich automate the copy, of
the internal files....

i just want to indicate this :
this process take some second, or minutes.
just wait... (i just thinked that i bricked my 770)
but no !

it works...


the only problem i have is that because i'm not skilled with
linux commands, especially with partitioning, i just want to mention
some things :
- to do the partition, you need to use cfdisk given with wolfram .deb :
/var/lib/install/sbin/cfdisk /dev/mmcblk0 (don't forget the space before the /dev...)
- then, you must delete the existing partition !
(simply press D)
- create after that the first partition that will be used for data storage (in the same way as your original mmc worked) it must be a FAT16 partition. to do that press N.
- don't forget to indicate the type of partition (press T); it's number 06.
- i mentionned it bootable (should i ?) by pressing B
- then i created the second partition, used for the swap.
(press N)
- it create a linux partition. (number 83 i think). i leave it like that

booth partition are Primary (i created it like that)

now, the important thing (that i forgot to do, i understand this when readin help, always read help ! :) ) :
don't forget to write the partition table to the mmc :
use Write (press W, not w, but W ! then answer "yes")

now, you can quit and format the new created volumes !
the first one with :
mkfs.vfat /dev/mmcblk0p1

after you need to reboot then :
shutdown -r now

and then, go back to xterm, gain root (sudo gainroot)
and :
/var/lib/install/sbin/mkfs.ext3 /dev/mmcblk0p2

that's it !

you now created two partition on your mmc !


for information, mine is 512MB big (i'm waiting for 1GB),
i created the first part (FAT16) to 384MB (this is now the main data
memory, accessed by your main computer when connecting through USB), and the second one with the rest (approx. 129MB) for swapping. i hope it will be good !

this thing will be very usable when you want a lot of apps installed, or running. you will have a large space for saving your mails, and bookmarks... but, i want to mention this, Wolfram your script does the reverse thing, take all this back to the internal memory.
but now, because of this new swp size (bigger than the internal memory) a lot of people won't be able to get all the data back inside the 770. every one need to know this. then. if you want to copy all this to a new MMC (bigger... :) ) you need a computer running linux, and wo can access booth partitions to copy all this !

i'm happy !

surfing is now cool, and fast...

:)

renaud. :)

Jus 2006-02-11 02:48

Running the script after re-flashing works a treat.
 
Got a bit carried away trying to install kismet and ended up with the 770 constantly rebooting. Re-flashed, run the script, re-booted and had things back to exactly as they were before i broke it. :D ... thanks Wolfram, u've saved me a whole load of hassle.

Jus
Now where did i put those packages...

TVD 2006-02-16 23:34

OK, my first attempt to use a swap file on the standard 64 Mb MMC failed :( and resulted in a reboot loop... So I had to flash my 770 :'(

Can somebody confirm the settings Rjungmann used in cfdisk? I didn't read them when I tried to make the partitions but I did almost the same except from the bootable partition part. Then I ran the extrootfs script but errors showed up, something like "not enough space"... I made both partitions 32 Mb big. Is this to small?

Any idea what I have to do to prevent the reboot loop?

Thanx!

Seii 2006-02-17 02:27

Thanks for the excellent guide guys. I created the 128mb ext3 partition and also the swap file from the maemo wiki article. However, how do I check whether I've done it correctly or not? Also, is there a way to check what's in the 2nd partition?

I noticed that when I browse to anandtech.com and have the audio player running, the memory plugin shows that I'm using full capacity of the ram(all the way to red).


Thanks.

cantona 2006-02-18 19:22

I have a basic (read dumb) question - I followed Wolfram's wonderful instructions and think all is good but I dont understand how to access the "big" partion on my 1gb card - if i look on the 770 its there but when i connect via usb i only see the 64mb swap - i thought i should see the bigger partion - even if i pull the card and try and connect using a card reader only the 64mb is there - am imissing something?

Thanks

log2ins 2006-02-19 11:10

Quote:

Originally Posted by bahtaraigi
Hi,

I get an error message in cfdisk when running:

/var/lib/install/sbin/cfdisk /dev/mmcblk0

FATAL ERROR: Bad primary partition 0: Partition ends in the final partial cylinder

I have root access, and mmc card is unmounted.

Any ideas?

Well, I have the same error with a Kingston 1GB mmc. No problems with the original Nokia 64MB mmc.

Anyone knows how to solve the problem?

Thanks,
Antonio

subsecond 2006-02-21 09:43

Hallo,

I have a question about the usage of the extended 1GB N 770?

Can I run a full blown Browser with javavm - run applets started by websites on it?

Thanks subsecond

djs_tx 2006-02-22 04:18

I did the extrootfs script with no problems but swapon is failing.

If I try the commands exactly as written:
1. Create an empty file to hold the swap:
* dd if=/dev/zero of=/Root/swapfile bs=1024 count=24576
2. Turn the empty file into a swap file:
*mkswap /Root/swapfile
3. Now it can be activated like that (as root):
*swapon /Root/swapfile
4. To deactivate it, use this command (as root):
*swapoff /Root/swapfile

It first chokes on step 1 unless I am root because it won't let me create a new file in /Root as user.

I then sudo gainroot and it chokes on step 3 with a mysterious "swapon: /Root/swapfile: Invalid argument"

Any ideas?

Oh and how come the second partition is obviously working but it does not show up in the list when you issue the "mount" command with no args?

disq 2006-02-22 19:15

why not use jffs2? iirc it detects the often-written parts of the flash and balances its lifetime.

rwa 2006-02-23 15:26

Quote:

Originally Posted by log2ins
Quote:

Hi,

I get an error message in cfdisk when running:

/var/lib/install/sbin/cfdisk /dev/mmcblk0

FATAL ERROR: Bad primary partition 0: Partition ends in the final partial cylinder

I have root access, and mmc card is unmounted.

Any ideas?
Well, I have the same error with a Kingston 1GB mmc. No problems with the original Nokia 64MB mmc.

Anyone knows how to solve the problem?

Thanks,
Antonio

I ran into this same issue, and I think it must be related to the way Kingston formats/partitions the card a I was using a Kingson 1 GB also.

I got the exact same error, and by the text it seemed it must be an incompatibility between partitioning programs. I played around some by repartitioning and formatting in OS X via a card reader (in OS X Disk utility choose Partition, then the Options... button, select PC partitioning scheme then choose to format as PC-DOS).

This didn't work initially, but it did change the error to one saying that the first partition was longer than the physical size of the disk when cfdisk was run. This too seemed like maybe the OS X formatter and Kingston's were making a partition slightly larger than cfdisk thought could go on the media.

So I then went back to OS X and partitioned the card into two partitions. I made the second format as "Free Space" and made it as small as OS X allowed (you could type a smaller number but it then flagged the partition with an asterisk, I stopped at the smallest size w/o an asterisk which was about 70 MB). I formatted the first partition as PC-DOS and left the second as free space, I was hoping the first partition would look valid to cfdisk since it was smaller.

This worked. cfdisk started up fine and I was able to follow the steps as listed from then on. Also, when I deleted the large PC-DOS partition in cfdisk it combined that and the free space at the end, so I didn't waste any space on the card.

If you don't have OS X I'd guess there's some way to do this same thing in Windows, but I can't say how.

Good luck,
Ware

log2ins 2006-02-23 16:13

OK, thank you very much.

I'll do the same and let you know if it works.

Regards,
Antonio

uNtouched 2006-02-23 16:23

I tried this with my 64 mb card, but I had no luck. I ended up having less memory then I started with. Any ideas?

What I did.

umount /media/mmc1
/var/lib/install/sbin/cfdisk /dev/mmcblk0
parted the mmc into 2 parts, 1 was 40 MB the second was 24.

jayholler 2006-02-25 06:13

extending the root filesystem with the included 64MB card
 
i modified the extrootfs script because i was unable to partition the card. i didn't realize that you couldn't do the partitioning from the 770 device until i read this thread. maybe you can and i am missing something, i'm somewhat of a n00b and only have mac osx at my disposal. but....i was able to modify the script, and do it all on the device itself after installing the port of vim. the device is definitely snappier so thanks to eveyone who shared their info to help me out. i was a little scared to make mods to the script, but it all worked fine and the only downside is that i have no external storage...that is untl i spring for the 1GB mmc! if anyone wants the modified extrootfs script i would be happy to share it. i'm just so happy this hack worked and my mods didn't brick the device!

-posted from a 770.

argh 2006-02-26 09:26

The info is a great help, but just to ask the obvious question, could the mmc card be formatted from the 770 with the right software installed?

It would sure make life easier than downloading a live-CD over GPRS for those of us less-fortunate ones out here!

jayholler 2006-02-28 16:57

ok, wolfram. if i understand the above, i can take a brand new rs-mmc and do the partitioning and root extension all from the 770? that is terrific!

jayholler 2006-03-02 01:14

thank you!
 
ok, i got the 1gb card, and after following the advice of various others i have set up everything working perfectly. thank you all for helping me get the most out of my 770. browsing is much improved now!

Simon 2006-03-02 19:40

I'm at work and bored so I thought why not finally try this on my 770 and 1GB card. I followed the instructions and managed to get it working (I think). I followed Renauds instructions on how to do the partitioning part. Had a wee bit of trouble with the partitioning tool but that was because I wasn't full screen I think and so it messed up the display. I am just copying everything back onto the 800MB or so partition I can see on the 770 now. How much free memory should I see on the device now. I forgot to look before I started what it was using! Thanks Renaud and Stefan for your instructions :)

Kralisec 2006-03-03 22:10

Ext2 pb :D
 
Hi,

After reading this thread I see nobody with the same problem I encountred.

The 2 latest lines from http://maemo.org/maemowiki/ExtendedRootFilesystem
propose to prefer ext2 as ext3 to default format.

Ext3 with /var/lib/install/sbin/extrootfs work fine,
but ext2 format cause problem with mount/umount system (doesn't work)
cause parameter ext3 line 26 from the extrootfs script

I replace ext3 with ext2 and as far as I can see all looks ok :D


Really thank you for great script Wolfram Ravenwolf !!!


Good day,
Laurent.

Kralisec 2006-03-03 22:14

Quote:

Originally Posted by cantona
2.) When I execute /dev/sda does this just partion the 770 drive (i havent run parted yet so maybe this is self-explanitory - i just dont want to format my c drive ;)

Since some Sata hardrive appear with /dev/sda device,
the best if you use some LiveCD is to unplug your harddrive :D

just in case of ...


Good day,
Laurent.

psychedelicbeats 2006-03-04 20:33

i have a question here. all we are doing is extending the root filesystem, correct? if so,

will the device properties and xterminal (in theory) recognize a larger internal memory?

i am pulling up screens below, and i do not see any sign of extension. i have done everything per instructions, and it does go fine, but i dont see/feel any difference thus far. i am using nokia supplied 64mb rsmmc for testing.

also, screenshot #4 is an oddball. it shows a random amount of memory. i've seen anything from ~20 to ~70 total memory

http://img136.imageshack.us/img136/7...nshot004fn.png
http://img133.imageshack.us/img133/4...nshot030in.png
http://img136.imageshack.us/img136/8688/003re.png
http://img133.imageshack.us/img133/8...nshot042ec.png

Kralisec 2006-03-07 10:45

Hi psychedelicbeats,

What result with mount command ?
(juste enter "mount" in xterminal)

uNtouched 2006-03-07 23:56

I'm about to slam this thing into the ground. I've reflashed it about 7 times already trying to extend the root fs. Here's what I'm doing.

sudo gainroot
umount /media/mmc1
/var/lib/install/sbin/cfdisk /dev/mmcblk0
I make one partition 771MB, Primary, beginning, change the type to 06, and leave it alone.
I make another partition 256.61MB, primary, and make that type 83
Quit
mkfs.vfat /dev/mmcblk0p1
shutdown -r now

sudo gainroot
/var/lib/install/sbin/mkfs.ext3 /dev/mmcblk0p2
/var/lib/install/sbin/extrootfs

I endup with a bricked device everytime. I'm using a Transcend 1GB MobileMMC card. When I reflash, I check the card without reformatting it or anything, and I end up with the following.

Memory in use: 251393526 kB
Memory Available: 1000208 kB
Email, audio, video, etc are all 0 kB up until I get to...
Other files: 251393526 kB

-Edit-

umount: lazy umount of (null) failed!
umount: /dev/mmcblk0p2: Invalid argument

musicoman 2006-03-08 16:43

Like psychedelic , I don't know if it works. I got the same issue in the memory panel and with the command free so I put my "mount" here.


/ $ mount
/dev/mtdblock4 on /mnt/initfs type jffs2 (rw,noatime)
none on /mnt/initfs/proc type proc (rw,nodiratime)
none on /mnt/initfs/sys type sysfs (rw)
none on /mnt/initfs/tmp type tmpfs (rw)
/dev/mtdblock4 on / type jffs2 (rw,noatime,rpsize=1024,rpuid=0,rpuid=30000)
none on /tmp type tmpfs (rw)
/proc on /proc type proc (rw,nodiratime)
sysfs on /sys type sysfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
none on /dev type tmpfs (rw)
/dev/mmcblk0p2 on /Root type ext3 (rw,noatime)
devpts on /dev/pts type devpts (rw)
/dev/mmcblk0p1 on /media/mmc1 type vfat (utf8,uid=29999)
/ $


any idea ?

djs_tx 2006-03-08 19:11

uNtouched:
I might be wrong but I think your issue is that you are not putting a file system on the second partition. After mkfs.vfat for the first partition, do a mkfs.ext3 for the second partition.

musicoman:
/dev/mmcblk0p2 on /Root type ext3 (rw,noatime) means the second partition on your mmc card is mounted on /Root. I would take that to mean it is working
David

uNtouched 2006-03-08 21:13

Ok let me ask you this, what does your fstab look like? I kinda deleted the line that mounted the mmcblk0p2 thinking there was something wrong with it, and expecting it to get re-written.

Although, there is no mmcblk0p1 or p2 when doing the mount command, the only thing I see is mmcblk0 mounted to /media/mmc1

djs_tx 2006-03-08 23:01

/dev/mmcblk0p2 /Root ext3 defaults,errors=remount-ro,noatime 0 0

Exactly. You did not format the second partition with an Ext3 filesystem so the mount fails. Once you correctly format the second partition you might try the script again and see if it adds the correct line in fstab. If not manually edit it as above.

David

uNtouched 2006-03-08 23:26

Dj, I did do the ext3 format part. I just manually deleted it from fstab. I just reflashed and I'm about to redo it.

-edit-

One of 3 things could be the problem....

1. The 770 isn't formatting that card right
reason: the original 64MB card worked with the same steps I've been trying.

2. The card simply can not hold certain partitions/formats.

3. The card is bad.

EDIT!

It works, I used partition manager for windows. Works fine, wouldn't work though while trying to do it from within the 770.

Simon 2006-03-13 20:27

I finally got around to doing first the extended file system hack then the swap on the new partition one and wanted to share my observations.

The device is certainly a lot more stable. No more "Out of memory" warnings which I used to get with as little as 2 browser windows open. Now I can run all sorts of things and haven't seen any memory errors. The device also seems faster but it is hard to really quantify that. General loading of stuff is still slow as a dog. 15 seconds for the video player to open a 1 hour episode of Top Gear for example. Or 10 seconds to jump from the first page to the last of a 33 page PDF file. But I guess these sort of things you wouldn't expect to be faster. The email app definitely seems faster as does the file manager. I installed the CPU/Memory Load Applet with the mod to allow me to turn on and off the swap (available on the Maemo downloads page). That works great once I found out I had to edit my /etc/sudoers file to allow the swapon, swapoff command to work without a password.

The biggest change I have found is whereas before I would have to remember to close things before opening others (like I would have to stop the browser to open the inbox) now I can run multiple things and change between them quickly.

Thanks to you guys who figure out how to do all this stuff and make it possible for us Linux newbies to get them running without too much drama.

Simon

Simon 2006-03-13 21:33

Ah, and another thing that seems A LOT better is the performance of Flash in the browser.

jayholler 2006-03-14 02:58

i messed up: chmod'ed /etc/sudoers
 
i chmod'ed /etc/sudoers so now sudo gainroot doesn't. tells me that the mode is 0740 should be 0440. if i flash the r&d image can i get back in to change it?

aflegg 2006-03-14 08:59

You can reflash any image - it'll overwrite /etc/sudoers back to the default.

jayholler 2006-03-14 13:49

yeah, just enabling r&d mode didn't work. i should be able to just reflash the image and the extrootfs will remain intact right? do i understand that correctly? you guys are the best!

aflegg 2006-03-14 13:51

Correct: the MMC card isn't touched by the flasher.

djs_tx 2006-03-14 15:39

I think you will need to re-install the extrootfs package and run the script so it can set up the links again.

aflegg 2006-03-14 15:48

Good point.

jayholler 2006-03-15 04:03

messed up /etc/sudoers fixed!!
 
well, you were both right. i reflashed the OS, enabled r&d mode to modify gainroot, and then disabled r&d mode. after running the extrootfs script again my system has been restored EXACTLY as it was previously, with the exception of the chmod'ed /etc/sudoers file. i can now safely get in and add the entry in sudoers for the swapfile menu item in the new load_plugin_aw that is now available on maemo.org. it is REALLYnice to be able to get things right back the way they were with so little effort. thanks for your help! goodtimes indeed for this linux novice. my new issue is i accidentally popped out the usb cable from my ibook before all this nonsense with /etc/sudoers, but under Control Panel>Memory it says my usb cable is attached. i tried mount and umount, but to no avail. regardless i have access to both partitions, which is where i saved my vim-tiny, extrootfs, and all other installation files. i'll have to figure that one out later.

dandrewk 2006-03-18 19:23

Greetings, and let me add to the chorus of thank you's to Wolfram and others who are making the 770 even more functional. This reminds me of the early days of the Palm Pilot, except the 770 is just a bit more powerful. :)

I did the partition (1GB Sandisk), using 64mb as ext2 and the rest for ext3. I moved the swapfile and altered the start/stop scripts to have swap-on always on.

This worked great, but this morning I tried to save a note to the documents file, and I kept getting "file is read only". I was able to save to the mmc. I then checked the home directory via a USB cable, and changed all the permissions to give total access. I rebooted and was then able to save to the documents folder.

However, for some reason this blitzed by news reader, erased the connection settings, web home page, bookmarks and URL history. I will have to go to backup to restore those, but it is disturbing this happened. Was it because I used the USB to access the 770 file system? I do have a card reader, but the USB cable is the easiest.

Any clue as to what has happened? The 770 is SO much better the the efs!

One other question - I am debating whether to keep the swap file on ext3. As mentioned, I have altered the start/stop scripts. I am a Linux rookie, how do I return those scripts back to the original state to stop using the swap transfer?

Wooky 2006-03-23 20:30

I have seen some questions arouse here that seem to still go unaswered.

First, I believe the best mode to transfer large files to the N770 is using NFS, since there is no need to install anything. At maemo wiki there is a howto explaining how to setup an NFS server in Windows machines as well, since the N770 can't do SMB. NFS is quite transparent and much easier to do than scp or taking off the RSMMC card. IMHO, of course.

Next, the "2x your RAM" thumb rule was valid for a specific platform at an specif time. Suppose you have 4GB of RAM in your desktop. Are you really setting up an 8GB swap file?

And last, command 'free' display real RAM (and swap if set up), whereas the GUI memory manager display (flash)ROM where the apps and OS is located, and henceforth also displays space available in the sym-linked RSMMC partition.

bro 2006-04-10 22:35

Quote:

Originally Posted by bahtaraigi
Hi,

I get an error message in cfdisk when running:

/var/lib/install/sbin/cfdisk /dev/mmcblk0

FATAL ERROR: Bad primary partition 0: Partition ends in the final partial cylinder

I have root access, and mmc card is unmounted.

Any ideas?


I encountered the same problem with a new 1GB Kingston mmc-rs card. Just add the -z switch to the cfdisk command to counter this, thus:

./cfdisk /dev/mmcblk0 -z

You'll get a blank partition table to start with and after creating the partitions, can write it to your card. Then proceed as described in the wiki.

Further: I also decided in favour of ext2 instead of ext3, since I see no value in having journaling enabled, while it does create extra write actions to the card (for updating the journal). Anyone more knowledgeable able to comment on it?

Not that I am that worried about the memory card, it only cost E 36,85 (Netherlands) and comes with lifetime warranty.

To conclude: a big thank you to Wolfram and all the others for enabling this hack, it makes the 770 a lot more usable! 64M is just too little, the 24M swap makes all the difference.


All times are GMT. The time now is 17:39.

vBulletin® Version 3.8.8