Flashing LUbuntu Server to a Cubietruck and Moving It to a Hard Drive
In this video I flash the LUbuntu server firmware to the Cubietruck and follow one of their guides to copy the root filesystem to a 2.5" hard drive. I find that the v1.00 of the server image requires installing SSH prior to accessing the board from a different computer.
If you want to wipe the partition table on the hard drive before running fdisk on it, run
dd if=/dev/zero of=/dev/sda bs=1M count=1
and reboot the board
Source: http://docs.cubieboard.org/tutorials/... (In the Move Rootfs to Hard Drive section the mmcblk0p2 block device becomes nandb and mmcblk0p1 becomes nanda when using a hard drive.)
Closed Caption:
In this video I will install the LUbuntu server
image
to the CubieTruck by means of flashing it
and then I'll follow their guide to copy the root
filesystem from the NAND flash area
to this laptop hard drive, and ultimately, I'll
probably use this
as a web server because right now I have a web
server running on a CubieBoard 1
and I'll go ahead and upgrade it
to the CubieTruck. If you want to skip over the flashing part and jump to straight to the copying
of the root filesystem over. Just to go to that
point in the video that I have marked up here
throught the magic of video editing
So what you'll need to do is go to
cubieboard.org
Click on the Download menu item
Scroll down to Software Tools
I'm using a Windows system
So for me I would download the PhoenixSuit
utility and install it on my machine which I have
already done
If you click on Start menu item you will see a
PhoenixSuit icon, and if you double click on that
it'll take you to this screen
and you would click on the Firmware icon and choose an image
and the images are located at... That's on the
Downloads section as well
go to the Firmware section
go down to the CubieTruck section and they have... I'll be installing the LUbuntu Server
image to the CubieTruck and using the
CubieTruck as a server. So you would go ahead
and download that. It's actually a compressed
file and you have to uncompress it or
decompress it to your computer, and once you
have done that. Going back to the PhoenixSuit
utility I would click on the Image icon
Choose a lubuntu-server-nand. Click Open.
and at this point
If you have of a DC cable plugged into the DC jack of the CubieBoard, remove that
Taking a closer look... To flash it which I've gone
over before
You would locate the FEL button which is
located right over here
and these buttons are really small
but you would press and hold that and while you
press and hold it
you would take the
the mini-USB
cable that it comes with...
You would take the mini-usb cable that it comes with. I'm using a longer one.
Make sure you have the other USB end
plugged into your PC and I would plug it into the
mini-USB jack right here
so press and hold
the FEL button
and
plug the mini-USB cable end into the mini-USB
jack
It will now prompt you
if you want to do a mandatory format. I'll choose No.
and in about six and a half minutes
it should
have flashed the image to the CubieTruck.
now that's flashed, I can click on the OK button
I'll power off the board before I plug in the hard drive just to be on the safe side.
I'll do that by pressing
and holding the power button until the LED lights go off on it, and also you can
tell by looking at the red light as well. I'll unplug
the mini-USB cable
Taking a closer look at the CubieTruck it has
some markings on the board that say with 2.5
inch hard drive
It's expecting a DC current of something greater
than 3 amps
without it DC current greater than 2 amps
I'm going to try to run it with just a 2 amp power
supply and see if it works. It may not...
I'll take the hard drive
the SATA cable that it comes with
It comes with two wires. For the 2.5 inch hard
drive
what I'll do is I'll take the black and red wire and
plug it into the jack that says SATA 5 volts
I'll also plug in the SATA data cable into this
port, and it will slide horizontally into it
now I can take the other end and plug into my
hard drive
I will probably just
plug this later into that port so that it isn't
flopping around everywhere
What I'll try doing this time is trying to use an
iPhone charger and see if that works. It should. I'm hoping.
I'll take the USB
to DC cable. I'll take one end and plug into the
iPhone charger. Take the other end and plug it
into the CubieBoard.
I'll also need to plug a network cable
so I can access it from my PC
and now I'll take this and plug it into the wall
Well that did not work ladies and gentleman.
That's okay though.
I'm going to try this one.
This one they usually sell with the CubieBoard 1
and 2--not with them, but you can buy them
additionally.
Okay. Let's see if this works.
There we go. Now we got lights.
The hard drive is spinning up.
I'll close out of the PhoenixSuit utility.
Close the window and exit anyway.
If you click on the Docs menu item on
cubieboard.org
Click on Tutorials. On the Tutorials section
there is a CubieBoard 3
or CubieTruck. Click on that.
and the guide that I will be following
is moving the root filesystem from NAND flash
to a hard drive
I'll click on that link
So I need to SSH into CubieBoard. I found that I couldn't SSH into the CubieTruck with this current image
so I used the HDMI output to hook it up to my monitor using an adapter
and I'll see if I can install
SSH
So I can actually get to this from my Windows
machine
and I'll press enter to continue
I figure if you have a server image you would put
SSH on it. Maybe that's for version
1.1 of this image
not complaining
Now, while I'm here I may as well get the IP address so I can connect to it from my Windows machine. I'll type in
ifconfig
On eth0 there is a line that says inet addr. For
me it gives me an address of 192.168.1.130.
So that's the address I that would use to connect to it from my Windows computer.
To SSH from a Windows machine to a
CubieBoard
you need to download a SSH client. One of
them is called PuTTY which you can download
at this location.
From here you would click on the Download link
and save the PuTTY executable
the PuTTY.exe executable out somewhere
and you would double click on...
You would click on it to open it.
It would give you a screen like this. In the Host
Name field you would type in the IP address
of your CubieBoard which I obtained
I'll click on Open. It gives you a security
warning.
Click Yes.
I'll login as linaro
with a password of linaro
and we are in
Now it's time to follow these simple, easy
instructions to
get the root filesystem moved over
Instead of following these instructions. This is
me coming back after the fact and realizing that
I'm having problems
booting up with the hard drive. What I will do is I'll go back one in my web browser
and go to the section that says
Install LUbuntu desktop/server to SD card
so we're on this page and I won't be installing it
to a SD card but
there is a hard drive section in here as well. So
I'm going to try following these instructions
and see if they work and find the part that says move root filesystem to hard drive
I'll copy the "sudo su - root" command without
the $ or the #
symbols in any of these commands. I'll copy it
and to paste it into the terminal window
I'll run the next command which will make a...
which will make two directories... two temporary
directories...
I'll have to modify the next command. Do a
"mount /dev/nandb"
That's the root filesystem on the NAND flash area of the CubieTruck. We'll mount that to /tmp/1
Copy the next command.
Paste it into the terminal window. This will
make an
ext4 file system on the hard drive. Doing this
will erase
a good portion of the hard drive. So be really sure that you want to do this. Once you are okay with it, press enter.
Apparently on my hard drive I need to
create a partition and you can do that with fdisk.
I'll type fdisk
/dev/sda
Type m and enter for help. We will add a new
partition.
which is the letter n
create a primary partition
by typing p and press enter
Do the default of 1
Press enter for the default sector 2048
and this will create a partition the entire size of
the hard drive and I'll press enter
Type w and press enter to write these changes
I'll press the up arrow two times--well three
times until I get to the
make file system command. I'll try running that
again
I'll run the mount command which will mount the
partition that I just created--well the file system that I just created on that partition to /tmp/target
Now we'll run this move file system command
I'll copy this entire thing
and paste it and press enter
I have actually never tried
copying a file system this way
Type "mkdir /tmp/boot"
We'll mount the
boot partition partition on the NAND flash drive
by typing: mount /dev/nanda
/tmp/boot
If we change the directory
to /tmp/boot
and get a listing in there. The file that we are interested in editing is uEnv.txt. Type: pico uEnv.txt
Go to the last line where it says nand_root and we'll move it to...
from /dev/nandb to /dev/sda1 which is the
file system that we just created on the hard drive
Press Ctrl + O, enter to save. Press Ctrl + X to exit.
type: sync
We should be able to reboot now and see if this works.
One of the problems is that each time the board reboots, it may get a different IP address.
If you need to reacquire it, you'll either need to plug in the CubieBoard into your monitor so you can...
I'm trying to see if this thing is booting. I think it just turned off.
... this is not working, is it?
... well. No, no. Is it booting up?
Ah, okay good. It looks like we're successful.
... I don't know... Okay. Good...
Either plug it into your monitor and keyboard and reacquire the ip address
by typing ifconfig, or you can go to your router settings and each person's router is different unfortunately so there's no way
way I can tell you how to do it for your router but for the one I'm using right here with dd-wrt installed, I just go into
Status
and I'll pick LAN
and I'll locate the client that's labeled CubieTruck which is very easy to identify. It's moved over to
192.168.1.113
I'll login as linaro
Type "df". It shows the root filesystem
It's about 160 GB and 1% is used which is the same size as
my 2.5 inch laptop hard drive
From this point you can install and configure the software how you want.
That's it for this video and of course, thanks for watching.
Video Length: 19:03
Uploaded By: ProgramOften
View Count: 44,017