You are on page 1of 4

RH135-Day10

Written by Razib Shahriar Rubence

--------RH135
Day 10
--------Automated Installation of Red Hat Enterprise Linux
using kickstart, a system administrator can create a single file (.cfg file) which contains the
answers to all the questions typically asked during an installation. this file can be accessed to
the installer (for example RHEL cd/dvd or rhcectg file in our LAB) to automate installation of
RedHat Enterprise Linux.
Steps for kickstart installation
01. Create a kickstart file
- Using system-config-kickstart
- using /root/anaconda-ks.cfg file from a alrady insalled RHEL box
02. Make the Kickstart file available to the Installer
- Network servers: FTP, HTTP, NFS
- DHCP/TFTP server
- USB Disk or CD-ROM
- Local hard disk
03. Boot the installer
- Installation Disks
- PXE Boot
- boot.iso
04. Point the installer to the kickstart file
- ks=http://server/dir/file
- ks=ftp://server/dir/file
- ks=nfs:server:/dir/file
- ks=hd:/device/dir/file
- ks=cdrom:/dir/file
LAB Practice:

1/4

RH135-Day10
Written by Razib Shahriar Rubence

01. Using Installation Disk do the kickstart nfs installation. The location of kickstart file is
192.168.0.254:/var/ftp/pub/rhel6.cfg
-Step 01. The kickstart file is rhel6.cfg
-Step 02. The kickstart file is availabel through nfs
-Step 03. Put the Redhat Enterprise Linux Installation Disk in your CD/DVD ROM. And boot
from cd/dvd
-Step 04. When Prompt for Choosing Installation Method, Pres ESC. You'll get a black screen
with the prompt "boot:". Type the following
boot: linux ks=nfs:192.168.0.254:/var/ftp/pub/rhel6.cfg . Press Enter . The automatic installation
will begin
Archives and Comperession:
Create Linux tar/gzip/bzip2 Archive
Key tar options:
1. C = Create
2. x = Extract
3. t = List
4. v = Verbose
5. f = use archive File
6. z = gzip
7. j = bzip2
8. C = Extract in specific directory
LAB Practice:
- Create tar file
tar -cvf myarchive.tar /tmp
- View the content of myarchive.tar before extracting
tar -tvf myarchive.tar
- Extract this tar file
tar -xvf myarchive.tar
- Create tar.gzip file
tar -zcvf myarchive.tar.gzip
- View the content
tar -tvfz myarchive.tar
- Extract this tar.gzip file
tar -xvfz myarchive.tar -C /home
Hard Links and Soft Links:
You're probably familiar with shortcuts in Microsoft Windows or aliases on the Mac. Linux has

2/4

RH135-Day10
Written by Razib Shahriar Rubence

something, or actually some things similar, called hard links and symbolic links. Symbolic links
(also called symlinks or softlinks) most resemble Windows shortcuts. They contain a pathname
to a target file. Hard links are a bit different. They are listings that contain information about the
file. Linux files don't actually live in directories. They are assigned an inode number, which Linux
uses to locate files. So a file can have multiple hardlinks, appearing in multiple directories, but
isn't deleted until there are no remaining hardlinks to it.
Here are some other differences between hardlinks and symlinks:
1. You cannot create a hardlink for a directory.
2. If you remove the original file of a hardlink, the link will still show you the content of the file.
3. A symlink can link to a directory.
4. A symlink, like a Windows shortcut, becomes useless when you remove the original file.

LAB Practice

Hardlinks:

Make a new directory called Test and create FileA into it:
$ mkdir Test
$ cd Test
$ vi FileA
Make a hardlink to FileA. We'll call the hardlink FileB.
$ ln FileA FileB
Then use the "i" argument to list the inodes for both FileA and its hardlink. Type:
$ ls -il FileA FileB
1482256 -rw-r--r-- 2 root root 21 July 20 15:55 FileA
1482256 -rw-r--r-- 2 root root 21 July 20 15:55 FileB
You can see that both FileA and FileB have the same inode number (1482256). Also both files
have the same file permissions and the same size. Because that size is reported for the same
inode, it does not consume any extra space on your HD!
Next, remove the original FileA:
$ rm FileA
And have a look at the content of the "link" FileB:
$ cat FileB
You will still be able to read the text you typed.

Symlink:
Staying in the same test directory as above, let's make a symlink to FileB. Call the symlink

3/4

RH135-Day10
Written by Razib Shahriar Rubence

FileC:
$ ln -s FileB FileC
Then use the i argument again to list the inodes.
$ ls -il FileB FileC
This is what you'll get:
1482256 -rw-r--r-- 1 bruno bruno 21 July 5 15:55 FileB
1482226 lrwxrwxrwx 1 bruno bruno 5 July 5 16:22 FileC -> FileB
You'll notice the inodes are different and the symlink got a "l" before the rwxrwxrwx. The link
has different permissions than the original file because it is just a symbolic link. Its real content
is just a string pointing to the original file. The size of the symlink (5) is the size of its string. (The
"-> FileB" at the end shows you where the link points to.)
Now list the contents:
$ cat FileB
$ cat FileC
They will show the same text.
Now if we remove the original file:
$ rm FileB
and check the Test directory:
$ ls
You'll see the symlink FileC is still there, but if you try to list the contents:
$ cat FileC
It will tell you that there is no such file or directory. You can still list the inode. Typing:
$ ls -il FileC
will still give you:
1482226 lrwxrwxrwx 1 bruno bruno 5 May 5 16:22 FileC -> FileB
But the symlink is obsolete because the original file was removed, as were all the hard links. So
the file was deleted even though the symlink remains.

4/4

You might also like