Difference between revisions of "Debian install"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
 
(Get a Debian image)
(48 intermediate revisions by 27 users not shown)
Line 1: Line 1:
This is a small Guide to replace the original Linux (and its WebInterface) with a Debian 3.0 Woody Installation
+
{{warning|'''Backup ANY Data, because during the installation all partitions will be deleted and your DATA WILL BE LOST.  
 +
<br>Use this guide at your own risk!'''}}
  
'''
 
Think about backuping ANY Data, because within the installation all partitions
 
would be deleted and your DATA WILL BE LOST.
 
This guide is without any warranty! '''
 
  
  
First Part - Setting up the HardDisk:
+
This is a small Guide to replace the original Linux (and its WebInterface) with a Debian 3.0 Woody Installation
-------------------------------------
+
  
Set you Kuro (mine is a HG-Version) in EM Mode
+
== Get a Debian image ==
 +
Get a Debian image from one of the following locations:
 +
*[http://www.genbako.com/ genbako.com/]  [Obsolete]
 +
*[http://genbako.vodapone.com/ genbako.vodapone.com/]
 +
*[http://210.166.208.216/kuro-box/archive/ 210.166.208.216/kuro-box/archive/] (most recent image dating from 2005)
 +
*[http://kurobox.com/debian/downloads kurobox.com/debian/downloads] (most recent image dating from 2005) [Obsolete]
 +
*[[debian_sylver|Improved Debian image made by Sylver]]  [Obsolete]
  
If you got shell access you could use:  
+
Tip: Use Firefox for download because IE will download a .tgz as a .tar
echo -n "NGNG" > /dev/fl3
+
reboot
+
  
If you didnt got access (you secured your Linux to much to access via shell)  
+
== Prepare the harddisk ==
then hold the red button on the back some seconds an then (while holding the red button)
+
* Put your Kurobox in EM mode (login via telnet with default username/password. For the Kuro standard it is '''root/kuro''' and for the Kuro HG it is '''root/kuroadmin''').
press the power-button at the front. The DIAG Led will flash and the Kuro should power down
+
:* When you just installed a harddisk, the box will start automatically in EM mode
after a short while of time.
+
:* If you have already partitioned the HDD, then telnet into the kurobox and run the following command followed by a reboot:
 +
echo "NGNG" > /dev/fl3
 +
* Telnet into your box and follow the these steps
 +
:* Delete ALL partitions and data with the command
 +
mfdisk -e /dev/hda
  
My Kuro is in a static-IP enviroment, so the IP will be 192.168.11.150 at this time and
+
:* Then recreate partitions manually via the command
the login would be root/kuroadmin. I think root/kuro for the non-HG-Version.
+
mfdisk -c /dev/hda
 +
  (this is the menu-driven interactive mode)
  
Set your second computers network interface to the a address like 192.168.11.25
+
::Our goal is to create the following partiton-table:
and login via telnet to 192.168.11.150
+
/dev/hda1 Bootable Typ 83(Linux) 2GB
 +
/dev/hda2 Typ 82(LinuxSwap) 256MB
 +
/dev/hda3 Typ 83(Linux) the rest of the Disk
  
First we would DELETE ALL partitions and data
+
::Creating the first partition:
with the command
+
Command (m for help):  '''n'''
mfdisk -e /dev/hda
+
Command action
 +
e extended
 +
p primary partition (1-4)
 +
'''p'''
 +
Partition number (1-4):  '''1'''
 +
First cylinder (1-<last sector>, default 1):
 +
Using default value '''1'''
 +
Last cylinder or +size or +sizeM or +sizeK (1-<last sector>), default <last sector>):  '''+2048M'''
  
then we would recreate partitions manually via the command
+
::Now we need to make this first partition bootable:
mfdisk -c /dev/hda
+
Command (m for help):  '''a'''
(this is the menue-driven interactive mode)  
+
Partition number (1-4):  '''1'''
  
Our goal is to create the following partiton-table:  
+
::Next partition 2 aka the Swap Partition:
/dev/hda1 Bootable Typ 83(Linux) 2GB
+
Command (m for help):  '''n'''
/dev/hda2 Typ 82(LinuxSwap) 256MB
+
Command action
/dev/hda3 Typ 83(Linux) the rest of the Disk
+
e extended
 +
p primary partition (1-4)
 +
'''p'''
 +
Partition number (1-4):  '''2'''
 +
First cylinder (<sector x>-<last sector>, default <sector x>):
 +
Using default value '''<sector x>'''
 +
Last cylinder or +size or +sizeM or +sizeK (1-<last sector>), default <last sector>):  '''+256M'''
  
All new partitions which will be created with the "n" command are Typ 83.
+
::The system ID for partition 2 needs to be set to "Linux Swap"
For hda1 use the First Sector (default) and give as size +2048M (for 2GB).
+
Command (m for help):  '''t'''
For hda2 use the first default sector after hda1 and give as size +256M (for 256MB).
+
Partition number (1-4):  '''2'''
For hda3 use the first default sector after hda2 and use the default last sector
+
Hex code (type L to list codes):  '''82'''
for using the rest of the disk.
+
Changed system type of partition 2 to 82 (Linux swap)
  
Set the hda the bootable flag (see the menue via the "m" help) and change the type  
+
::The 3rd and final partition will take the remainder of the disk.
for hda2 to 82 via the "t" command.
+
Command (m for help):  '''n'''
 +
Command action
 +
e extended
 +
p primary partition (1-4)
 +
'''p'''
 +
Partition number (1-4):  '''3'''
 +
First cylinder (<sector y>-<last sector>, default <sector y>):
 +
Using default value '''<sector y>'''
 +
Last cylinder or +size or +sizeM or +sizeK (1-<last sector>), default <last sector>): 
 +
Using default value '''<last sector>'''
 +
 +
::Now print the partition table and verify that there are 3 partitions.  The first one should be marked as bootable, the second should be the swap partition, the the last should just have the remainder.  To check this just type p at the prompt
 +
Command (m for help):  '''p'''
  
Now you should have the wanted table of partitions and you could write him to Disk via the "w" command.
+
::The partitions are created and need to be saved
 +
Command (m for help):  '''w'''
  
Now its time to make the filesystems:
 
mkfs -j /dev/hda1
 
mkfs -j /dev/hda3
 
  
and the Swapspace
+
* Now it's time to make the filesystems:
 +
::Format the file system on the system partition:
 +
# mkfs -j /dev/hda1
  
mkswap /dev/hda2
+
::Format the file system on the data partition:
 +
# mkfs -j /dev/hda3
  
Just mount hda1 via
+
::Format the swap partition:
mount /dev/hda1 /mnt
+
# mkswap /dev/hda2
  
Get the debain-distribution at http://210.166.208.216/kuro-box/archive/debian_2004_12_26_dist.tgz
+
::Mount the system partition:
and transfer the file via FTP from another computer to the directory /mnt on the Kuro.
+
# mount /dev/hda1 /mnt
  
Now change via
+
== Prepare Debian ==
cd /mnt  
+
* Transfer the fetched Debian image via FTP from another computer to the directory /mnt on the Kuro.
to the directory and untar the debian-distribution via
+
* First, set the correct date in the system.  (This is important since many systems start with a date of October 2004 and the tgz file has files that contain newer datestamps.)  You may have to create a symlink for date. The date is in '''MMDDhhmmCCYY''' format. For the following example, it is setting the date to September 26, 2006, 1515hrs
tar xvfz debian_2004_12_26_dist.tgz  
+
# ln -s /bin/busybox /bin/date
 +
# date -s "092615152006"
 +
* Back in the Telnet session, unpack the Debian image
 +
# cd /mnt
 +
# tar xvfz debian_2005_04_09_dist.tgz  
  
Now you should use the command
+
* Now is a good time to change some settings
write_ok
+
:* Network settings
to tell the Kuro to not startup next time in EM Mode.  
+
# vi etc/network/interfaces
 +
:: Example of static address interface settings
 +
auto eth0 lo
 +
iface eth0 inet static
 +
address 192.168.0.100
 +
network 192.168.0.0
 +
netmask 255.255.255.0
 +
broadcast 192.168.0.255
 +
gateway 192.168.0.1
 +
iface lo inet loopback
 +
:: Example of dynamic address interface settings
 +
auto eth0 lo
 +
iface eth0 inet dhcp
 +
iface lo inet loopback
  
Just reboot the Kuro:  
+
:* If a static address is used, you might want to change ''resolv,conf''
reboot
+
# vi etc/resolv.conf
  
 +
search
 +
nameserver <DNS ip address>
  
Second Part - The first boot of debian:  
+
:* Change your hostname:
---------------------------------------
+
# vi etc/hostname
  
After the reboot from above your Kuro has (again) a new static Network-configuration.
+
Jeeves
IP 192.168.0.100 (Gateway and DNS is set to 192.168.0.1 - so no InterNet at this time)
+
  
Set your second computers network interface to the a address like 192.168.0.25
+
:* Update your hosts file with your new IP & hostname (if using static IP)
and login via telnet to 192.168.0.100 (this could take some time within the first try)  
+
# vi etc/hosts
  
Because of the user root has no right to telnet in you have to use the user tmp-kun
+
127.0.0.1 localhost
with the password tmp-kun
+
192.168.0.100 Jeeves
After you logged in as tmp-kun you could su to the root-user via
+
su
+
and the password root
+
  
For editing and some lowend terminal you should set your terminal-enviroment to vt100
+
[It has been reported that FTP (proftpd) will not work unless the hosts file matches your hostname.]
export TERM=vt100
+
 +
:* Have a look at the ''hosts.allow'' file to make sure you will not be able to login again
 +
# vi etc/hosts.allow
 +
::There you should add your network :
 +
ALL : 192.168.x.0/255.255.255.0
 +
ALL : 127.0.0.1
  
The first action should be to change the network enviroment to your network.
+
* Reboot the Kuro
For this step you have to edit the /etc/network/interfaces
+
# write_ok (This is IMPORTANT! Kurobox will not leave EM mode on reboot unless you do this command)
For my network it look like
+
# reboot
iface eth0 inet static
+
(Note - I just got a kurobox, and write_ok was not required at this stage, booted straight up into Debian)
address 192.168.6.60
+
network 192.168.6.0
+
netmask 255.255.255.0
+
broadcast 192.168.6.255
+
gateway 192.168.6.1
+
iface lo inet loopback
+
  
The second IMPORTANT step is to allow your new network-configuration to login into your
+
== The first boot of debian: ==
Kuro the next time you want to login.
+
If you did forget this step YOU COULD BE CLOSED OUT of your system.
+
 
+
You have to edit the file /etc/hosts.allow
+
There you should add your network :
+
ALL : 192.168.0.0/255.255.255.0
+
ALL : 192.168.6.0/255.255.255.0
+
ALL : 127.0.0.1
+
 
+
 
+
Dont forget to save the config-file every time you changed them.
+
 
+
 
+
Third Part - The second boot of debian:  
+
---------------------------------------
+
 
+
After the reboot from above your Kuro has (again) a new static Network-configuration.
+
IP 192.168.6.60 (Gateway is 192.168.6.1 and DNS is set to 192.168.0.1 - so no InterNet at this time)
+
 
+
Set your second computers network interface to the a address like 192.168.6.25
+
and login via telnet to 192.168.6.60
+
  
 
Because of the user root has no right to telnet in you have to use the user tmp-kun  
 
Because of the user root has no right to telnet in you have to use the user tmp-kun  
with the password tmp-kun  
+
with the password tmp-kun. After you logged in as tmp-kun you may '''su''' to the root-user and the password root  
After you logged in as tmp-kun you could su to the root-user via
+
su
+
and the password root  
+
  
 
For editing and some lowend terminal you should set your terminal-enviroment to vt100  
 
For editing and some lowend terminal you should set your terminal-enviroment to vt100  
export TERM=vt100  
+
# export TERM=vt100  
  
Now for enabling the access to the Internet your Kuro should use a DNS, but the DNS
 
at this time is 192.168.0.1 which isnt really available at the most home-networks )
 
  
You should edit the file /etc/resolv.conf and add your favourite DNS-Server or
+
For security-reasons you should add your own personal user with
you just add the standard DNS-Server from the "Telekom" here in Germany like me )
+
# adduser
  
