Monday, May 25, 2009

Debian 5 (Lenny) - OS installation

This is work in progress. Do not link to this page, it might change!

Hardware and preparation | OS installation | Console and web monitoring | Network & services | Multimedia | Security

Downloaded debian-501-i386-businesscard.iso* (39 MB, kernel 2.6.26-2-686) from the nearest mirror. Partitioned, minimum install. Started the adventure!
Note: There are plenty of howtos out there, I won't post again here just for the fun of posting. For the curious (unskilled), HowToForge has nice tutorials and some even describe the process of installation, I highly recommend reading there.

Errors found in logs and other problems, just after installation
[X] Upon boot, the following message appear:
usb 1-2: device not accepting address 2, error -71This error is generated by the scanner Genius ColorPage-HR7 (old model). I tried switching to other USB port, no luck - same error. Some related links: Linux-usb-users,,, #20773 (Ubuntu). Note, however, that this scanner works when using Debian 9.04 Live CD. Didn't check yet for this error message.

[X] /var/log/dmesg: "Failed to allocate mem resource #6"
server:~# dmesg | grep 0000:01:00.0
[ 0.300475] PCI: Failed to allocate mem resource #6:20000@90000000 for 0000:01:00.0
[ 0.716731] pci 0000:01:00.0: Boot video device
Solution: not yet.
Links: users on Ubuntu forums, Ubuntu bug #55416, Ubuntu bug #159241, Ubuntu bug #159241

