Now that we are able to boot the kernel and have prepared the harddisk for use in the NAS, it’s time to start the second stage of installing Debian on your NAS!
If you don’t have the commandline ready on your NAS, see my previous post on how to load and boot your kernel on your NAS, when done, you can continue with this post.
This is the first part of this tutorial, which will actually install Debian on your NAS and prepare it for use.
We need to set the PATH variable:
Now we can actually install the prepared armel packages on the NAS with:
Wait for it to finish, depeding on the CPU speed this can take up to 10 minutes.
When it’s finished we need to edit some files which are needed to boot the NAS with Debian.
First, edit the /etc/fstab file:
Put the following lines in that file and save the file after that:
/dev/sda1 / ext4 defaults 0 1
/dev/sda2 none swap sw 0 0
/dev/sda3 /home ext4 defaults,usrquota 1 1
proc /proc proc nodev,noexec,nosuid 0 0
Now edit the network interface file:
And put the following lines in it and save after that (adapt the IP to your own IP):
iface lo inet loopback
iface eth0 inet static
Then edit the inittab file:
Scroll down to the part when you see 7 VGA terminals, comment them all out (put a
# at the beginning of that line.
Set a root password:
passwd root PASS
Close the serial or netconsole connection to your NAS and power the NAS down. You’ve completed the first stage of this turorial, continue to the second part!
BOOTING FROM YOUR NAS:
Now that Debian is fully installed and usable on your NAS, it’s time to actually boot it. In my earlier post i’ve given the steps to load the kernel into your NAS.
There is now one thing that needs to be changed, the bootargs, we now want the init process to call inittab and let it boot into runlevel.
Power on your NAS, open up your connection to your NAS and give all the variables stated in my earlier post, but give this bootargs line:
setenv bootargs console=ttyS0,115200 root=/dev/sda1 rw init=/sbin/init
And let your NAS boot, you’ll see a Linux system starting up like this happens on your desktop! You’ll be left with a prompt if all went ready!
Now we can install some packages and verify if installation went correct:
First check if the networking options are still correctly set:
If the output shows the IP you’ve set you’re good.
Now we can enter the Debian 6 repo’s in the APT sources.list:
Enter the following 2 lines:
deb http://ftp.nl.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.nl.debian.org/debian/ squeeze main contrib non-free
Save your settings and exit the editor.
Now that you’ve set up the repositories you can update APT to build the package database:
See the following entries which could be handy on your NAS:
apt-get install openssh-server
apt-get install cups
Filesharing via Samba (note that you first need to install
cups before Samba can be installed!):
apt-get install samba
Networkdrive mounting support (must be built in your kernel!):
apt-get install smbfs
Building and compiling (for compiling source programs)
apt-get install build-essential libncurses5-dev
Midnight Commander (like the old Norton Commander):
apt-get install mc
Archive types (.zip etc):
apt-get install rar unrar unzip zip arj p7zip
Sudo (giving normal users root permissions):
apt-get install sudo
That’s it! You definitely want SSH access to the box, so you should set that up first, so you can access the NAS from your own desktop. From there you can install all the stuff needed and create users on the device etc!