This looks like:
+
delete the standard-user tmp-kun (exit and logout first, login as new user then SU) with
search
+
# deluser tmp-kun
nameserver 194.25.2.129
+
nameserver 192.168.0.1
+
  
 +
Set a new password for root while you are logged in as root
 +
# passwd
  
You could delete the line with the nameserver 192.168.0.1 (like the network 192.168.0.0 in the
+
If this is a new Kuro, you should set the correct time and date.
/etc/hosts.allow)
+
# date                <--------to display the current date and time
  
Now you could try a ping at a known website like
+
# date [MMDDhhmmCCYY]  <--------to change (minus the brackets of course)
ping www.kurobox.com
+
PING kurobox.com (205.234.148.160): 56 data bytes
+
64 bytes from 205.234.148.160: icmp_seq=0 ttl=53 time=153.5 ms
+
  
For security-reasons you should add your own personal user with
+
Change the Time Zone as well.
adduser
+
#tzconfig
 
+
delete the standard-user tmp-kun with
+
deleteuser tmp-kun
+
 
+
and set a new password for root while you are logged in as root via
+
passwd
+
  
 
Now you could update the debian-package list via  
 
Now you could update the debian-package list via  
apt-get update  
+
#apt-get update  
  
 
and then update your currently installed packages via  
 
