Archive

Archive for June, 2009

Adding SAN disk without rebooting

June 23rd, 2009 2 comments

The production system is running, the database filesystem is almost full. We need more disk space on the server. The server is attached to the San so we can add disk without bringing down the server. In this article, we will demonstrate what is needed to make the new San disk available to the server without disturbing the running application. Although that theses commands have been tested and used on production environment,  I suggest that you build your confidence first, by trying them on a development system.

On Red Hat / Centos 5

In our example, we have presently one disk accessible via one fiber HBA on our server. We can use to “lsscsi” command to list our scsi device. If you do not have the command ‘lsscsi’ command installed, you can install it by issuing the following command “yum install lsscsi”.

Our server can see one disk at the moment ;

#  lsscsi
[0:0:0:0]    disk    HITACHI  OPEN-V           5009   /dev/sda

Let rescan our SCSI bus. Since we have only one fiber card in our server, we will scan only the first HBA (host0). If you have two fiber card, you may need to issue the “partprobe” command for the disk to be seen on the second interface.

# echo "1" > /sys/class/fc_host/host0/issue_lip

We now see the new SAN disk that was newly allocated to the system.

# lsscsi
[0:0:0:0]    disk    HITACHI  OPEN-V           5009   /dev/sda
[0:0:0:1]    disk    HITACHI  OPEN-V           5009   /dev/sdb

For other kind of SCSI attached storage, we should rescan the bus with this command :

# echo "- - -" > /sys/class/scsi_host/host0/scan   (First hba)
# echo "- - -" > /sys/class/scsi_host/host1/scan   (Second hba, if present)

Read more…

Categories: Storage

Creating a PDF printer

When I decided to move to Linux on my desktop, I tried to reproduce the same functionality that I was having under windows. One of the program I was using under Windows was PDF-Factory , it actually create a PDF printer. When ever I wanted to produced a PDF, I only had to print to that PDF printer. After some research, I found “cups-pdf”, this utility allow me to have the same functionality under Linux. In this article, I installed the product under RHEL5, but installing it on other version of Linux is very similar.

Once downloaded, installing cups-pdf is quite simple. Just type following command :

# rpm -ivh cups-pdf-2.4.6-1.el5.i386.rpm
warning: cups-pdf-2.4.6-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
Preparing...                ########################################### [100%]
1:cups-pdf               ########################################### [100%]
#

Next, we need to customize “cups-pdf” to our needs. To do that, we edit the configuration “/etc/cups/cups-pdf.conf”. By default every PDF you print will end up on your desktop. I choose to create a directory called “pdf” in my home directory and change cups-pdf configuration accordingly.

# vi /etc/cups/cups-pdf.conf
#Out ${HOME}/Desktop
Out ${HOME}/pdf

By default file are created with a umask of 0077, so only I can read it. I change it to 0022 so that everybody can read it.

#UserUMask 0077
UserUMask 0002

These are the only fields, I usually change before start using “cups-pdf”.

If you have any problem using “cups-pdf”, remove the comment on the “Log” and “Logtype” line to activate the logging. The configuration file is well documented, take a look at it and customize cups-pdf to it full extend.

You can download the version 2.4.6 for RHEL4 and RHEL5 or 2.5.0 for Fedora 10 and Fedora 11.

To download packages for other version of linux visit the download page of cups-pdf home page.

Happy printing !

Categories: Printing