Add disk back into a Linux MDADM software raid
I have a finicky disk on my home server that always drops from its RAID5 sofware raid. The good thing for me is this RAID is one I use for low importance, bulk data, like OS ISO's and other stuff I can easily re-download if needed. If you have a disk that keeps dropping from your RAID, I would recommend replacing the disk with one that is not so grumpy, and/or making sure you backups are in good shape.
However, I find that every now and then, usually after a reboot, this grumpy disk will eject itself from my RAID, so I have to re-insert it, and rebuild my array. Here is my "cookbook recipe" that I use to get it back. This post was mostly written for me, since I usually forget what commands I use, so I figured I would dump there for everyone else as well. Lest get started:
First, I need to find out which disk ejected, so run the mdadm command to get the details:
mdadm --detail /dev/md127
You might see something that looks like this:
I then use fdisk to find the disk that went missing:
fdisk -cul
Now that I have found my disk, I can reinsert it into the array and let the rebuild begin:
mdadm --manage /dev/md127 --add /dev/sde1
The disk should be added back to the array, and should now be rebuilding. You can check the status of the rebuild a few different ways. The way I prefer is by watching /proc/mdstat. This command works great:
watch cat /proc/mdstat
You can also get the details by running:
mdadm --detail /dev/md127
There are a couple of ways you can speed up the rebuild process a few different ways. Be sure to check my post on speeding up the rebuild here: Helpful tips to speed up a linux software RAID rebuild
VMWare Player in Fedora 18
If you are having problems with getting VMware Player to install into your Fedora 18 system, take a look at the instructions below to get it installed and running.
First, we need to make sure we have everything up to date on the system and that we are running the most recent kernel. Run the following command:
sudo yum update
After that has finished updating your system, it will be a good idea to reboot to make sure you boot with the most up to date kernel.
Next, we need to make sure we have all the required packages that VMWare needs. We will need to install some of the kernel building packages in the repos, as well as a few other tools for building kernel modules.
sudo yum install kernel-* make gcc gcc-c++
Now, we have everything we need to install VMWare Player. Go to www.vmware.com/go/get-player to download the installer file for system. There are versions available for 32bit and 64 bit systems, so be sure to grab the right one. Once you have the file, you will need to make it executable by doing the following:
chmod 775 VMware-Player-*
Finally, you are ready to run the installer file. Just be sure to sudo the command, as it will need root priveleges to install everything:
sudo ./VMware-Player-*
Then, it's just a matter of following the on-screen prompts of the VMWare installer. If you have any problems or hang-ups, feel free to leave a comment below, and I will to reply with any help!
Teamviewer 8 and Fedora 18
Do you have a problem getting TeamViewer 8 to start at boot time in Fedora 18 and Fedora 17?
The issue comes from TeamViewer improperly placing the necessary SystemD component to have systemd start the service at boot. Its a simple fix! Just follow the commands below to correct!
sudo cp -r /opt/teamviewer8/tv_bin/script/teamviewerd.service /lib/systemd/system/
sudo service teamviewerd start
sudo systemctl enable teamviewerd.service
Stop virt-manager from prompting for password
On a RHEL5, RHEL6 and any other RHEL variant, you might run into the annoying password prompt when you try to run virt-manager as a normal user. Normally, you will see this prompt pop up when you are logged into the Desktop Environment as a normal user, and then try to launch virt-manager from your "Applications --> System Tools" menu, or you might even see it when you run virt-manager from the shell as a normal user.
This is done for good reason, system security. But, when you are the primary workstation user, and you use Virtual Machines on a daily basis, you are like me and probably getting annoyed by entering your sudo or root password when you launch the virt-manager. HAVE NO FEAR! There is a perfectly acceptable way of managing this. We are going to take advantage of PolicyKit to manage what the normal user can run. In this case, we are going to create a policy that allows any user that is a member of the "virtman" group the ability to launch virt-manager without being prompted for authentication. This makes is easy to give this ability to other users of the machine by simply adding them to the virtman group that we will create.
Here we go. Follow these steps to get it setup:
1. Create the virtman group on your machine. You can do this however your comfortable, or you can simply use the command below: (Notice we made the group a system group for cleanliness)
sudo groupadd -r virtman
2. Add whatever users you want to this system group: (in this example we are adding the user JohnDoe to the group virtman)
sudo usermod -a -G virtman JohnDoe
3. Now, we need to create our PolicyKit policy that will allow the users of virtman to run virt-manager. You can do this in a number of ways. The contents of the file will need to include the following:
[Allow group virtman libvirt management permissions]
Identity=unix-group:virtman
Action=org.libvirt.unix.manage
ResultAny=yes
ResultInactive=yes
ResultActive=yes
Paste the above lines into a newly created file at this path: /etc/polkit-1/localauthority/50-local.d/50-org.virtman-libvirt-local-access.pkla
You can use which ever editor you prefer, just so long as you place the file in the path I noted above, and that it has the contents as described.
But, if your like me, feel free to wget a copy of the file that I have hosted on this server. You can grab the file, and place it in the right directory using this command:
sudo wget -P /etc/polkit-1/localauthority/50-local.d/50-org.virtman-libvirt-local-access.pkla http://www.gigahype.com/wp-content/uploads/2012/12/50-org.virtman-libvirt-local-access.pkla
Voila! you are finished! You can test the results by simply starting virt-manager from your applications menu or the command line and it should no longer prompt for password for anyone that is a member of the virtman group!
Bash Navigating Shortcuts
Here are few great shortcuts that will make navigating in BASH a bit easier. This also works in many other shells, as I am often in Korn Shell in our AIX and HP-UX machines.
I learned a few shortcuts a while ago from this website, as well as this one.
These were taking from the “Command Line Editing” in the bash manual. The bash manual is a well-written piece of documentation. It would do all SysAdmins well to read this manual a few times.
Well, here’s the new shortcuts I learned:
Basic moves
- Move back one character.
Ctrl
+b
- Move forward one character.
Ctrl
+f
- Delete current character.
Ctrl
+d
- Delete previous character.
Backspace
- Undo.
Ctrl
+-
Moving faster
- Move to the start of line.
Ctrl
+a
- Move to the end of line.
Ctrl
+e
- Move forward a word.
Meta
+f
(a word contains alphabets and digits, no symbols) - Move backward a word.
Meta
+b
- Clear the screen.
Ctrl
+l
What is Meta? Meta
is your Alt
key, normally. For Mac OSX user, you need to enable it yourself. Open Terminal > Preferences > Settings > Keyboard, and enable Use option as meta key. Meta
key, by convention, is used for operations on word.
Cut and paste (‘Kill and yank’ for old schoolers)
- Cut from cursor to the end of line.
Ctrl
+k
- Cut from cursor to the end of word.
Meta
+d
- Cut from cursor to the start of word.
Meta
+Backspace
- Cut from cursor to previous whitespace.
Ctrl
+w
- Paste the last cut text.
Ctrl
+y
- Loop through and paste previously cut text.
Meta
+y
(use it afterCtrl
+y
) - Loop through and paste the last argument of previous commands.
Meta
+.
Search the command history
- Search as you type.
Ctrl
+r
and type the search term; RepeatCtrl
+r
to loop through results. - Search the last remembered search term.
Ctrl
+r
twice. - End the search at current history entry.
Ctrl
+j
- Cancel the search and restore original line.
Ctrl
+
CodeWeavers Flock The Vote is Live!
CodeWeavers has again launched a Presidential Election Year promotion! This is similar to the Lame Duck promotion that many of you may remember from 2008. This is the campaign that made me aware of CodeWeavers and Crossover, and has since helped me run all kinds of Windows software on my Linux workstations.
I have been a very happy customer of CodeWeavers since 2008, and now I am happy to help them spread the word on this new campaign. Heres the details:
If 100,000 people signup as "pledging to vote" in this years Presedential Election campaign, they will launch a 24 hour give-a-way of their Crossover software for Mac and Linux! All you have to do is enter your email address saying that you will be voting in this years election, and thats it! Once they hit 100,000 people signed up, they will announce when they will be doing the 24 hour give-a-way.
Click on the logo below to be taken to the "Flock The Vote" campaign!
Install VMware Workstation 8 in Fedora 17
When I was attempting to install VMware Workstation 8 on my Fedora 17 64 bit OS. I had a few problems when it tried to compile the virtual network adapters. After a little bit of trouble shooting and searching I realized there was a patch that I needed to apply in order to get the two working together.
As noted below from a commenter named Adam, this method also works with VMWare workstation 8.0.4. Thanks Adam!
Heres the steps:
First, we need to make sure we have all the dependancies installed before proceeding, so run the following command:
yum install gcc kernel-devel kernel-headers
Then, download VMware Workstation from http://www.vmware.com Once you have it downloaded, run the installer script that you downloaded. This will build Workstation in your OS. It will also inject a fwe more menu items. This is where I had my problems. When I tried to launch Workstsation, it would complain about not being able to compile a few of the modules it needed for the current kernel. To solve this problem, you will need to patch a few files. Diasnet from FedoraForums.org has built a very handy patch for us!
Download the patch here: patch-vmware803.tar
Once you have the tar downloaded, extract it to any directory ( /tmp is fine) and run the patch using this command:
./patch-modules_3.4.0.sh
After the patch has finished running, you should be able to launch VMware Workstation from your menu, and begin using it.
If you would like to read up more on the post over at FedoraForum.org, follow this link: http://forums.fedoraforum.org/showthread.php?p=1581288
Install Citrix Receiver in Fedora 17
Recently, I switched to Fedora 17 as my main workstation. I routinely use Citrix applications, and needed to install Citrix Receiver. I found there were some problems, mainly with dependancies, when trying to install it.
Heres what you need to do to get it installed.
First, you will need to add the RPMFusion Free and Non-Free repos in order to pickup the dependancies. Go Here to get the .repos for your version: http://rpmfusion.org/Configuration
Then, we need to install a few dependancies. Citrix Receiver is a 32 bit application, so you will need to install .i686 libraries if you are running it on a 64 bit OS. Here's the command we will need to use:
For 64 bit systems:
yum install libXaw.i686 libXp.i686 openmotif.i686
For 32 bit systems:
yum install libXaw libXp openmotif
After you have those installed, goto http://citrix.com and download the latest version of the Citrix Receiver application. Once you have it downloaded, install it using yum or rpm commands. This should be all you need in order to get it up and running!
Install Cinnamon in Fedora 17 and Fedora 16
If you are looking for an easy way to install Cinnamon on your Fedora 16 or Fedora 17 machine, your adventure just got easier!
Thanks to a FedoraForums.org user, Leigh123linux, its now as simple as adding his repo and yum installing two packages!
Heres a quick rundown of what you do:
First, you will need to add the repo to your /etc/yum.repos.d directory. Theres several ways to do this:
You can download the repo file from the link below by right-clicking, choosing "Save Link As" and saving it into your /etc/yum.repos.d directory.
http://repos.fedorapeople.org/repos/leigh123linux/cinnamon/fedora-cinnamon.repo
Or, if you prefer to do things from the comman line, you can run the following command from terminal and it will create the repo file in the proper directory
sudo curl http://repos.fedorapeople.org/repos/leigh123linux/cinnamon/fedora-cinnamon.repo -o /etc/yum.repos.d/fedora-cinnamon.repo
Once you have the repo file, all thats left to do is install 2 packages. The first is a package called muffin, that supports GPU acceleration and works as the compositor for Cinnamon. You can install both of these by running the following command:
sudo yum install muffin cinnamon
Now that you have Cinnamon installed, you will just need to log out of Gnome 3. When you log back in, be sure to switch the session to GNOME Cinnamon in order to load the new Desktop Environment.
I will include some screen shots below if you would like to see what Cinnamon looks like in Fedora 17.