and then update your currently installed packages via  
apt-get upgrade  
+
#apt-get upgrade  
 
+
or you could search for additional software like webmin via
+
apt-cache search webmin
+
 
+
 
+
So I installed webmin and webmin-samba and webmin-core and webmin-exports
+
 
+
While installing Samba (its depending with webmin-samba) you should select to use
+
encrypted passwords.
+
  
After installing you could create a new SMB-share, enable the users to use SMB-Shares,
 
settimg the smb-password via webmin.
 
  
The directory of the share should set with the right access rights via chmod
+
Debian seems to use a little amount of memory in the Kurobox:
(in emergency cases you have to use chmod -R 777 /mnt (my share to hda3) to have access).
+
  
debian seems to use a little amount of memory in the kuro. also a 64MB non-HG-Kuro
+
14:04:40 up 1:06, 1 user, load average: 0.00, 0.00, 0.00
should serve debian just fine with a 256MB swap-space on disk:  
+
23 processes: 22 sleeping, 1 running, 0 zombie, 0 stopped
 +
CPU states: 1.0% user, 1.4% system, 0.0% nice, 97.6% idle
 +
Mem: 127088K total, 61644K used, 65444K free, 1508K buffers
 +
Swap: 265064K total, 0K used, 265064K free, 48800K cached
  
