Archive for the ‘Operating Systems’ Category.

mdadm Linux software Raid raidhotadd

I’m sure there used to be a thing called raidhotadd, anyway these days it seems to be mdadm. We have a few machines with software raid, and very occasionally a md device flags a disk as dead but adding it back into the array fixes the problem.

Anyway, I never remember this, so to remove and then re-add a disk from a md device do the following:


[root@host ~]# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdb1[1] sda1[0]
104320 blocks [2/2] [UU]

md0 : active raid1 sdc1[0] sdd1[2](F)
143371968 blocks [2/1] [U_]

md2 : active raid1 sdb2[1] sda2[0]
71577536 blocks [2/2] [UU]

unused devices:
[root@host ~]# fdisk -l /dev/sdd

Disk /dev/sdd: 146.8 GB, 146815737856 bytes
255 heads, 63 sectors/track, 17849 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdd1 * 1 17849 143372061 fd Linux raid autodetect
[root@host ~]# mdadm /dev/md0 --remove /dev/sdd1
mdadm: hot removed /dev/sdd1
[root@host ~]# mdadm /dev/md0 --add /dev/sdd1
mdadm: re-added /dev/sdd1
[root@host ~]# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdb1[1] sda1[0]
104320 blocks [2/2] [UU]

md0 : active raid1 sdd1[2] sdc1[0]
143371968 blocks [2/1] [U_]
[>....................] recovery = 0.2% (297280/143371968) finish=32.0min speed=74320K/sec

md2 : active raid1 sdb2[1] sda2[0]
71577536 blocks [2/2] [UU]

unused devices:
[root@host ~]#

And there we can see from /proc/mdstat that the md device will be synchronised and happy again soon.

CentOS 4.x and OMSA 6.1 – Update breaks IPMI

Just recently I upgraded a Centos 4 machine which broke OMSA, this post helped me fix it.

Solaris Ping

I never remember how to make Solaris ping show the time of each ping, like GNU Ping does, without any arguments the output is like:

% ping foo
foo is alive
%

If you want to see the time of each ping, use -s which makes it more like the GNU Ping you find on linux:

% ping -s foo
PING foo: 56 data bytes
64 bytes from foo.somedomain.com (10.44.101.16): icmp_seq=0. time=0. ms
64 bytes from foo.somedomain.com (10.44.101.16): icmp_seq=1. time=0. ms
^C
----foo PING Statistics----
2 packets transmitted, 2 packets received, 0% packet loss
round-trip (ms)  min/avg/max = 0/0/0
%

That is all.

djbdns, daemontools and ucspi-tcp RPMS

Every so often I need a copy of one or all of these on a new machine. I tend to normally use RPM based distros and always have issues trying to find RPMS of these packages. As a result I’ve packaged them up and put them in my svn repo.

Feel free to checkout that directory, it includes a readme of how to build them for a system I’ve yet to need them on. replace the fc7 or el5 with something appropriate for your distribution.

Direct download links:

Redhat/Centos 5:

Fedora 7:

Disable Caps Lock in Windows

Nice little reg hack to dsiable the Caps lock key in windows here.

VMware any-any patch

I’ve had troubles with vmware on redhat/fedora in the past. (See here or here) But I’ve now found a one stop solution to putting VMware on all things RedHat or Fedora. Follow the instructions in this VMware forum post. This has worked for me with VMware Server on Fedora 6 and 7 and also VMware Workstation 6 on Fedora 7. Thanks Petr!

Solaris 10 restarting services

To restart things run:

# svcadm restart ssh

To list the currently known svcs use:

# svcs

Sun have a nice guide here on their BigAdmin site.

Changing IP address on Solaris 10

I’ve recently been caught out whilst trying to change the IP on a Solaris 10 machine. It used to be the /etc/hostname.pcn0 (or whatever type of interface it was) had o match the entry in /etc/hosts. Now it seems this isn’t the only place you need to make the change, you also need to change the IP in /etc/inet/ipnodes as-well, which is the same format as /etc/hosts

SELinux tit bits

I’ve just discovered you can switch selinux into Permissive mode whilst the machine is running
This shows that we are currently enforcing:

# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 21
Policy from config file:        targeted

To switch into permissive mood:

# setenforce Permissive

And another sestatus shows the change

# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   permissive
Mode from config file:          enforcing
Policy version:                 21
Policy from config file:        targeted

vt1211 module for Centos or RedHat Enterprise 5

I’ve a couple of machines running Centos 5 on Via Epia motherboards.

Sadly kernel versions up to and including 2.6.18 dont ship with the required vt1211 kernel module. This means that both Centos and Redhat Enterprise 5 lack the module required to gather sensors data. Because it is a bit of a chore to patch the kernel source and compile the driver any I compile I’ll keep here.

i686 Kernels

Documenting the use of this module is beyond the scope of this post, for information regarding that please see the home page for lm_sensors.

Many thanks to Lars Ekman for writing and maintaining this module!