Split OpenAFS volumes in version 1.4.x

I had to split the volumes on my server, in order to ease the management. In the OpenAFS 1.5.x branch, the volume server has a vos split command, which is not available for 1.4.x installations. Moving the dat arraound is not an option, since it does not preserves the ACL data. I came up with the following script:

It has certain drawbacks, like it’s not a move command but a copy, because it’s based in the AFS up command, so it requires you to have enough free space on the partition. It is also required to use the full path of the directory to split like /afs/cell/somefolder/dirtosplit. Besides that, it helped me to automate the splitting of several huge volumes.

You can check the help with the -h option, and you can test that all variables are properly set before executing using the -t option.


Continue reading

Fix the device path for a SCSI device with multiple HBA adapters

I was installing Bacula on my server, and I got the following problem: Because I have several SCSI adapters, something changed the enumeration order of the adapters, causing the SCSI devices to be enumerated in a different order. Now, for hard drives it is mostly a non-issue, as the uuid and LVM take care of mounting the correct partition on the right place. The exception to this is during boot, but that can be solved one way or another.

However, the situation is different for tape drives (and my autochanger). The change in order moved the generic SCSI device number, and swapped the number of both my tape drives. So it ended up in Bacula that the autochanger was not the autochanger, the tape drive of the autoloader was not the one in the changer, and the comands where sent to all the wrong devices. Besides changing the reference, I wanted to avoid this from happening again.
Continue reading