Page 1 of 1

RPi 2 out of memory when installing xubuntu desktop

Posted: Tue Apr 07, 2015 11:59 am
by AlekM
Hello!

I am using this image: https://wiki.ubuntu.com/ARM/RaspberryPi with my raspberry pi 2 connected to Ethernet.

My Raspberry Pi was almost done installing the xubuntu desktop when the pi started to say it ran out of memory. I attached the imaged sd card to my computer and found only 25% of it's memory was used. I'm assuming that the xubuntu desktop was being installed to the pi's memory rather that the sd card.

Is there a way to delete the pi's memory and tell it to download to the sd card? Or somehow add xubuntu desktop to the sd card itself then boot the pi?

Re: RPi 2 out of memory when installing xubuntu desktop

Posted: Tue Apr 07, 2015 12:16 pm
by kusti8
You probably don't expand the file system. What does df -h say? It's pretty easy to do with fdisk and resize2fs

Re: RPi 2 out of memory when installing xubuntu desktop

Posted: Tue Apr 07, 2015 12:26 pm
by klricks
AlekM wrote:Hello!

I am using this image: https://wiki.ubuntu.com/ARM/RaspberryPi with my raspberry pi 2 connected to Ethernet.

My Raspberry Pi was almost done installing the xubuntu desktop when the pi started to say it ran out of memory. I attached the imaged sd card to my computer and found only 25% of it's memory was used. I'm assuming that the xubuntu desktop was being installed to the pi's memory rather that the sd card.

Is there a way to delete the pi's memory and tell it to download to the sd card? Or somehow add xubuntu desktop to the sd card itself then boot the pi?
Is this first boot? I would say that the image is corrupted or you have a fake SD card. The only memory on the RPi is RAM which is cleared when power is off or rebooted.

Re: RPi 2 out of memory when installing xubuntu desktop

Posted: Tue Apr 07, 2015 6:34 pm
by AlekM
Well the SD card certainly works, and this is not the first boot. I used raspbian for a while then started using NOOBS. The ubuntu image was properly flashed to the SD card and there aren't any extra partitions on the card.


Also, I tried df -h and got:


Filesystem______Size__Used_Avail__Use% _Mounted On
/dev/mmcblk0p2 _1.7G _1.6G____0__100%__/
devtmpfs______458M 4.0K _458M___1% __/dev
none__________4.0k_____0__4.0k___0%__/sys/fs/cgroup
none __________93M_300K __93M __1% __/run
none _________5.0M ____0__ 5.0M __0% __/run/lock
none_________462M_____0 _462M__0%__/run/shm
none_________100M_____0___4.0k__0% _/run/user
overflow_______1.0M_____0___1.0M_ 0% _/tmp
/dev/mmcblk0p1_64M___17M___48M__27%_ /boot/firmware

(Sorry about the underscores they weren't actually there)

Re: RPi 2 out of memory when installing xubuntu desktop

Posted: Tue Apr 07, 2015 6:36 pm
by DougieLawson
That's a 2GB card or a filesystem that's not been expanded to fill the available space.

Time to run fdisk and resize2fs to expand it to the full size of that card.

Re: RPi 2 out of memory when installing xubuntu desktop

Posted: Tue Apr 07, 2015 7:16 pm
by AlekM
I was looking on the RPi Ubuntu page and it gave the following instructions:

Usage

There are no Raspbian-specific utilities included, specifically no automatic root resizer. However, it's not hard to do manually. Once booted:

$ sudo fdisk /dev/mmcblk0
Delete the second partition (d, 2), then re-create it using the defaults (n, p, 2, enter, enter), then write and exit (w). Reboot the system, then:

$ sudo resize2fs /dev/mmcblk0p2
There is no swap partition/file included. If you want swap, it's recommended you do:

$ sudo apt-get install dphys-swapfile
You should have a (resized) SD card at least 4GB, because by default it will want to create a ~2GB swapfile.

Is there a way to resize the card to a decided memory amount (ex 16G because that's the size of my card). Also, does the pi create different folders/partitions for the OS and files/apps added to the system. If so, should I be applying different sections of the SD memory to the OS and files (ex 6G for OS 10G for files)

Re: RPi 2 out of memory when installing xubuntu desktop

Posted: Tue Apr 07, 2015 7:26 pm
by kusti8
The instructions reduce the Linux partition to the largest possible ie 16 GB in your case.

The os takes care of all that. By default there are two partitions, boot to boot up the pi formatted as FAT32 and a root containing everything for the Os formatted as ext. You do not need to specify the size, the instructions just resize the root partition to the largest possible.