Debian basic features

From NewbieDOC


Chris Lale
chrislale AT users DOT berlios DOT de

Go to NewbieDOC index

Revision History


Revision 1.0 11th September 2005 Revised by Chris Lale
Initial release

Revision 1.1 7th January 2006 Revised by Chris Lale
Modified for NewbieDOC. Changed title from 'What you might like to know before you install Debian GNU/Linux'.

Revision 1.2 22nd November 2007 Revised by Chris Lale
Modified so that a stable version can be included in the "newbiedoc" package.

Revision 1.3 25th September 2009 Revised by Chris Lale
Updated and checked as being compatible with Debian Squeeze.


Image:Newbiedoc-32.png Stable document
You can comment on this document by clicking on the discussion tab.

You can edit the live version of this document: Debian basic features


Abstract

This article describes some of the basic features of Debian GNU/Linux. These are the sort of things that you might like to know about before you install Debian on your computer.

Contents


1 What Debian is

Debian GNU/Linux is a free operating system. The engine of an operating system is called the kernel. Debian uses the Linux kernel. The rest of the operating system that lets you use the kernel consists of a number of tools. In Debian, these are provided by the GNU project.

You can install Debian as a replacement for Windows or as part of a dual-boot system.

For more detail see http://www.debian.org/intro/about.

2 Linux filesystem

Windows has a directory tree for each drive. Each tree begins with a drive letter.

