googlecreativelab / coder

A simple way to make web stuff on Raspberry Pi
http://goo.gl/coder
Apache License 2.0
2.42k stars 276 forks source link

How to make coder use full SD space? #54

Open x1a0 opened 10 years ago

x1a0 commented 10 years ago

I have it on a 16GB SD card. Running df -h shows:

Filesystem      Size  Used Avail Use% Mounted on
rootfs          2.2G  2.1G     0 100% /
/dev/root       2.2G  2.1G     0 100% /
devtmpfs        212M     0  212M   0% /dev
tmpfs            44M  252K   44M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            88M     0   88M   0% /run/shm
/dev/mmcblk0p1   56M   19M   38M  33% /boot

UPDATE: I need to reboot to make it change. Never mind :)

jmstriegel commented 10 years ago

You can extend the root partition to fill the sd card using the same tool that comes with Raspbian. Just ssh in as the pi user, using your coder password for the password. Then run the following:

  sudo raspi-config

Then select "expand_rootfs". You'll need to reboot when you're done.

  sudo shutdown -r now

When it restarts, your root partition should now completely fill the SD Card.

darryllee commented 10 years ago

Is there anyway to script this so that it happens on first boot? Is that contrary to raspbian best practices?

jmstriegel commented 10 years ago

@darryllee I'm a little worried about doing this on first boot. It's a quick way to corrupt the disk if you happen to unplug it while it's changing the partition tables. For now, the deliberate command line option works, but I'll try to come up with a better way of handling this.

darryllee commented 10 years ago

Ah, yeah, until I got a new power supply I was getting tons of disk corruption problems. So best to avoid anything that would invite more problems like that.

I believe the Kano guys wrapped the expand command into their updater script, but maybe they also run it on first boot? I'll have to dig into the scripts.