Linux Redhat: How to resize a LUN device resized storage side


A storage guy told us about a resize he did on a LUN already mapped and used from a baremetal RHEL system. That system had a 5TB lun mapped from HUAWEI storage, the Linux device was /dev/mapper/mpatha. The storage guy resized that LUN from 5TB to 10TB and asked us how to increase the filesystem size. In my opinion I prefer to add new LUNS instead of directly resizing an existing one, anyway I looked some Redhat documentation and I found the commands. I was a bit excited because it was long time I did not see a baremetal Linux!! Following the procedure for RHEL 7:

1) Let’s identify which device we are talkin about
# multipath -ll ( in my case I saw mpatha mapped on 4 paths, sdb – sdc – sdd – sde

2) Let’s scan each path
# for i in sdb sdc sdd sde; do echo 1 > /sys/block/$i/device/rescan; done

3) Let’s check the new dimension of the paths
# dmesg -T

4) Let’s resize the LUN ( in my case the device was /dev/mapper/mpatha )
# multipathd resize map mpatha

5) Let’s check the size of the multipath device
# multipath -ll

6) Let’s resize the physical volume
# pvresize /dev/mapper/mpatha

7) Let’s verify the new space
#pvs
#vgs

8) Let’s look for the mounted filesystem to resize
# df -h | grep filesystem_name

9) Resize LVM + filesystem ( be careful to the options!! )
# lvresize -r -l +100%free LVM

That’s all! 😀

Fedora installation on my new laptop!


Two days ago I received a new laptop from Extraordy.
It’s a DELL Inspiron 7386 with a valid processor,memory and nvme disk.

I initially was not able to install Fedora because the system did not see the disk. Looking to the BIOS/UEFI I changed a SATA parameter, from RAID to AHCI.
The boot after I succesfully installed Fedora.
This is how actually the system recognizes the disk:

[root@asuka ~]# fdisk -l
Disk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 326AD1E9-8032-4E34-B4F3-3FA0CF174EE7

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 411647 409600 200M EFI System
/dev/nvme0n1p2 411648 2508799 2097152 1G Linux filesystem
/dev/nvme0n1p3 2508800 499017727 496508928 236.8G Linux LVM

Linux Redhat 7: How to clear boot directory


Recently I noticed that multiple Vmware Linux templates had /boot filesystem used more than 90%
If you look on the web u will find a lot of solutions based just on removing kernel rpms. I disagree !
I began to clear the /boot directory removing the oldest kernels but this was not enough.

At this point you must go to /boot directory and look for rescue files:

# ls | grep rescue

initramfs-0-rescue-b20d7fe5b15140269ad2c2e51af4735e.img

vmlinuz-0-rescue-b20d7fe5b15140269ad2c2e51af4735e

initramfs-0-rescue-80405299bcbc4ebabf5827a44c193.img

vmlinuz-0-rescue-80405299bcbc4ebabf5827a44c193

initramfs-0-rescue-d58aadc169974f0ea93d637c046d764b.img

vmlinuz-0-rescue-d58aadc169974f0ea93d637c046d764b

Each rescue file does not belong to any rpm package, so you can manually delete the oldest pair files. In order I suggest you to follow this actions:

1) Look for a single rescue pair. If you want to know which kernel does belong to, you can run lsinitrd initram-0-rescue-
2) Try to boot the system using the rescue from the previous point
3) If everything worked fine, you can boot with the latest kernel and delete each old pairs rescue files.
4) Lastly, update the GRUB2 configuration:  grub2-mkconfig -o /boot/grub2/grub.cfg

Thank to Paolo Fruci and Marco Simonetti for helping me dealing with this issue, we played together 🙂

Linux Redhat 6.10 released!!


Two days ago RHEL 6.10 was officially released.
Reading from the web I see new interesting features:

“This release also includes a Red Hat Enterprise Linux 6.10 base image
to help enterprises more easily migrate Red Hat Enterprise Linux 6
workloads into container-based applications. These cloud-native
workloads can then be deployed and maintained on a more modern
platform, including Red Hat Enterprise Linux 7, Red Hat Enterprise
Linux Atomic Host, and Red Hat OpenShift Container Platform.

To make it easier for customers to plan their migration to Red Hat
Enterprise Linux 7, Red Hat Enterprise Linux 6.10 provides updates to
the Pre-upgrade Assistant, Red Hat Upgrade Tool, and the accompanying
documentation. Learn more about the upgrade process and how to access”

I never migrated before a major RHEL release, can’t wait to play with 🙂

Got Certified!!!


I passed the exam Redhat EX318!
Now I’m certified on RHEV as “RHCVA” – Redhat Certified Virtualization Administrator.
I have to thank a couple of friends: Giovanni Mancuso and Davide Giannlivigni, they helped me studying for the exam ( I did not take the course )

Thank you both!!!
😀

Redhat: How can I check virtualization prerequisites?


Playing with virt commands, I found virt-host-validate .

It is very useful! If I run it from a virtual machine without nested virtualization enabled, I will have:

# virt-host-validate
QEMU: Checking for hardware virtualization : FAIL (Only emulated CPUs are available, performance will be significantly limited)
QEMU: Checking if device /dev/vhost-net exists : PASS
QEMU: Checking if device /dev/net/tun exists : PASS
QEMU: Checking for cgroup ‘memory’ controller support : PASS
QEMU: Checking for cgroup ‘memory’ controller mount-point : PASS
QEMU: Checking for cgroup ‘cpu’ controller support : PASS
QEMU: Checking for cgroup ‘cpu’ controller mount-point : PASS
QEMU: Checking for cgroup ‘cpuacct’ controller support : PASS
QEMU: Checking for cgroup ‘cpuacct’ controller mount-point : PASS
QEMU: Checking for cgroup ‘cpuset’ controller support : PASS
QEMU: Checking for cgroup ‘cpuset’ controller mount-point : PASS
QEMU: Checking for cgroup ‘devices’ controller support : PASS
QEMU: Checking for cgroup ‘devices’ controller mount-point : PASS
QEMU: Checking for cgroup ‘blkio’ controller support : PASS
QEMU: Checking for cgroup ‘blkio’ controller mount-point : PASS
QEMU: Checking for device assignment IOMMU support : WARN (Unknown if this platform has IOMMU support)
LXC: Checking for Linux >= 2.6.26 : PASS
LXC: Checking for namespace ipc : PASS
LXC: Checking for namespace mnt : PASS
LXC: Checking for namespace pid : PASS
LXC: Checking for namespace uts : PASS
LXC: Checking for namespace net : PASS
LXC: Checking for namespace user : PASS
LXC: Checking for cgroup ‘memory’ controller support : PASS
LXC: Checking for cgroup ‘memory’ controller mount-point : PASS
LXC: Checking for cgroup ‘cpu’ controller support : PASS
LXC: Checking for cgroup ‘cpu’ controller mount-point : PASS
LXC: Checking for cgroup ‘cpuacct’ controller support : PASS
LXC: Checking for cgroup ‘cpuacct’ controller mount-point : PASS
LXC: Checking for cgroup ‘cpuset’ controller support : PASS
LXC: Checking for cgroup ‘cpuset’ controller mount-point : PASS
LXC: Checking for cgroup ‘devices’ controller support : PASS
LXC: Checking for cgroup ‘devices’ controller mount-point : PASS
LXC: Checking for cgroup ‘blkio’ controller support : PASS
LXC: Checking for cgroup ‘blkio’ controller mount-point : PASS

Opensource day 2016!!


Yesterday I have been with colleagues at OpenSource Day in Rome!
It was first time for me and I was so funny following Redhat Speech, Labs and much more.
I also saw old and ex colleagues.
I took some picture:

Rome, Palazzo dei congressi

Me

Colleagues