[X] /var/log/dmesg shows:
[0.240015] PCI: Not using MMCONFIG.
[0.247907] PCI: Not using MMCONFIG.
Solution: Add pci=nommconf as a boot option to hide this error. Well, it's not working for me.
I found someone saying that this error is a BIOS bug which affects the Intel mobo and an updated BIOS may correct this issue. It looks like this message is hidden on other distros, but the issue is still there. (Note: I'm running now the latest BIOS and the error is still there)

[X] /var/log/dmesg shows:
Driver 'sd' needs updating - please use bus_type methods.
Solution: none yet, but it looks like it shouldn't worry anyone. People talk about it and search for a solution: #186167 (Ubuntu), #508322 (Debian), kernel mailing list etc.
Just after this message, another one comes up, probably related:
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
All SATA drives shows these messages. Didn't find any info and have no clue about what it means...

Customization and required software


[X] Aptitude customization:
Debian uses by default its main repository. My preferred set up:

deb lenny main contrib non-free
Other than that, I use to add repository. This is what to do for Lenny:
# wget
# dpkg -i debian-multimedia-keyring_2008.10.16_all.deb
After that, add the following to /etc/apt/apt.sources:

deb lenny main
Backports looks interesting as well (pay attention though, it is not checked by main Debian developers). I found at least one nice application on backports (is not in the main repository): wii WM (see why an WM is required to run on a server, on the multimedia page). Installation instructions of backports are on their website. It should be added to main apt.sources like this :
deb lenny-backports main contrib non-free
Don't forget to import server's security key:
# wget -O - | apt-key add -
Note: Packages are deactivated by default, so if you'd like to install something, do the following (using apt-get or aptitude):
# aptitude -t lenny-backports install “package”

Some hard-to-find or not-so-common informations about Debian
- Tasksel - software packages grouped by tasks; it offers an easy way to install all the packages needed for that task; typing tasksel in Lenny (debian-501-i386-businesscard.iso) gives the following options:
  • Desktop Environment
  • Web server
  • Print server
  • DNS server
  • File server
  • Mail server
  • SQL database
  • Laptop
  • manual package selection
A project related to apt captured my attention: apt-listbugs. It will be tested in the future.
(Tip: I use aptitude to install/update programs, instead of apt-get. A nice alternative to aptitude is dselect.)

[X] To log all commands run on machine, acct (lastcomm, ac, sa) is an option. Installation:
# aptitude install acct

[X] [updated procedure] I don't remember why I did initially all bellow steps (probably I was messing up with other distro - ubuntu?!?). It looks now that it's just a matter of:
# aptitude install ntp ntpdate

[old procedure] Time correction: although date in BIOS was right, and Debian was instructed at the installation that I use local time (Bucharest), it shows the time with 3h forward. This will fix it:
(0) If want to set local time in BIOS and let linux know about this, check that UTC=no in /etc/default/rcS
(1) Install ntp and syncronize current time with BIOS clock (ntpdate):
# hwclock --localtime
# aptitude install ntp ntpdate
(2) Add local (or closer to your location) npt servers to /etc/ntp.conf:
(3) After that, run:
# /etc/init.d/ntp restart
(4) Syncronize update time with BIOS clock:
# hwclock --systohc
Note 1: After the installation, if I use the backup internet line - RDS Link (local provider using PPPoE, in Romania), I get this error:
ntpd[...]: sendto( (fd=19): Invalid argument
Googling, we find some answers: NTP problems for newbies,

Syslog error (/var/log/dmesg):
warning: `ntpd' uses 32-bit capabilities (legacy support in use)
Solution: supposed to be fixed by now, but it's not. It looks like it's harmless. Some bugs reports: #483434 (Debian), #4746[38/39] (Debian), Google Groups etc.

[X] Change screen resolution to 1024x768 (adding kernel option vga=791 to menu.1st)

[X] make grep not to be case sensitive

[X] Console text is not colored under Debian. I prefer colors. To change this, edit the file .bashrc in the home folder (all instructions are there). If you like to keep this change for new users, add the modified .bashrc file to /etc/skel/. Whenever a new user is created, color console text will be shown. For users already created, the file /home/{user}/.bashrc should be replaced with the modified .bashrc file. This link might be of help for other distros.

[X] Bash completion is a useful tool for completion of file paths, commands etc. By default it is enabled on Ubuntu but not on Debian. With two simple steps it can also be enabled on Debian. Check here: How To Add Bash Completion In Debian.

[X] Boot log is disabled by default. To enable, edit the file /etc/default/bootlogd - change No to Yes for BOOTLOGD_ENABLE parameter.
Interesting: It looks like Ubuntu has disabled bootlogd and boot messages are copied from kernel's ring buffer to dmesg using /etc/init.d/ script. [Source]

[?] Few utilities caches all apt requests that go through it and stores a copy of the .deb file locally: approx, apt-cacher (perl+apache script, rather old, but available in lenny), apt-cacher-ng, Apt-P2P, apt-proxy (feedback not so good), apt-www-proxy (rather insecure), debproxy, debtorrent, replicator (transparent proxy, nice feedback), squid (transparent proxy, nice feedback)
Links: Upgrade multiple debian systems with Approx, Keeping many Debian servers up to date with apt-proxy, HOWTO: Setting up Debian Proxy Cache server for .deb packages (apt-proxy).
To do.

[X] Some programs needed later:
# aptitude install apt-file cabextract chkconfig cplay curl dselect elinks finger hwinfo iptraf kernel-package less links links2 linux-source-2.6.26 locate lsb-release lshw lynx mc moc mtr-tiny mutt nmap ntfsprogs perl-doc pciutils pwgen rsync screen splay ssh sysv-rc-conf telnet tofrodos unrar-free wavemon vim-doc vim-runtime
Few words about each:
- apt-file - APT package searching utility -- command-line interface
- aptitude - terminal-based package manager (I use it instead of ap-get)
- cabextract - extract Microsoft Cabinet files
- chkconfig - is system tool to enable/disable services. It was made for RedHat but it can be used also on Debian/Ubuntu. A Debian-specific tool equivalent is update-rc.d. Some other exist too. More about chkconfig, for the curious.
- cplay - front end mp3 player in console (requires splay or other player). Links: Use cplay like a pro, cplay package (Debian stable), cplay package (Ubuntu Hardy).
- curl - Get a file from HTTP, HTTPS or FTP server
- dselect - Debian package management front-end
- elinks - advanced text-mode WWW browser
- finger - lookup users
- hwinfo - Hardware identification system (similar to lspci)
- iptraf - interactive colorful IP LAN monitor
- kernel-package - utility for building Linux kernel related Debian packages
- less - pager similar to more (scroll support using up/down arrows)
- links - Web browser running in text mode
- links2 - Web browser running in both graphics and text mode
- linux-source-2.6.26 - Linux kernel source for version 2.6.26 with Debian patches
- lsb-release -Linux Standard Base version reporting utility
- lshw -Information about hardware configuration *
- lynx - Text-mode WWW Browser; virtual colors
- mc - Midnight Commander; requires lynx for html preview; links: advance configuration, mc Guide, PDF viewer (script)
- moc - ncurses based console audio player (check moc-ffmpeg-plugin)
- mtr-tiny - light version of tiny (ncurses traceroute tool)
- mutt - text-based mailreader
- nmap - check open ports
- ntfsprogs - mount easily ntfs drives
- pciutils - utilities such as lspci
- perl-doc - Perl documentation (used to display documentationsuch as, mytop etc.)
- pwgen - Automatic Password generation
- rsync - fast remote file copy program (like rcp)
- screen - let your jobs work in virtual console (good for ssh over bad disconnecting internet links); links: screen command quickstart.
- splay - front-end for cplay
- ssh - ssh server (secure connection from remote locations)
- sysv-rc-conf - SysV init runlevel configuration tool for the terminal
- telnet - telnet client
- tofrodos - Converts DOS <-> Unix text files, alias tofromdos (dos2unix)
- unrar-free - Unarchiver for .rar files
- wavemon - Wireless Device Monitoring Application
- vim-doc - Documentation for vim-tiny (installed by default in Debian)
- vim-runtime - package required for viewing VIM documentation (vim-doc)

* How to use it:
# lshw
# lshw -short

[-] Some other software (under review/testing):
# aptitude install abs-guide acct debian-goodies debian-history debian-installer debian-reference-en docbook-defguide installation-guide-amd64 installation-guide-i386 installation-guide-ia64 kernel-patch-atopacct kernel-patch-atopcnt kernel-patch-wrr linux-patch-debianlog openguides net-acct png-definitive-guide pmacct propaganda-debian sysadmin-guide vserver-debiantools
- abs-guide - The Advanced Bash-Scripting Guide
- acct - Accounting utilities for process and login accounting
- debian-goodies - Small toolbox-style utilities for Debian systems
- debian-history - A Short History of the Debian Project
- debian-installer - Debian installer
- debian-reference-en - Debian system administration guide, English original
- docbook-defguide - DocBook: The Definitive Guide - HTML version
- installation-guide-amd64 - Debian installation guide
- installation-guide-i386 - Debian installation guide
- installation-guide-ia64 - Debian installation guide
- kernel-patch-atopacct - save additional statistical counters for atop in the record
- kernel-patch-atopcnt - additional statistical counters for atop
- kernel-patch-wrr - Extension to traffic Control/network bandwidth management
- linux-patch-debianlogo - Display a Debian logo on a framebuffer device at boottime
- net-acct - User-mode IP accounting daemon (like tcpdump)
- openguides - A web application for managing a collaboratively-written city guide
- pmacct - promiscuous mode traffic accountant (like Cacti). Links: Make graphs: pmacct and Cacti.
- png-definitive-guide - PNG: The Definitive Guide
- propaganda-debian - Propaganda background image volume for Debian (images intended to be used as desktop backgrounds)
- sysadmin-guide - The Linux System Administrators' Guide
- vserver-debiantools - Tools to manage debian virtual servers

Errors found in logs and other problems
[X] Some sites don't work (from laptop, as a host, via wireless)
It looks like this problem happens because I use MASQ on linux, and the problem is described on several sites on the internet: Linux IP Masquerade HOWTO (FAQ),
[update] A virus was catch on laptop and the issue resolved. I leave this here for the link above, interesting to read.

[X] Found in /var/log/auth.log a crontab job which writes every hour this message:
CRON[...]: pam_unix(cron:session): session opened for user root by (uid=0)
CRON[...]: pam_unix(cron:session): session closed for user root

This should be directed to a cron log or disabled (it looks that this is the job in /etc/crontab: "#17 * * * * root cd / && run-parts --report /etc/cron.hourly" - I disabled it and no more junk so far).
[update] Researching, I found out that run-parts is a script (part of debianutils) which runs executable files under a specific directory (in this case /etc/cron.hourly). Unless you don't want to run cron jobs, this option can be disabled as above. Otherwise, it's not a smart choice. This needs investigation to avoid breaking functionality.

[X] Upon boot, the following message appear:
kinit: name_to_dev_t (/dev/sda5) = sda5(8,5)
kinit: trying to resume from /dev/sda6
kinit: No resume image, doing normal boot ....
It looks like a bug, harmless. Few links describing similar behaviour: #277411, #103148,
Apparently, this comment in bug #103148 describe the solution (be aware of #66637 if using hibernation and UUID-based fstab!). However, it didn't work for me. I tried also re-building the swap, change pass to value 2 in /etc/fstab, but it didn't work also.

Note: To investigate some bugs, it is suggested using advices from Ubuntu support docs: Debugging IRQ problems.

To do (reminder for myself):
- add to boot a new menu entry "Single user mode" (Debian)
- add to boot a new menu entry "(MS-)DOS", and have DOS prepared for usual tasks
- configure ghost backup from (MS-)DOS, if possible

About / Despre acest blog
Disclaimer and privacy statement / Confidenţialitate
Updated / Actualizat: 2009-09-15.


No comments: