disk partitions

22
RH133 Red Hat Enterprise Linux System Administration Welcome!

Upload: vibhor-sharma

Post on 20-Jul-2016

230 views

Category:

Documents


5 download

DESCRIPTION

linux

TRANSCRIPT

Page 1: Disk Partitions

RH133

Red Hat Enterprise Linux System Administration

Welcome!

Page 2: Disk Partitions

2

Objectives Day 7

Network Configuration IP Address Configuration Using Network Clients

Filesystem Management Disk Partitioning Managing Partitions [ Mounting and Unmounting ] Virtual Memory using SWAP file and Partition

Kernel Services and Configuration /proc folder kudzu

Page 3: Disk Partitions

3

Network Configuration

Page 4: Disk Partitions

4

IP Addressing Is a 32bit Logical Address which make computer to communicate to

each others using TCP/IP protocol. Defined in different classes From A to E

Class A = 1 to 126

Class B = 128 to 191

Class C = 192 to 223

We can assign IP Address to computer by using two methods

1. Static [ Manually ]

2. Dynamic [ Using DHCP Server ]

Page 5: Disk Partitions

5

Network Configuration Commands

ifconfig Used to view the properties of active and inactive network interfaces ifconfig Ifconfig –a = to display information about inactive network interface

ifup / ifdown Used to activating and deactivating a network interface ifdown eth0 ifup eth0

mii-tool Tool allows a system administrator to view, monitor, log and change the

negotiated speed of Ethernet network cards mii-tool –v = to view the current status of network interface card mii-tool –v --force 100baseTx-FD eth0 To change the negotiated speed of Ethernet network card

Page 6: Disk Partitions

6

Network Configuration Utilities

neat / neat-tui Text-based network configuration tool Only writes config files. Does not activate device or changes.

Use ifup/ifdown to active changes or restart the network service Used by kudzu when new network card found at boot time

system-config-network GNOME-based network configuration tool Can be launched by a non-privileged user, but requires authentication

as root.

Page 7: Disk Partitions

7

Filesystem Management

Page 8: Disk Partitions

8

Step-1 – Check the drive fdisk -l Step-2 – Create new partition fdisk /dev/hda Step-3 – Write the new table to running kernel configuration partprobe Step-4 – Format the new partition mkfs.ext3 /dev/hdaN Step-5 – Mount the new partition a) Temporary : Give the following command mount -t ext3 /dev/hdaN /mnt/newdata b) Permanent : vi /etc/fstab /dev/hdaN /mnt/newdata ext3 defaults 0 0 Step-6 – Activate the mounting of new partition mount -a

CREATING LINUX PARTITIONS:

Page 9: Disk Partitions

9

DEFINING LABELS FOR PARTITION

e2label /dev/hdaN newlabel Mount Temporary -- mount LABEL=newlabel /mnt/newdata Mount Permanent -- vi /etc/fstab LABEL=newlabel /mnt/newdata ext3 defaults 0 0

Page 10: Disk Partitions

10

What is SWAP Space? Swap space in Linux is used when the amount of physical

memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM. Swap space is located on hard drives, which have a slower access time than physical memory.

Swap should equal 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB.

Page 11: Disk Partitions

11

CREATING SWAP PARTITION

Step-1 – Create a partition type of “swap” using FDISK fdisk /dev/hda Step-2 – Change the System ID of partition and Format the partition as

SWAP Press t for change the system ID of New Partition to linux SWAP Save and exit from fdisk command and run partprobe command mkswap /dev/hdaN Step-3 – Enable the SWAP space swapon -a Step-4 – Permanent availability to the system vi /etc/fstab /dev/hdaN swap swap defaults 0 0

Page 12: Disk Partitions

12

CREATING SWAP FILE

Step-1 – Creating a SWAP file dd if=/dev/zero of=/swapfile bs=1M count=300 Step-2 – Configuring this file as SWAP mkswap /swapfile Step-3 – Enabling the SWAP file Temporary swapon /swapfile Step-4 – vi /etc/rc.d/rc.local Permanent swapon /swapfile Step-5 – Activating and confirming swapon -a swapon -s

Page 13: Disk Partitions

13

Accessing ext2 / ext3 partitions in Windows

www.chrysocome.net/virtualvolumes

A very beautiful tool “explore2fs” can be used to access your linux ext2fs and ext3fs partitions in Windows.

Page 14: Disk Partitions

14

Accessing NTFS partitions in Linux You need a tool like “ntfs-3g”

Download it and mount the NTFS partition as instructions:

Installation

./configure

make

make install # or 'sudo make install' if you aren't root

Usage

[Temporary]

mount -t ntfs-3g /dev/sda1 /mnt/windows

[Permanent] vi /etc/fstab file:

/dev/sda1 /mnt/windows ntfs-3g defaults 0 0

Page 15: Disk Partitions

15

What is Kernel?

The kernel is the heart of the whole operating system. It manages communication with hardware, decides which processes to run, and provides each process with an isolated, virtual address space in which to run. The kernel is what your boot loader, GRUB , loads into memory. The kernel loads device driver modules.

Page 16: Disk Partitions

16

When you recompile your kernel, you can

Greatly improve the speed at which kernel services operate. Build in direct support for commonly used drivers. Configure the dynamic loading of appropriate drivers as modules. Lower the memory consumption of your kernel by removing unneeded

components. Configure support for high-end hardware, such as memory above 4GB,

hardware array controllers, symmetric multiprocessing (multiple CPU) support, and more.

Page 17: Disk Partitions

17

Types of kernel Monolithic Modular

Page 18: Disk Partitions

18

Monolithic versus Modular

A monolithic kernel is a kernel where all the device modules are built directly into the kernel. Modular kernels have many of their devices built as separate loadable modules. Monolithic kernels can communicate with devices faster, since modular kernels can talk to the hardware only indirectly through a module table. Unfortunately, monolithic Linux kernels are huge. Bigger kernels reduce available RAM. In addition, some systems just can't boot a kernel that's too large.

There used to be advantages to a monolithic kernel. Linux once had problems loading modular kernels for some hardware. With a monolithic kernel, the drivers would already be there. But now modular kernels load new drivers a lot more reliably.

A modular kernel has greater flexibility. You can compile almost all your drivers as modules, and then each module can be inserted into the kernel whenever you need it. Modules keep the initial kernel size low, which decreases the boot time and improves overall performance. If Linux has trouble loading a kernel module, you can use the modprobe or insmod commands to load modules as needed.

Page 19: Disk Partitions

19

The /proc filesystem /proc is a virtual filesystem containing information about the running

kernel Contents of “files” under /proc may be viewed using cat Provides information on system hardware, networking settings and

activity, memory usage and more /proc/cpuinfo /proc/meminfo /proc/version /proc/partitions etc……..

Page 20: Disk Partitions

20

kudzu The kudzu utility maintains a database of detected and configured

hardware, found at /etc/sysconfig/hwconf As a part of the boot process, kudzu compares the currently detected

hardware to the stored database If new hardware is detected , or previously existing hardware is

removed, kudzu will attempt to automatically reconfigure the system or steer the administrator to the appropriate interactive configuration utility

Page 21: Disk Partitions

?Questions

Page 22: Disk Partitions

Thank You !!!