14:04:40 up 1:06, 1 user, load average: 0.00, 0.00, 0.00
+
==What to do from now==
23 processes: 22 sleeping, 1 running, 0 zombie, 0 stopped
+
For more information on how to tune your new Debian system, check [[Debian on the Kurobox]]
CPU states: 1.0% user, 1.4% system, 0.0% nice, 97.6% idle
+
[[Category: Debian]]
Mem: 127088K total, 61644K used, 65444K free, 1508K buffers
+
Swap: 265064K total, 0K used, 265064K free, 48800K cached
+

Revision as of 08:46, 7 February 2014

Nuvola apps important.png 
WARNING!

Backup ANY Data, because during the installation all partitions will be deleted and your DATA WILL BE LOST.
Use this guide at your own risk!



This is a small Guide to replace the original Linux (and its WebInterface) with a Debian 3.0 Woody Installation

Contents

Get a Debian image

Get a Debian image from one of the following locations:

Tip: Use Firefox for download because IE will download a .tgz as a .tar

Prepare the harddisk

  • Put your Kurobox in EM mode (login via telnet with default username/password. For the Kuro standard it is root/kuro and for the Kuro HG it is root/kuroadmin).
  • When you just installed a harddisk, the box will start automatically in EM mode
  • If you have already partitioned the HDD, then telnet into the kurobox and run the following command followed by a reboot:
echo "NGNG" > /dev/fl3
  • Telnet into your box and follow the these steps
  • Delete ALL partitions and data with the command
mfdisk -e /dev/hda 
  • Then recreate partitions manually via the command
mfdisk -c /dev/hda 
  (this is the menu-driven interactive mode) 
Our goal is to create the following partiton-table:
/dev/hda1 Bootable Typ 83(Linux) 2GB 
/dev/hda2 Typ 82(LinuxSwap) 256MB 
/dev/hda3 Typ 83(Linux) the rest of the Disk 
Creating the first partition:
Command (m for help):  n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4):  1
First cylinder (1-<last sector>, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-<last sector>), default <last sector>):  +2048M
Now we need to make this first partition bootable:
Command (m for help):  a
Partition number (1-4):  1
Next partition 2 aka the Swap Partition:
Command (m for help):  n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4):  2
First cylinder (<sector x>-<last sector>, default <sector x>):
Using default value <sector x>
Last cylinder or +size or +sizeM or +sizeK (1-<last sector>), default <last sector>):  +256M
The system ID for partition 2 needs to be set to "Linux Swap"
Command (m for help):  t
Partition number (1-4):  2
Hex code (type L to list codes):  82
Changed system type of partition 2 to 82 (Linux swap)
The 3rd and final partition will take the remainder of the disk.
Command (m for help):  n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4):  3
First cylinder (<sector y>-<last sector>, default <sector y>):
Using default value <sector y>
Last cylinder or +size or +sizeM or +sizeK (1-<last sector>), default <last sector>):  
Using default value <last sector>

