Monthly Archives: November 2012

md raid on Debian – setting timeout before assembling an array

I have one pretty old Debian Squeeze Linux server with SCSI and SATA drives. Root partition is mirrored between them using mdraid. The problem was that after reboot array always was in “degraded” state with only ATA disk in it.

Of course it was possible to manually re-add SCSI drive using “mdadm -a” command aft, but it was causing RAID rebuild process (and a lot of I/O next ~30 minutes). So, i decided to find a cause.¬† After analyzing dmesg it was found that “/dev/sda” (SATA) is appearing on 3rd second and “/dev/sdb” -on ~15, after slow initialization of SCSI controller. The problem is that mdadm is trying to assemble RAID before sdb is available and ready. After finding the reason fix was trivial:

  1. I copied /usr/share/initramfs-tools/scripts/local-top/mdadm script to the /etc/initramfs-tools/scripts/local-top directory.
  2. In /etc/initramfs-tools/scripts/local-top/mdadm file, after line:
    verbose && log_begin_msg "Assembling all MD arrays"
    sleep 15
  3. Run “update-initramfs -u” and reboot.

After reboot array was in consistent state, so problem is resolved.

Tagged , , ,

Reading codes from RSA SecureID token

Why do I need this?

To access my VPN i need to use code from RSA Secure ID token. Sometime VPN disconnects and i need to enter token  again and again. It is annoying. Also i am afraid that once i will lost my token and it will take a lot of time to restore it.

So i decided to automate the process. There is no USB port on this token type, so only way to read digits is to “scan” LCD. I decided to do this with my old Logitech Webcam C200. This article shows how to do this. To backlight token i used IKEA lamp.

I used “cheese” tool to setup camera and token. Make sure that token is highlighted, numbers are big and readable.

Continue reading

Tagged , , , ,