0

Reset root password on RHEL/CentOS 7

much have changed since 4/5/6 days since RHEL/CentOS7 uses grub2 to boot. root password recovery is now very different than before. start/reboot the system and on the GRUB2 boot screen press the e key for edit. scroll down to the linux* line (could be linux/linux16/linuxefi) and remove rhgb and quiet and add init=/bin/sh to the end of the line. For some virtual hosts you might have to use rb.break instead of init=/bin/sh. Press CTRL-X to boot the system and it a shell prompt will be presented. Once booted the / filesystem will be in read only mode please issue mount… Continue Reading

0

mount qcow2 with libguestfs

sometimes you have multiple qcow2 files sitting around from older upgrades and OS’s that you just need to grab a file or a config from and dont want to bother with booting it up. there is a way to mount the filesystem using libguestfs which can save time! This works with LVM and non LVM qcow2 files and also even if you dont know how the qcow2 partitions are laid out you can feed it a bogus partition and it will list it for you. # guestmount -a rhel5.qcow2 -m /dev/sdzz1 /mnt libguestfs: error: mount_options: mount_options_stub: /dev/sdzz1: No such file… Continue Reading

0

VirtualBox – how to create and share disks to setup/test clusters

Once in a while you will want to setup clusters with shared disks to test and play around with various clusters. while this is easy to do in kvm/xen/etc its not so easy with virtualbox. There is a way via command line tools to create disks and attaching it so that it is shared. For me I have windows 7 64bit and I am running virtualbox 64bit 4.xxxxx. It is most likely easier if you include the path for “c:Program FilesOracleVirtualBox” however if you do not its ok. We will need to run the command VBoxManage or “c:Program FilesOracleVirtualBoxVBoxManage.exe” if… Continue Reading

0

cleaning old kernels the easy way

There is a built in tool to remove old unused kernels thats installed onto the system. You can just as easily remove it and clean grub entries but this is an automated method and you can even set an option to keep x amounts. step 1 – install the yum utils package yum install yum-utils step 2 – run the package-cleanup to clean up old kernels package-cleanup –oldkernels –count=2 step 3 – if you want to set it so that you only keep X number of revisions on your system then edit /etc/yum.conf and add the following installonly_limit=2 enjoy!

0

is it safe to use epel and rpmforge at the same time ?

There are many repositories that you can add onto your RHEL/CENTOS/FEDORA OS to install additional software. full list of repos can be found here http://wiki.centos.org/AdditionalResources/Repositories however is it safe to just add the repos and start installing packages? yes and no. We will configure priorities to setup the repos to keep packages from conflicting. Also you will want to protect the base OS installation so that there is less corruption/conflicts later on. step 1 – install the plugin if its not installed already yum install -y yum-plugin-priorities yum-plugin-protectbase step 2 – setup priorities for *-Base.repo that came with your OS… Continue Reading

0

Samba as a Primary Domain Controller on Centos/RHEL

I wanted to setup a PDC via samba for my home network since I am wanting a common login onto all of the machines at home and also since I already share files via samba why not just add this. This is a very novice basic setup of PDC. Several items are needed espcially host entries/dns records to make this work. lets assume several items Domain : testdomain.local PDC Hostname : pdc PDC IP : 192.168.1.1 User : thisisyou Client Hostname : testdesktop 1. Install Samba. yum groupinstall “CIFS file server” or yum install samba 2. Network testing from your… Continue Reading

0

How to rollback YUM UPDATES

Once in a while you might have problems after running “yum update.” There is an intermediate solution by rollback feature included in YUM. THIS OPTION IS NOT ENABLED BY DEFAULT. 1. To enable rollback edit /etc/yum.conf and add tsflags=repackage 2. Add the following line into /etc/rpm/macros file if it doesn’t exist and add %_repackage_all_erasures 1 now you are all set and can use the following examples to rollback rpm -Uvh –rollback ’22:00′ rpm -Uvh –rollback ‘3 hours ago’ rpm -Uvh –rollback ‘june 13’ rpm -Uvh –rollback ‘yesterday’ All previous repackaged software will be stored onto /var/spool/repackage

0

Dell OMSA 101 – mirroring and bootstraping

If you have a environment that has a lot of dell servers and want to get storage and chassis information OMSA is the way to do it. If your machines have access to the internet you can easily download it from linux.dell.com and install it however if you have a good number of servers and/or do not have access to the internet via your servers you will most likely want to mirror the repository so that you can install it from your trusted host. In this post we will assume that we have a trusted host that has access to… Continue Reading

0

Prevent yum from updating RHEL to a new release

Sometimes you will run into a scenario where you need to keep an OS at certain version due to vendor support. Such as EMC/IBM SAN powerpath etc.. You might also want to remain at a certain version due to change management policies. In this example I like to use yum to keep my RHEL guest current with security and bug fixes. The problem I ran into is that Red Hat has released a new minor version of it’s Enterprise Linux 5.x, and so yum wants to update to it. Well have no fear, as there is one line you need… Continue Reading