Removing failed disk from array that’s already been physically removed.

No Comments »
I removed a failed drive from a Linux software array, however, the removed disk remained part of the array erroneously. When trying to remove it with mdadm /dev/md0 --remove detatched, I found the disk was stuck with:
~# mdadm /dev/md0 --fail detached --remove detached
mdadm: hot remove failed for 8:33: Device or resource busy"
If this happens, check the details on the array:
~# mdadm -D /dev/md0
/dev/md0:
...
    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1
       2       8       33        2      faulty spare rebuilding
       3       8       49        3      active sync   /dev/sdd1
       4       8       65        4      active sync   /dev/sde1
       6       8       81        5      active sync   /dev/sdf1

       7       8       97        -      spare   /dev/sdg1
As you can see, the removed drive (/dev/sdc) has a partition stuck as “faulty spare rebuilding”.  When  you see this, run:
~# cat /sys/block/md0/md/sync_action
frozen
The ‘sync_action’ is ‘frozen’, which has locked up the drive/partition that’s been removed.  Run the following:
echo check > /sys/block/md0/md/sync_action
After which, when checking RAID details again, you’ll see that the new disk (/dev/sdg1) has automatically been added to the errant array, and the old (no longer present) disk has been removed from it:
~# mdadm -D /dev/md0
/dev/md0:
...
    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1
       7       8       97        2      active sync   /dev/sdg1
       3       8       49        3      active sync   /dev/sdd1
       4       8       65        4      active sync   /dev/sde1
       6       8       81        5      active sync   /dev/sdf1

       2       8       33        -      faulty spare
At this point, you can now remove the errant drive using the following commands
~# mdadm /dev/md0 --fail detached --remove detached
mdadm: hot removed 8:33 from /dev/md0

Opera-Developer working on Fedora 20

No Comments »

Not a huge fan of the new Opera, however I’m able to get the long-awaited Linux version (for which only a .deb package was released) working on Fedora after some hackery. Below is a screenshot of it. I just thought I’d share my slight happiness with the rest of the interwebs 🙂

Opera-Developer running on Fedora 20

Opera-Developer Screenshot


Ubuntu fonts in Fedora

No Comments »

I recently install Fedora 20 on my laptop (I’d been using Arch Linux for the longest, but decided to switch it up for no real reason). I initially installed Mageia, and loved it for what it was — the first linux distro I ever used was a Mandriva iteration — but it’s stability and older set of packages did not meet my needs. Namely, I needed ZFS support (to access a drive I’d used with FreeBSD) along with a few other nuances that the newer F20 system allowed over the Mageia 4 system I was using.

After the move to Fedora, I wanted to use the Ubuntu fonts that I’d grown accustom to while using Arch Linux. It would seem, however, that Fedora does not have an up-to-date package for these fonts in their repo. A quick search at pkgs.org showed that there was an Ubuntu font package in the Russian repo (http://tigro.info/wp/), however it did not include Ubuntu Mono, among others — unless I’m mistaken.

Fortunately, Ubuntu offers a standalone download of their fonts here. Installing the fonts directly was very simple. After downloading and unzipping the zip file, simply move the contents to /usr/share/fonts, and run fc-cache -v.

Afterwards, I was able to use Ubuntu Mono w/Konsole, as I love to do 🙂


Enabling UFS r/w support in Ubuntu 12.04 LTS

No Comments »

Continuing my work with servers running Ubuntu, I’ve come across the issue of needing the ability to write to UFS filesystems via libguestfs. I was doing a lot of head-banding against various walls, until I came across this post (thanks a lot Oz Nahum!).

R/W support is *experimental*, you’ve been warned.

First create the build directory and download the source for your kernel:

sudo su -
apt-get build-dep --no-install-recommends linux-image-$(uname -r)
mkdir /usr/local/src/ufs_rw
cd /usr/local/src/ufs_rw
apt-get source linux-image-$(uname -r)
cd linux-3.x.y-z
cp -v /usr/src/linux-headers-3.x.y-z/Module.symvers .
cp -v /boot/config-3.x.y-z .
make EXTRAVERSION=-4 O=/usr/local/src/ufs_rw  oldconfig
sed -i 's/# CONFIG_UFS_FS_WRITE is not set/CONFIG_UFS_FS_WRITE=y/' /usr/local/src/ufs_rw/.config

Continue compiling:

make EXTRAVERSION=-4 O=~/ufs_rw prepare
make EXTRAVERSION=-4 O=~/ufs_rw outputmakefile
make EXTRAVERSION=-4 O=~/ufs_rw archprepare
make EXTRAVERSION=-4 O=~/ufs_rw modules SUBDIRS=scripts
make EXTRAVERSION=-4 O=~/ufs_rw modules SUBDIRS=fs/ufs

You’ll find your module here: /usr/local/src/ufs_rw/linux-[version]/fs/ufs/ufs.ko. From there, you can just copy the file to /lib/modules/3.x.y-z/kernel/fs/ufs — I preferred to rename the original to ‘ufs.ko.ro’ vs. overwriting it.

Now with a modprobe ufs you’ll have UFS support loaded with r/w support!