Linux has only one tree called the filesystem. It starts with the symbol for the root directory: '/'. (There is a special user also called root. User root's home directory is '/root'. Be careful not to confuse the two.) The root directory has some subdirectories:

  • bin - Essential command binaries
  • boot - Static files of the boot loader
  • dev - Device files
  • etc - Host-specific system configuration
  • home - User home directories
  • lib - Essential shared libraries and kernel modules
  • media - Mountpoint for removeable media
  • mnt - Mountpoint for mounting a filesystem temporarily
  • opt - Add-on application software packages
  • root - Home directory for the root user
  • sbin - Essential system binaries
  • tmp - Temporary files
  • usr - Secondary hierarchy (for user-installed applications)
  • var - Variable data

In Linux, the user never needs to know which physical drive contains particular data. This is unlike Windows where you need to know which drive (C:, D:, etc) to use. Instead, in Linux you mount a drive to a particular mountpoint in the directory tree. For instance, the first CD drive in Windows might be D: or E: or some other drive letter and might change if other drives are added to or removed from the system. In Linux, the mountpoint for the first CD drive is /media/cdrom0. The mountpoint does not change if you add or remove devices, although you can add a convenient symlink (shortcut) to the filesystem such as /cdrom.

If you install an application in Windows, the executable and related files are normally installed to C:\Program Files. In Linux,

  • application executable files (binaries) are installed in /usr/bin,
  • manuals in /usr/share/man,
  • other documentation in /usr/share/doc,
  • etc.

Linux does not have a registry. Configuration data is normally in the form of text files installed in /etc.

3 Disc devices and partitions

In Windows, the active primary partition on the primary master IDE disc is called C:. Other partitions (and CDROM drives) are called D:, E: etc. In Windows 98 and earlier, the allocation of drive letters to partitions is automatic and fixed. From Windows NT onwards it is possible to reassign some drive letters.

In Linux, it is often said that "everything is a file". In the case of discs, the whole primary IDE master disc is the device /dev/hda, the primary slave is /dev/hdb, the secondary master is /dev/hdc and the secondary slave is /dev/hdd.

The first SCSI hard disc is /dev/sda, the second is /dev/sdb etc. SCSI CD or DVD devices are /dev/scd0 etc.

PATA drives (connected with flat cables) are treated as IDE ATA drives (/dev/hda etc). SATA drives (not connected with flat cables) are treated as SCSI drives (/dev/sda, /dev/sdb etc).

It is possible to have up to 4 primary partitions on a hard disc. One of them can be an extended partition containing up to 63 other logical partitions. The logical partitions must be contiguous. Windows uses only one primary partition and one extended partition containing logical partitions. Linux can use all the partitions, but manual configuration is needed to use more than 20 partitions per disc in Debian.

If /dev/hda is formatted with two primary partitions, the partitions would be /dev/hda1 and /dev/hda2. In a typical dual-boot (Windows/Linux) system, primary partition 1 will be Window's drive C:, so this can be accessed as /dev/hda1. Partition 2 (/dev/hda2) will be Window's extended partition, though this never needs to be accessed directly. Partitions 3 and 4 will be unused, and 5 upwards are the partitions within the extended partition. Partition 5 will be D: or /dev/hda5.

CD or DVD drives cannot be partitioned. A typical CD drive would be /dev/hdc (IDE) or /dev/scd0 (SCSI).

In Windows, there may be two floppy drives, A: and B:. In Linux, the floppy drives are /dev/fd0, /dev/fd1 etc.

4 Mounting and unmounting devices

Everything in Linux is a file - including devices such as disc drives. In order to use a drive, you must mount the device to a mountpoint in the filesystem. You can then access the drive from the mountpoint. For example, you may wish to use another hard drive to store backups of your system. To add manually an EXT3 formatted partition /dev/hdb1 you might create a new directory /mnt/backup as the mountpoint. You can then mount the partition with the mount command

$ mount -t ext3 /dev/hdb1 /mnt/backup

and unmount it with the umount command (NB only one n)

$ umount /mnt/backup

or

$ umount /dev/hdb1

The configuration file /etc/fstab contains the details of devices which are mounted automatically at boot time.

Removable media can be automatically mounted if you install an automounter. The X-window desktop Gnome includes automounting as standard. The media will not unmount or eject until all processes involving it are finished. In Gnome, right-click on the CD icon and choose eject.

5 Filesystem formats

The most common Linux format is EXT2 (the Second Extended file system format). Recent distributions use EXT3 which is EXT2 with a journaling system. The journal protects against corruption of filesystem data which might cause lost files etc. As well as being robust, EXT2/3 partitions are efficient and do not need to be defragmented. They can be checked and repaired with the filesystem checker fsck which is similar to scandisk in Windows.

Windows cannot access native Linux formatted drives, but Linux can read from and write to other formats such as FAT, FAT32, etc. However, writing to NTFS is not recommended (see http://linux-ntfs.sourceforge.net/info/ntfs.html.html#3.2).

6 Linux malware

There has not been a real Linux virus epidemic in the wild. This is because a virus (or any other program) can only carry out actions that the user running the virus is allowed to do. Normal users do not have enough privileges to cause damage to the system. Only user root can do that. You would have to run an untrusted binary as root to run any risk. Desktop users routinely do not log in as root, and only switch user to root to run specific, trusted software. You have to deliberately try to circumvent this protection and know the root password to be at risk.

Worms exploit known security holes. Generally, there are very few new or unknown holes. Defeating worms and trojans is as easy as keeping software up to date.

There are Anti-Virus scanners available for Linux (but generally speaking no Linux viruses). However, they will pick up Windows viruses and stop you spreading them to Windows users.

7 Linux security

The most important practice is never to login as user root (the superuser). Only user root has access to everything - that is why you must be root during the installation process. Always login as a normal user (low privileged user). If you need root privileges for an application, switch user to root as follows:

  • certain X applications, eg the software installer Synaptic, prompt for user root's password,
  • for other X applications, run gksu followed by space followed by the command that launches the application,
  • for console commands, switch user with the su command to obtain user root's prompt (#) then issue the command. When you have finished, enter exit or press ctrl-D to resume as the normal user ($ prompt).
  • you can also use sudo to allow access to particular commands using the user's own password rather than the root password.

Debian is installed with security features enabled by default. You can disable features that you do not need, but you are unlikely to do this unless you know what you are doing. This approach means that you are unlikely to make yourself vulnerable through ignorance or accident.

For a computer connected to the internet, keeping the system constantly up to date means that security holes are plugged almost as soon as they are discovered. You need this line (uncommented ie without a preceding #) in your /etc/apt/sources.list file:

deb http://security.debian.org/ etch/updates main contrib non-free

8 Linux bugs

Anyone finding a bug in Debian can report it using the bug tracking system. Most of the bugs are sorted out before the software moves into the stable distribution ( ie in the testing or unstable distributions). See http://www.debian.org/Bugs/.

9 Running Windows applications

There is free Wine which works by making systmem calls directly to Linux (Wine Is Not an Emulator). A commercial version called Crossover Office is very stable for apps like MS Office (see http://www.codeweavers.com/products/cxoffice/). There is also a commercial version for Windows games called cedega (http://www.transgaming.com/).

Alternatively, if you have a copy of Windows, you can set up a virtual machine running within Debian. You can use a Debian package such as virtualbox or qemu. There are commercial emulators such as Vmware.

10 Installing software

The traditional way of installing Linux software is by compiling the binary (executable file) on your own computer from source code. This is actually quite easy and is one of the reasons why viruses are not a problem in Linux - they normally hide in pre-compiled binaries but are obvious foreigners in source code. The drawback for the novice user is that Linux is modular and an application may depend on one or more other applications, which in turn may depend on other applications, etc. So you may find that compilation fails because you have not installed all the necessary depenedencies.

This is solved by Debian's packaging system Apt (Red Hat Linux has an alternative packaging system called Rpm). In Debian, the application is pre-compiled for your computer's architechture and packaged together with associated files, configuration data, etc in a single .deb file. The package also knows which other packages (dependencies) are needed and installs them too automatically. You can install packages with Synaptic (X) or aptitude or apt-get (commandline).

11 Help and support

Most problems can be solved by reading the documentation:

  • man page (eg man man diplays the manual for the man command)
  • info page (the info command)
  • Dwww (man and info pages with a web interface)
  • files in /usr/share/doc/app-name
  • HOWTOs (eg the Linux Documentation Project (http://tldp.org/)
  • Debian documentation on the web (http://www.debian.org/doc/)
  • Unofficial Debian websites eg http://www.debianhelp.org/
  • internet home page for the application
  • internet wikis
  • internet forums
  • internet mailing list archives (try Google with 'site:lists.debian.org search-term-1 search-term-2 ...')


If the problem persists read http://www.catb.org/~esr/faqs/smart-questions.html and ask at



12 Bibliography

http://www.pathname.com/fhs/ Linux Filesystem Hierarchy Standard

http://www.pathname.com/fhs/ Comparison of Windows and Linux drives and partitions

http://linux.org.mt/article/partnames?locale=mt Linux device names for IDE and SCSI

http://www.tldp.org/HOWTO/Partition/partition-2.html Viruses, security etc

http://www.patentmatics.org/pub2002/pub121.htm

http://www.dwheeler.com/oss_fs_why.pdf

http://www.seifried.org/security/index.php/Linux_and_Viruses

http://www.theregister.co.uk/security/security_report_windows_vs_linux/

http://www.debian.org/security/

13 Appendix A: Licence

Copyright (c) 2005-2009 Chris Lale. chrislale AT users DOT berlios DOT de

GNU FDL Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License."

Go to NewbieDOC index

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.