Boot your rescue media.
Scan for volume groups:
# lvm vgscan -v
Activate all volume groups:
# lvm vgchange -a y
List logical volumes:
# lvm lvs –all
With this information, and the volumes activated, you should be able to mount the volumes:
# mount /dev/volumegroup/logicalvolume /mountpoint
How to convert RHEL5 to CentOS5
# Determine version and architecture of installed RHEL
cat /etc/redhat-release
uname -i
# Go to working directory
mkdir /root/centos5
cd /root/centos5
# Download the necessary files
wget http://mirror.umd.edu/centos/5.8/os/x86_64/CentOS/centos-release-notes-5.8-0.x86_64.rpm
wget http://mirror.umd.edu/centos/5.8/os/x86_64/CentOS/centos-release-5-8.el5.centos.x86_64.rpm
wget http://mirror.umd.edu/centos/5.8/os/x86_64/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm
wget http://mirror.umd.edu/centos/5.8/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
wget http://mirror.umd.edu/centos/5.8/os/x86_64/CentOS/yum-utils-1.1.16-21.el5.centos.noarch.rpm
wget http://mirror.umd.edu/centos/5.8/os/x86_64/RPM-GPG-KEY-CentOS-5
# Import the rpm gpg signing key
rpm --import RPM-GPG-KEY-CentOS-5
# Remove the following packages
rpm -e --nodeps redhat-release-5Server
rpm -e yum-rhn-plugin rhn-check rhnsd rhn-setup rhn-client-tools rhncfg rhncfg-client rhncfg-actions subscription-manager
# Force install the five rpm files in the working directory
rpm -Uvh --force *.rpm
# Yum update the system
yum update
# Reboot
shutdown -r now
# To avoid confusion later
sed -i 's/Red Hat Enterprise Linux Server/CentOS Server/g' /boot/grub/grub.conf
cat /etc/redhat-release
uname -i
# Go to working directory
mkdir /root/centos5
cd /root/centos5
# Download the necessary files
wget http://mirror.umd.edu/centos/5.8/os/x86_64/CentOS/centos-release-notes-5.8-0.x86_64.rpm
wget http://mirror.umd.edu/centos/5.8/os/x86_64/CentOS/centos-release-5-8.el5.centos.x86_64.rpm
wget http://mirror.umd.edu/centos/5.8/os/x86_64/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm
wget http://mirror.umd.edu/centos/5.8/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
wget http://mirror.umd.edu/centos/5.8/os/x86_64/CentOS/yum-utils-1.1.16-21.el5.centos.noarch.rpm
wget http://mirror.umd.edu/centos/5.8/os/x86_64/RPM-GPG-KEY-CentOS-5
# Import the rpm gpg signing key
rpm --import RPM-GPG-KEY-CentOS-5
# Remove the following packages
rpm -e --nodeps redhat-release-5Server
rpm -e yum-rhn-plugin rhn-check rhnsd rhn-setup rhn-client-tools rhncfg rhncfg-client rhncfg-actions subscription-manager
# Force install the five rpm files in the working directory
rpm -Uvh --force *.rpm
# Yum update the system
yum update
# Reboot
shutdown -r now
# To avoid confusion later
sed -i 's/Red Hat Enterprise Linux Server/CentOS Server/g' /boot/grub/grub.conf
How to convert RHEL6 to CentOS6
# Remove all the yum metadata from the system
yum clean all
# Make a working directory and go there
mkdir /root/centos
cd /root/centos/
# Check the version and architecture of RHEL
# currently installed
cat /etc/redhat-release
uname -i
# Download the following 4 RPM files and 1 RPM-GPG-KEY file
# from http://mirror.umd.edu/centos/{VER}/os/{ARCH}/
# In this example, we are converting RHEL 6.1 x86_64. We will
# use the latest available version of the following packages.
wget http://mirror.umd.edu/centos/6.2/os/x86_64/Packages/centos-release-6-2.el6.centos.7.x86_64.rpm
wget http://mirror.umd.edu/centos/6.2/os/x86_64/Packages/yum-3.2.29-22.el6.centos.noarch.rpm
wget http://mirror.umd.edu/centos/6.2/os/x86_64/Packages/yum-utils-1.1.30-10.el6.noarch.rpm
wget http://mirror.umd.edu/centos/6.2/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-10.el6.noarch.rpm
wget http://mirror.umd.edu/centos/6.2/os/x86_64/RPM-GPG-KEY-CentOS-6
# Import the GPG signing key
rpm --import RPM-GPG-KEY-CentOS-6
# Remove the following RPMS from the system
rpm -e --nodeps redhat-release-server
rpm -e yum-rhn-plugin rhn-check rhnsd rhn-setup rhn-setup-gnome
# If the second rpm command fails because a package is not installed,
# remove the name of that package from
# the command line and re-run the command.
# Force install all 4 RPMS in the working directory
rpm -Uvh --force *.rpm
# Do a yum upgrade. It should go to a CentOS download site and ask
# to upgrade a lot of packages
yum upgrade
# Reboot the system
shutdown -r now
yum clean all
# Make a working directory and go there
mkdir /root/centos
cd /root/centos/
# Check the version and architecture of RHEL
# currently installed
cat /etc/redhat-release
uname -i
# Download the following 4 RPM files and 1 RPM-GPG-KEY file
# from http://mirror.umd.edu/centos/{VER}/os/{ARCH}/
# In this example, we are converting RHEL 6.1 x86_64. We will
# use the latest available version of the following packages.
wget http://mirror.umd.edu/centos/6.2/os/x86_64/Packages/centos-release-6-2.el6.centos.7.x86_64.rpm
wget http://mirror.umd.edu/centos/6.2/os/x86_64/Packages/yum-3.2.29-22.el6.centos.noarch.rpm
wget http://mirror.umd.edu/centos/6.2/os/x86_64/Packages/yum-utils-1.1.30-10.el6.noarch.rpm
wget http://mirror.umd.edu/centos/6.2/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-10.el6.noarch.rpm
wget http://mirror.umd.edu/centos/6.2/os/x86_64/RPM-GPG-KEY-CentOS-6
# Import the GPG signing key
rpm --import RPM-GPG-KEY-CentOS-6
# Remove the following RPMS from the system
rpm -e --nodeps redhat-release-server
rpm -e yum-rhn-plugin rhn-check rhnsd rhn-setup rhn-setup-gnome
# If the second rpm command fails because a package is not installed,
# remove the name of that package from
# the command line and re-run the command.
# Force install all 4 RPMS in the working directory
rpm -Uvh --force *.rpm
# Do a yum upgrade. It should go to a CentOS download site and ask
# to upgrade a lot of packages
yum upgrade
# Reboot the system
shutdown -r now
List all installed perl modules from the command line
perl -MFile::Find=find -MFile::Spec::Functions -Tlw -e 'find { wanted => sub{ print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'
In the above example (which is all on one line),
File::Find and File::Spec::Functions module are used to list all installed modules.
-M option loads the module. It executes use module before executing the script
-T option enables taint checking, which instructs perl to keep track of data from the user and avoid doing anything insecure with it. Here this option is used to avoid taking the current directory name from the @INC variable and listing the available .pm files from the directory recursively.
-l option enables automatic line-ending processing in the output. Print statements will have the new line separator (\n) added at the end of each line.
-w option prints any warning messages.
-e option indicates that the following string is to be interpreted as a perl script (i.e., sequence of commands).
mount: could not find any free loop device
You can see what is being used by a loop device with losetup:
# losetup /dev/loop0
/dev/loop0: [fd06]:234921356 (/linux/isos/backtrack.iso)
It is possible to increase the number of available loop devices. Free
all loop devices, and add a line with the following to
/etc/modprobe.conf:
options loop max_loop=64
(maximum is 256)
Then, do:
rmmod loop && modprobe loop
If you get an error that the module couldn't be removed, you still have loop
devices in use.
Newer kernels (2.6.21 or 2.6.22) use a dynamic allocation of loop devices,
so you will only have to create the filesystem representation of the devices:
for ((i=8;i<64;i++)); do
[ -e /dev/loop$i ] || mknod -m 0600 /dev/loop$i b 7 $i
done
Happy Pi Day!
And don’t forget 6:28pm (Tau Time)!
Future Holidays to look forward to:
- March 14, 2015 = Pi Day (to 4 decimal places)
- April 4, 2016 = Square Root Day
- 6:02am on October 23, 2012 = Mole Day (6:02 10/23)
Swap Your Laptop for an iPad + Linode
Here's an excellent Linux Journal Article which talks about using an iPad with a Bluetooth keyboard, to ssh into a Linux host:
Linux Journal Article: http://www.linuxjournal.com/ content/swap-your-laptop-ipad- linode?page=0,0
The Linux host is a virtualized node in "the cloud":
Linode: http://www.linode.com/
And the SSH client for iPad can be found here:
I've tried this app on my iPad and I think this works a lot better than I thought it would!
IT Certification Master
I found a new site with lots of IT Certification infomation. It's new, but it looks like a really good start. Check it out here: http://www.itcertificationmaster.com/
Scripting: Is today the last day of the month?
Here's an easy way to check. Very useful when scripting an action (like a backup for example) that needs to happen on the last day of the month.
[ `date --date='next day' +'%B'` == `date +'%B'` ] || echo 'end of month' && echo 'not end of month'
Does MCSA equate to MCITP: Server Administrator and does MCSE equate to MCITP: Enterprise Administrator?
According to Microsoft:
Q. Does MCSA equate to MCITP: Server Administrator and does MCSE equate to MCITP: Enterprise Administrator?
Q. Does MCSA equate to MCITP: Server Administrator and does MCSE equate to MCITP: Enterprise Administrator?
A.
No,
not exactly. The MCITP on Windows Server 2008 certification requires a
new skill set—in some cases, a more robust one—that differs from the
skill set needed for MCSA and MCSE certifications.- MCITP: Server Administrator certification covers more operations-related job skills than the MCSA certification.
- MCITP: Enterprise Administrator maps to an actual job role profile, whereas the MCSE certification does not. The latter combines technology and job skills.
How do I get RHN Satellite Server on RHEL6.2 to authenticate to MS Active Directory on a host with Centrify installed?
My Server has:
Red Hat Enterprise Linux Server 6.2
Red Hat Network Satellite Server 5.4.1
CentrifyDC 5.0.1-177
1. Edit the rhn.conf file:
echo "pam_auth_service = password-auth" >> /etc/rhn/rhn.conf
2. Restart the Satellite Server:
/usr/sbin/rhn-satellite restart
3. Login to your RHN Satellite web gui
4. Create a new user, as in the following example:
Go to "Users" tab -> "Create New User" ->
Desired Login*: centrifyuserid
Desired Password *: Keep Blank
Confirm Password *: Keep Blank
Pluggable Authentication Modules (PAM): Enable Checkbox
Pass Firstname , Lastname & email -> click on "Create Login"
Your user should now be able to login with their AD credentials.
You will still need to specify what permissions they have in
RHN Satellite.
Migrating from RHEL6 to CentOS6...
Why would anyone ever want to do this???
mkdir TMP yum remove rhnlib abrt-plugin-bugzilla redhat-release-notes* rpm -e --nodeps redhat-release redhat-indexhtml cd TMP wget http://mirror.centos.org/centos/6/os/x86_64/Pack\ ages/centos-release-6-0.el6.centos.5.x86_64.rpm wget http://mirror.centos.org/centos/6/os/x86_64/Pack\ ages/centos-indexhtml-6-1.el6.centos.noarch.rpm wget http://mirror.centos.org/centos/6/os/x86_64/Pack\ ages/yum-3.2.27-14.el6.centos.noarch.rpm wget http://mirror.centos.org/centos/6/os/x86_64/Pack\ ages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm rpm -Uvh *.rpm cd .. rm -rf TMP yum clean all yum upgrade
How to Migrate from RHEL5 to CentOS5...
# cp /etc/redhat-release /etc/redhat-release-saved # rpm -e --nodeps redhat-release-notes redhat-release \ yum-rhn-plugin redhat-logos # rpm -ivh \ http://mirror.centos.org/centos/5/os/i386/\ CentOS/centos-release-5-5.el5.centos.1.i386.rpm \ http://mirror.centos.org/centos/5/os/i386/\ CentOS/centos-release-notes-5.5-0.i386.rpm \ http://mirror.centos.org/centos/5/os/i386/\ CentOS/redhat-logos-4.9.99-11.el5.centos.noarch.rpm # yum update
How to make a RHEL Auto-Install DVD
This is how I make a bootable Red Hat Enterprise Linux installation DVD, that includes a customized kickstart file. Installation is automatic and no questions are asked.
Make a directory called ./dvd/
Loop mount the ISO image of the DVD and copy all of its contents (intact) to ./dvd/
Unmount the ISO image.
The kickstart file is named ks.cfg and is placed in the root directory of the DVD.
In the ks.cfg file:
install
cdrom
poweroff
This specifies cdrom as the installation source and causes the machine to power off when done installing, so we can remove the DVD from the drive.
In the isolinux/isolinux.cfg file:
default linux
prompt 1
timeout 6
display boot.msg
prompt 1
timeout 6
display boot.msg
label linux
kernel vmlinuz
append initrd=initrd.img method=cdrom ks=cdrom:/ks.cfg
kernel vmlinuz
append initrd=initrd.img method=cdrom ks=cdrom:/ks.cfg
Change the timeout to something quicker. The default statement specifies which menu option is selected automatically. In the menu option, we specify cdrom as the installation method, and the location and name of the kickstart file (which has to be named ks.cfg).
Create the new ISO file from the contents of the ./dvd/ directory:
/usr/bin/mkisofs -o dvd.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T ./dvd/
The -o option lets you name the ISO image file anything you want.
Copy the resulting dvd.iso file to your PC and burn it to a DVD.
Subscribe to:
Posts (Atom)