Now print the partition table and verify that there are 3 partitions. The first one should be marked as bootable, the second should be the swap partition, the the last should just have the remainder. To check this just type p at the prompt
Command (m for help):  p
The partitions are created and need to be saved
Command (m for help):  w


  • Now it's time to make the filesystems:
Format the file system on the system partition:
# mkfs -j /dev/hda1 
Format the file system on the data partition:
# mkfs -j /dev/hda3 
Format the swap partition:
# mkswap /dev/hda2 
Mount the system partition:
# mount /dev/hda1 /mnt

Prepare Debian

  • Transfer the fetched Debian image via FTP from another computer to the directory /mnt on the Kuro.
  • First, set the correct date in the system. (This is important since many systems start with a date of October 2004 and the tgz file has files that contain newer datestamps.) You may have to create a symlink for date. The date is in MMDDhhmmCCYY format. For the following example, it is setting the date to September 26, 2006, 1515hrs
# ln -s /bin/busybox /bin/date
# date -s "092615152006"
  • Back in the Telnet session, unpack the Debian image
# cd /mnt 
# tar xvfz debian_2005_04_09_dist.tgz 
  • Now is a good time to change some settings
  • Network settings
# vi etc/network/interfaces
Example of static address interface settings
auto eth0 lo
iface eth0 inet static 
address 192.168.0.100 
network 192.168.0.0 
netmask 255.255.255.0 
broadcast 192.168.0.255 
gateway 192.168.0.1 
iface lo inet loopback 
Example of dynamic address interface settings
auto eth0 lo
iface eth0 inet dhcp 
iface lo inet loopback 
  • If a static address is used, you might want to change resolv,conf
# vi etc/resolv.conf
search 
nameserver <DNS ip address> 
  • Change your hostname:
# vi etc/hostname
Jeeves
  • Update your hosts file with your new IP & hostname (if using static IP)
# vi etc/hosts
127.0.0.1 localhost
192.168.0.100 Jeeves

[It has been reported that FTP (proftpd) will not work unless the hosts file matches your hostname.]

  • Have a look at the hosts.allow file to make sure you will not be able to login again
# vi etc/hosts.allow
There you should add your network :
ALL : 192.168.x.0/255.255.255.0 
ALL : 127.0.0.1 
  • Reboot the Kuro
# write_ok (This is IMPORTANT! Kurobox will not leave EM mode on reboot unless you do this command)
# reboot

(Note - I just got a kurobox, and write_ok was not required at this stage, booted straight up into Debian)

The first boot of debian:

Because of the user root has no right to telnet in you have to use the user tmp-kun with the password tmp-kun. After you logged in as tmp-kun you may su to the root-user and the password root

For editing and some lowend terminal you should set your terminal-enviroment to vt100

# export TERM=vt100 


For security-reasons you should add your own personal user with

# adduser 

delete the standard-user tmp-kun (exit and logout first, login as new user then SU) with

# deluser tmp-kun 

Set a new password for root while you are logged in as root

# passwd 

If this is a new Kuro, you should set the correct time and date.

# date                 <--------to display the current date and time
# date [MMDDhhmmCCYY]  <--------to change (minus the brackets of course)

Change the Time Zone as well.

#tzconfig

Now you could update the debian-package list via

#apt-get update 

and then update your currently installed packages via

#apt-get upgrade 


Debian seems to use a little amount of memory in the Kurobox:

14:04:40 up 1:06, 1 user, load average: 0.00, 0.00, 0.00 
23 processes: 22 sleeping, 1 running, 0 zombie, 0 stopped 
CPU states: 1.0% user, 1.4% system, 0.0% nice, 97.6% idle 
Mem: 127088K total, 61644K used, 65444K free, 1508K buffers 
Swap: 265064K total, 0K used, 265064K free, 48800K cached

What to do from now

For more information on how to tune your new Debian system, check Debian on the Kurobox