Sunteți pe pagina 1din 18

Basic GNU/Linux Sysytem Administration

Ganesh.H ganesh@space-kerala.org

Contents
1 Filesystem 1.1 How data is stored in Harddisk . . . . . . . . . . . . . . . . . . . 1.2 Filesystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.1 Journaling Filesystem(ext2,ext3,et4) . . . . . . . . . . . . 2 GNU/Linux Directory Structure 2.1 GNU/Linux directory structure explained . . . . . . . . . . . . . 2.1.1 Structure explained . . . . . . . . . . . . . . . . . . . . . 3 GNU/Linux Commands 3.1 Basic Commands . . . 3.1.1 ls . . . . . . . . 3.1.2 pwd . . . . . . 3.1.3 cd . . . . . . . 3.1.4 mv . . . . . . . 3.1.5 cp . . . . . . . 3.1.6 mkdir . . . . . 3.1.7 rm . . . . . . . 2 3 5 5 6 7 8 11 12 12 12 12 12 12 12 12 13 14 15 15 15 16

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

4 Network Management 4.1 Gnu/Linux Network Management . . . 4.1.1 Getting connection Information 4.2 Informations Explained . . . . . . . . 4.2.1 IP address . . . . . . . . . . . . 4.3 How to add a Static IP Address . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

Chapter 1

Filesystem

1.1

How data is stored in Harddisk

Figure 1.1: Hard disk

Harddisk is used to sore data in our computer.The hardisk normally in our computerappears likes the above gure .But the innerpart or the crosssection of the hardisk may appear like this.

Figure 1.2: Hard disk cross section

Harddisk consists of one or more circular aluminium platter which is coated with magnetic substance for recording data.There is a read/write head which writes andreads the data.

Figure 1.3: Hard disk read/write head

Data is stored on the surface of the platter in sectors & tracks.Tracks are concentric circles and sectors are pie shaped wedges.

Figure 1.4: Hard disk trac

The read/write head once moves a complete circle so sudden restart of the system etc may cause loss of data

1.2

Filesystem

When a disk is formatted it becomes organized and preapred to receive data.When we format a disk it receives a lesystem. The formatting process that performs basic medium preparation is often referred to as low-level formatting. The term high level formatting most often refers to the process of generating a new le system. Formatting can be compared to a library we must install the book shelves and the catalogue system before any books are put in place.Once the library is ready we bring on books.Similarly in a disk when we format it we burn in a lesystem to make it ready to receive data. In Linux every le is associated with an inode (index node) number that records its location on the diskThe inode of all les are put together in a datastructure called inode table.To view the inode no of each le use this command in GNU/Linux. ls -i filename.

Filesystems used in Microsoft are 1. FAT - File Allocation Table 2. NTFS - New Technology File System File systems used in GNU/Linux are 1. ext2 -Extended Journaling Filesystem (Version2) 2. ext3 -Extended Journaling Filesystem (Version3) 4. ext4 -Extended Journaling Filesystem (Version4)(lates & stable)

1.2.1

Journaling Filesystem(ext2,ext3,et4)

It keeps track of changes in journal usually a log le before committing it into the lesystem.In the event of system crash such lesystems are quicker to bring back and less likely to become corrupted.

Figure 1.5: Journaling File Sysytem

Chapter 2

GNU/Linux Directory Structure

2.1

GNU/Linux directory structure explained

Figure 2.1: File system structure 7

2.1.1

Structure explained
Every single le and directory starts from the root directory. Only root user has write privilege under this directory.

1. /root

2. /bin User Binaries Contains binary executables. Commands used by all the users of the system are located here. example: ps, ls, ping, grep, cp. 3. /sbin System Binaries Just like /bin, /sbin also contains binary executables. But, the linux commands located under this directory are used typically by system aministrator, for system maintenance purpose. For example: iptables, reboot, fdisk, ifcong, swapon 4. /etc Conguration Files Contains conguration les required by all programs. This also contains startup and shutdown shell scripts used to start/stop individual programs. example: /etc/resolv.conf, /etc/logrotate.conf 5. /dev Device Files Contains device les. These include terminal devices, usb, or any device attached to the system. For example: /dev/tty1, /dev/cdrom0 6. /proc Process Information Contains information about system process. This is a pseudo lesystem contains information about running process. For example: /proc/pid directory contains information about the process with that particular pid. This is a virtual lesystem with text information about system resources. For example:/proc/uptime 7. /var Variable Files var stands for variable les.

Content of the les that are expected to grow can be found under this directory. This includes system log les (/var/log); packages and database les (/var/lib); emails (/var/mail); print queues (/var/spool); lock les (/var/lock); temp les needed across reboots (/var/tmp); 8. /tmp Temporary Files Directory that contains temporary les created by system and users. Files under this directory are deleted when system is rebooted. 9. /usr User Programs Contains binaries, libraries, documentation, and source-code for second level programs. /usr/bin contains binary les for user programs. If you cant nd a user binary under /bin, look under /usr/bin. For example: at, awk, cc, less, scp 10. /home Home Directories Home directories for all users to store their personal les. For example: /home/ganesh 11. /boot Boot Loader Files Contains boot loader related les. Kernel initrd, vmlinux, grub les are located under /boot For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-generic 12. /lib System Libraries Contains library les that supports the binaries located under /bin and /sbin Library lenames are either ld* or lib*.so.* 13. /opt Optional add-on Applications opt stands for optional. Contains add-on applications from individual vendors. add-on applications should be installed under either /opt/ or /opt/ sub-directory. 14. /mnt Mount Directory Temporary mount directory where sysadmins can mount lesystems. 15. /media Removable Media Devices 9

Temporary mount directory for removable devices. For examples, /media/cdrom 16. /srv Service Data srv stands for service. Contains server specic services related data.

10

Chapter 3

GNU/Linux Commands

11

3.1
3.1.1
ls -l ls -a ls -al

Basic Commands
ls

3.1.2 3.1.3
cd cd .. cd -

pwd cd

3.1.4 3.1.5
cp -r

mv cp mkdir rm

3.1.6 3.1.7
rm -r rmdir

mkdir -P

12

Chapter 4

Network Management

13

4.1

Gnu/Linux Network Management

There is a network manager ico on right hand side of the top panel we can connect wireless and wired connection by clicking on this icon.On clicking this icon if there is wireless networks available it will list then you need select yours and give username and password.For wired also in a LAN connection you just need to add the Auto ethernet connection listed.

Figure 4.1: Wireless Connection

Figure 4.2: Wired Connection

14

4.1.1

Getting connection Information

Figure 4.3: Wired Connection

Figure 4.4: Conection Information

To get connection information the graphical way is to select network manager then select connection information from here you will get a window which shows ip address,subnet mask,DNS servers etc.

4.2
4.2.1

Informations Explained
IP address

An Internet Protocol address (IP address) is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication. An IP address serves two principal functions: host or network interface identication and location addressing. The designers of the Internet Protocol dened an IP address as a 32-bit number and this system, known as Internet Protocol Version 4 (IPv4), is still in use today. However, due to the enormous growth of the Internet and the predicted depletion of available addresses, a new addressing system (IPv6), using 128 bits for the address

15

Figure 4.5: IPV4 Connection

Figure 4.6: IPV6 Connection

Usually Ip addresses are assigned to systems automatically by the network

4.3

How to add a Static IP Address

To add a static IP Address rst select edit connections from network manager on that select wired and click on Add buttton

Figure 4.7: Network Manager Then a new window will open select IPV4 Settings tab on that window and select method as Manual

16

Figure 4.8: Manual Settings

17

S-ar putea să vă placă și