Where is my software RAID?!

There are a few different ways to view RAID information on Fedora. Here are two commands that can help.

1. Print Mdadm config

You can copy and past the following command to print the mdadm configuration.

cat /etc/mdadm.conf

It should return something similar to the following.

$ cat /etc/mdadm.conf
# mdadm.conf written out by anacondaMAILADDR root
AUTO +imsm +1.x -all
ARRAY /dev/md/Boot level=raid0 num-devices=6 UUID=21ce258a:015d0dd4:90d5b80e:ab04b7f7
ARRAY /dev/md/Root level=raid0 num-devices=6 UUID=4be32ad0:f3aa77bd:139d749d:4a6aab60 

We see from the above output that we have two raid arrays. Both RAID 0 over 6 drives.

2. Print mdstats

You can show the mdstats by running

cat /proc/mdstat

Should get output similar to the following.

$ cat /proc/mdstat
 Personalities : [raid0]
 md126 : active raid0 sdc2[0] sdf2[5] sde2[4] sdd2[1] sda2[2] sdb2[3]
       5856552960 blocks super 1.2 512k chunks
 md127 : active raid0 sdc1[0] sdf1[5] sde1[4] sdd1[1] sdb1[3] sda1[2]
       3133440 blocks super 1.2 512k chunks
 unused devices: 

This shows us the RAID size. About 5TB on one and 3GB on the other. The 3GB is used for the boot partition.

Other Notes

Apparently there is a difference between “mdadm” and “dm-raid”
Mdadm is for managing and creating software raids, while dm-raid interacts if a device like a laptop has a “fake RAID”

https://superuser.com/questions/721795/how-fake-raid-communicates-with-operating-systemlinux/721796#721796
https://stackoverflow.com/questions/23164384/what-is-the-difference-between-dm-and-md-in-linux-kernel

For more information on managing RAID with Mdadm, you can refer here.

Repairing Fedora grub from chroot

Notes from repairing a Fedora drive.

Mount system in chroot.

If the system is a raid drive and your not able to access it refer to this post.  May just need to install the raid utilities.

For mounting the chroot environment refer to this post

Repairing grub

yum install grub2-efi-*

Install grub.  Change /sda to your drive, may need to specify the efi partition.

grub2-install /dev/sda

If your boot and efi partitions are mounted.

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Reboot.

DNF/YUM not working in chroot environment

The reason is probably because the chrooted environment can’t resolve DNS.

Test it with

ping incredigeek.com

If it is not resolving, edit “/etc/resolv.conf” and change/add your nameserver.  Or just replace everything in it with

echo "nameserver 4.2.2.2" > /etc/resolv.conf

It should now be able to resolve and you should be able to use yum, or dnf.

yum update

RAID Volume not accessible in Linux

Typically your RAID volumes will show up as /dev/mdXXX

If it is not, it could be because the device mapper module is not loaded.  Load it by running the following command.

modprobe dm-mod

As a side note you can list the block devices using

dmraid -b

https://bbs.archlinux.org/viewtopic.php?id=42321

If your still having trouble you can try installing mdadm and dmraid

apt-get install -y dmraid mdadm

 

semanage Allow and Delete ports in CentOS

The commands are for CentOS, but should work on Fedora and RedHat.

If semanage is not installed refer to here.

You would typically use this along with the systems firewall to allow a port through.  Guide for firewalld and iptables.  If you change it in the firewall and fail to add/edit it in semanage you can potentially get weird behavior like sshd not wanting to start after changing the port.

Add port

semanage port -a -t ssh_port_t -p tcp 2222

The above command allows the sshd service to start, using port 2222.

List allowed ports

semanage port -l

You can use grep to filter the results

Example:

[admin@localhost ~]# semanage port -l | grep ssh
ssh_port_t tcp 2222, 22
[admin@localhost ~]#

Delete port

semanage port -d -p tcp 2222

Other examples

Allow SNMP

semanage port -a -t snmp_port_t -p udp 161

 

How to install Broadcom WiFi drivers in Fedora 27

Install RPM Fusion

sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Install packages

sudo dnf install -y kernel-devel-$(uname -r)
sudo dnf install -y akmodssudo dnf install -y broadcom-wl

Give the computer a reboot and the Broadcom card should now work.