Sunday, June 9, 2013

YUM repository setup on ISO based - RHEL -5

Initially I created mkdir /var/repo/
mount -o loop /var/rhel5.iso /var/repo
cd /var/repo
createrepo .
and then ran createrepo on it. But would get the following error:
Directory must be writable.
To resolve that create a soft link
mkdir /var/repo/Server --> This is the path where I will dump my all RPM's from Server directory
ln -s /var/repo/Server/ /var/repo/Server
createrepo /var/repo/Server

Now......... Add following to the file

 cat /etc/yum.repos.d/iso.repo

[My ISO Repository]
name=test
baseurl=file:///var/repo/Server
enabled=1
gpgcheck=0

Now... Lets test:

[root@smtreeprd02 ~]# rpm -qa | grep -i telnet
telnet-0.17-38.el5
[root@smtreeprd02 ~]# yum remove telnet-0.17-38.el5
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Remove Process
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package telnet.i386 1:0.17-38.el5 set to be erased
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Removing:
 telnet                  i386       1:0.17-38.el5    installed          96 k

Transaction Summary
=============================================================================
Install      0 Package(s)
Update       0 Package(s)
Remove       1 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Removing  : telnet                       ######################### [1/1]

Removed: telnet.i386 1:0.17-38.el5
Complete!
[root@smtreeprd02 ~]#
[root@smtreeprd02 ~]# yum install telnet-0.17-38.el5
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
My ISO Repository         100% |=========================|  951 B    00:00
ftp://192.168.60.143/var/ftp/Server/repodata/repomd.xml: [Errno 4] IOError: [Errno ftp error] 550 Failed to change directory.
Trying other mirror.
Error: Cannot open/read repomd.xml file for repository: Server
[root@smtreeprd02 ~]# cd /etc/yum.repos.d/
[root@smtreeprd02 yum.repos.d]# ls
iso.repo  rhel-debuginfo.repo
[root@smtreeprd02 yum.repos.d]# rm rhel-debuginfo.repo
rm: remove regular file `rhel-debuginfo.repo'? y
[root@smtreeprd02 yum.repos.d]# cd
[root@smtreeprd02 ~]# yum install telnet-0.17-38.el5
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 600 kB    00:00
################################################## 2113/2113
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for telnet to pack into transaction set.
telnet-0.17-38.el5.i386.r 100% |=========================| 7.7 kB    00:00
---> Package telnet.i386 1:0.17-38.el5 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 telnet                  i386       1:0.17-38.el5    My ISO Repository   56 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 56 k
Is this ok [y/N]: y
Downloading Packages:
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 37017186

Public key for telnet-0.17-38.el5.i386.rpm is not installed
[root@smtreeprd02 ~]# vi /etc/yum.repos.d/iso.repo
[root@smtreeprd02 ~]# yum install telnet-0.17-38.el5
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package telnet.i386 1:0.17-38.el5 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 telnet                  i386       1:0.17-38.el5    My ISO Repository   56 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 56 k
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
warning: telnet-0.17-38.el5: Header V3 DSA signature: NOKEY, key ID 37017186
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: telnet                       ######################### [1/1]

Installed: telnet.i386 1:0.17-38.el5
Complete!




Friday, June 7, 2013

mount DVD in RHEL 5

I was not able to find this on internet and on forums. But I knew I had one Linux box where I had done full installation and DVD would get mounted there. Hence ran ls -l /dev/dvd and found that it is soft linked to hdc. So did the following:

[root@smtreeprd05 ~]# ln -s /dev/hdc /dev/dvd
[root@smtreeprd05 ~]# ls -l /dev/dvd
lrwxrwxrwx 1 root root 8 Jun  4 01:22 /dev/dvd -> /dev/hdc
[root@smtreeprd05 ~]# mount /dev/dvd /mnt/
mount: block device /dev/dvd is write-protected, mounting read-only
[root@smtreeprd05 ~]# cd /mnt/
[root@smtreeprd05 mnt]# ls
Cluster         README-en.html  README-or.html         RELEASE-NOTES-de.html  RELEASE-NOTES-ml.html     RPM-GPG-KEY-fedora
ClusterStorage  README-es.html  README-pa.html         RELEASE-NOTES-en       RELEASE-NOTES-mr.html     RPM-GPG-KEY-fedora-test
EULA            README-fr.html  README-pt_BR.html      RELEASE-NOTES-en.html  RELEASE-NOTES-or.html     RPM-GPG-KEY-redhat-auxiliary
eula.en_US      README-gu.html  README-ru.html         RELEASE-NOTES-es.html  RELEASE-NOTES-pa.html     RPM-GPG-KEY-redhat-beta
GPL             README-hi.html  README-si.html         RELEASE-NOTES-fr.html  RELEASE-NOTES-pt_BR.html  RPM-GPG-KEY-redhat-former
images          README-it.html  README-ta.html         RELEASE-NOTES-gu.html  RELEASE-NOTES-ru.html     RPM-GPG-KEY-redhat-release
isolinux        README-ja.html  README-te.html         RELEASE-NOTES-hi.html  RELEASE-NOTES-si.html     Server
README-as.html  README-kn.html  README-zh_CN.html      RELEASE-NOTES-it.html  RELEASE-NOTES-ta.html     TRANS.TBL
README-bn.html  README-ko.html  README-zh_TW.html      RELEASE-NOTES-ja.html  RELEASE-NOTES-te.html     VT
README-de.html  README-ml.html  RELEASE-NOTES-as.html  RELEASE-NOTES-kn.html  RELEASE-NOTES-zh_CN.html
README-en       README-mr.html  RELEASE-NOTES-bn.html  RELEASE-NOTES-ko.html  RELEASE-NOTES-zh_TW.html

Thanks.

Monday, June 3, 2013

mount: special device /dev/dvd does not exist

[root@localhost ~]# mount /dev/dvd /mnt/
mount: special device /dev/dvd does not exist

tried the following command and it worked!
ln -sf /dev/hdc /dev/dvd

[root@localhost ~]# mount /dev/dvd /mnt/
mount: block device /dev/dvd is write-protected, mounting read-only
[root@localhost ~]# cd /mnt/
[root@localhost mnt]# ls
Cluster         README-or.html         RELEASE-NOTES-ml.html
ClusterStorage  README-pa.html         RELEASE-NOTES-mr.html
EULA            README-pt_BR.html      RELEASE-NOTES-or.html
eula.en_US      README-ru.html         RELEASE-NOTES-pa.html
GPL             README-si.html         RELEASE-NOTES-p

OUTPUT truncated.........................

Sunday, June 2, 2013

RHEL 5 Kickstart setup and installation

Below is the short process of how to setup the Kickstart server and create a Kickstart file for automated installation with HTTP style.

Set up web server Apache which is default on RHEL-5.
Create an iso with the dd command as shown below
mount the DVD

# mount /dev/dvd /mnt
# dd if=/dev/dvd of=/var/rhel5.iso
# mkdir /var/www/html/kick
# cd /var/www/html/kick
dump your DVD mounted files and directories with following way:

#  rsync -rv /mnt/* .

copy the anaconda.ks.cfg file from /root and modify as per your requirement. Here is the basic one just to get the things going - So this is simply just for reference - in case you forget OR set up the Kickstart after a while :-) in that case you may really need some notes to refer.

Example ks.cfg file:

# Kickstart file automatically generated by anaconda.

install
url --url http://192.168.60.130/kick
key --skip
lang en_US.UTF-8
langsupport --default=en_US.UTF-8 en_US.UTF-8
keyboard us
xconfig
network --device eth0 --bootproto dhcp
rootpw --iscrypted $1$mgirnE1C$tK92VwNASset7OLfUSznD/
firewall --disabled
selinux --disabled
authconfig --enableshadow --enablemd5
timezone America/Phoenix
bootloader --location=mbr --append="rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --all --initlabel
part /boot --fstype ext3 --size=100
part / --fstype ext3 --size=3000 --grow --maxsize=4000
part /home --fstype ext3 --size=1000 --grow
part swap --size=1000 --grow --maxsize=2000

%packages
@ admin-tools
@ text-internet
@ gnome-desktop
@ dialup
@ smb-server
@ base-x
@ web-server
@ printing
@ server-cfg
grub
e2fsprogs
kernel

%post

boot your client with bootable CD or with iso

linux ks=http://192.168.140.22/kick/ks.cfg



Thanks.