Wiki

Clone wiki

Cubox-i / Debian Wheezy

Installing Debian Wheezy

Downloading the image

http://people.debian.org/~gwolf/cubox.img.xz

Flashing Debian on the sd card

http://www.solid-run.com/wiki/Flash_an_image

Flashing with a progress bar is always nice

pv -ptearb cubox.img | sudo dd of=/dev/disk2 bs=1

Boot your cubox-i with the card inserted

The default user is root

The password is cubox-i

Configuring network and ssh

Add eth0 to /etc/network/interfaces

vi /etc/network/interfaces

ADD the following lines

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
Restart networking

/etc/init.d/networking restart

Installing ssh server

apt-get update
apt-get install openssh-server

Installing vim

apt-get install locales
locale-gen en_US en_US.UTF-8 hu_HU hu_HU.UTF-8
dpkg-reconfigure locales
apt-get install vim

Expanding storage on the sd-card

(USE ONLY WITH gwolf IMAGE of Debian Wheezy)

vim Partition
Paste the following into it
!/bin/bash

log='logger.txt'
green='\e[1;32m'
red='\e[0;31m'

clear
echo -e "${green} This is a two step Process and will require a reboot."
{
(echo d; echo 2; echo n; echo p; echo 2; echo; echo; echo w) | fdisk /dev/mmcblk0
sleep 4
} &> "${log}"
sleep 10



cat <<\EOF > /etc/init.d/resize2fs_once &&
#!/bin/sh
### BEGIN INIT INFO
# Provides:          resize2fs_once
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5 
# Default-Stop: 0 1 6
# Short-Description: Resize the root filesystem to fill partition
# Description:
### END INIT INFO

. /lib/lsb/init-functions

case "$1" in
  start)
    log_daemon_msg "Starting resize2fs_once" &&
    resize2fs /dev/mmcblk0p2 &&
    rm /etc/init.d/resize2fs_once &&
    update-rc.d resize2fs_once remove &&
    log_end_msg $?
    ;;
  *)
    echo "Usage: $0 start" >&2
    exit 3
    ;;
esac
EOF

chmod +x /etc/init.d/resize2fs_once
update-rc.d resize2fs_once defaults
sleep 2
echo -e "${green} This is going to take about 8 Minutes on the restart!!"
sleep 3
echo -e "${red} Again please wait, DON'T SHUTDOWN WHILE RESIZING"
sleep 5
echo -e "${green} Ok restarting so give it some time."
sleep 2
reboot
tput sgr0
exit 0

Change permissions

chmod +x Partition
Run the script NOT OVER SSH (Warning it may erease everything if something goes wrong)
./Partition
It takes about 5-8 minutes on reboot to come back up

Check that the resize went well This is my output for my 16G microSD

df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs           15G  396M   14G   3% /
/dev/root        15G  396M   14G   3% /
devtmpfs        881M     0  881M   0% /dev
tmpfs           177M  156K  177M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           353M     0  353M   0% /run/shm
/dev/mmcblk0p1  5.4M  5.2M  167K  97% /boot
tmpfs           881M     0  881M   0% /tm

Set your local date correctly to fix connection into plex

Install NTP

apt-get install ntp

Adjust /etc/ntp.conf. Changes the

server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst
server 4.debian.pool.ntp.org iburst
to (in my case is for Canada. Checkout for other pool http://www.pool.ntp.org/zone/@)
server 1.ca.pool.ntp.org iburst
server 2.ca.pool.ntp.org iburst
server 3.ca.pool.ntp.org iburst
server 4.ca.pool.ntp.org iburst

and change "UTC" to "LOCAL" in /etc/adjtime.

Sets your localtime

Select your localtime, in my case, I selected US/Eastern

pkg-reconfigure tzdata

Copy the right Local time into /etc/localtime. In my case, is Canada/Eastern.

mv /etc/localtime /etc/localtime.old
cp /usr/share/zoneinfo/Canada/Eastern /etc/localtime

That's it you should have a pretty bare minimum debian installation

References

Updated