Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Friday, 6 January 2012

Consistent device links with udev

I have a Linux server that contains several disks used for holding photos, movies, videos and any other general junk myself and my partner dump on there. I've had some hassles with several of the drives and I also have one that is mounted in a caddy so it can be removed and hidden away (important data!).

What I found when things failed or needed to be moved was that having the drives mounted through fstab at boot time could lead to the machine just not starting. So I used automount to get round this problem. So far so good, but if one or more drives are removed the device names they use (/dev/sda /dev/sdb etc) change so my automount maps get screwed up.

After much searching I found some articles and bits and pieces that explained how to get around this issue using udev rules. I just had to re-fix this after an update to CentOS stopped these rules matching properly. Here is the file I use now:

KERNEL=="sd*[1-9]", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u /dev/%P", RESULT=="1ATA_ST31000524AS_9VPCT2B9", SYMLINK+="array0%n"
KERNEL=="sd*[1-9]", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u /dev/%P", RESULT=="1ATA_ST31000524AS_9VPCS7ZT", SYMLINK+="array1%n"
KERNEL=="sd*[1-9]", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u /dev/%P", RESULT=="1ATA_SAMSUNG_HD103SJ_S246J90B653757", SYMLINK+="array2%n"
KERNEL=="sd*[1-9]", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u /dev/%P", RESULT=="1ATA_SAMSUNG_HD103SJ_S246J90B653776", SYMLINK+="array3%n"
KERNEL=="sd*[1-9]", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u /dev/%P", RESULT=="1ATA_WDC_WD20EARS-00MVWB0_WD-WCAZA0998064", SYMLINK+="drives0%n"
KERNEL=="sd*[1-9]", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u /dev/%P", RESULT=="1ATA_ST2000DL003-9VT166_6YD0EPBS", SYMLINK+="drives1%n"

The file is save as /etc/udev/rules.d/25-names.rules and looks for specific devices and creates links like /dev/array01 and /dev/drives11 depending on the ID it finds.

The bit I had to change was using %P for the parent device (/dev/sda1 has /dev/sda as a parent) and "sd*[1-9]" for the pattern to match only the partitions rather than the whole drive. Previously I used %k and a pattern that matched both the drive and partitions which did work before but not after the recent update.

Tuesday, 16 December 2008

Hate Excel 2007!

Was going to have a minor whinge about the DVLA but I'll save that until later, want to rant about Excel 2007 because it's driving me insane!

Here's a list of the things that are REALLY p***ing me off at the moment:

  1. When you copy something to the clipboard, merrily paste it into a sheet, then switch to another to carry on doing the same, it forgets what you had and you have to copy it again! WHY!
  2. If you copy and entire column you have to insert using "Insert Copied Cells" (what would be wrong with an intelligent paste?) and then it forgets what you had copied when you try and do this again! WTF!
  3. If you want to copy a sheet you have to select "Move or Copy ..." from the context menu and then select "Make a copy" and where you want it to be made! OpenOffice does exactly the same and it's just stupid!
  4. What's the deal with all the buttons on the top, why can't I just have the menus I was quite happy with in Excel 2003!
ARRRRRRRGHHHHHHHHH!

Just really frustrating when software makes it so hard to do simple tasks!