Kbase

Base de Conhecimento

Arquivo da categoria ‘hp-ux’

lp Error Messages

Publicado por agostinhojr em 4 Maio, 2007

Error Messages

This appendix provides a listing of error messages, categorized by device, that may display during setup or while operating a device.

lp Error Messages

This section provides a description of the error messages that are associated with lp commands. The following variables are used in the error messages:

file(s)

Indicates the file or files that are to be printed.

dest

Indicates the name of the destination printer.

printer-id

Indicates the request identification number of the printout. For example, myprinter-46 is the printer name followed by the request identification number.

printer-name

Indicates the name of the printer.

program-name

Indicates the program name that was executed.

user

Indicates the user who requested the printout.

These messages can be found in the printer log files if you missed them on the system console. Following each message is an explanation of the probable cause of the error and the corrective action. If you cannot correct all the error conditions you encounter, call your service representative.

dest is an illegal destination name

The dest you used is not a valid destination name. Use the lpstat -p command to list valid destination names.

file is a directory

The filename you typed is a directory and cannot be printed.

xx is not a request ID or a printer

The argument you used with the cancel command is not a valid request identification number or a printer name. Use the lpstat -t command to view a list of all the printers and requests waiting to be printed.

xx is not a request

The request identification number you used with the lpmove command is not a valid request identification number. To find out which requests are valid, use the lpstat -u command.

xx not a request ID or a destination

You used an invalid request identification number or destination with the lpstat command. To find out what is valid, use the lpstat -t command.

dest not accepting requests since date

Requests to the printer that you are trying to use have been stopped by the reject command.

Can’t access FIFO

The named pipe file /var/spool/lp/FIFO is incorrect. The mode should be 600 with the owner lp and the group lp.

lp Administrator not in password file

You must have an entry in the /etc/passwd file for lp, and you must belong to the group lp.

destination printer-name unknown

Use the accept command to enable the printer so that it can accept requests.

can’t access file xx

The mode could be wrong on your directory or the file that you are trying to access.

can’t create class xx—existing printer name

The class name you are trying to use has already been given to a printer. You need to use another name or remove the printer to use the class name.

can’t create new acceptance status file

The mode may be wrong on the /var/spool/lp directory. It should be 755 with the owner lp and the group lp.

can’t create new class file

The mode may be wrong on the /var/spool/lp directory. It should be 755 with the owner lp and the group lp.

can’t create new interface program

The mode may be wrong on the /var/spool/lp/interface directory. It should be 755 with the owner lp and the group lp.

can’t create new member file

The mode may be wrong on the /var/spool/lp/member directory. It should be 755 with the owner lp and the group lp.

can’t create new printer status file

The mode may be wrong on the /var/spool/lp/pstatus file. It should be 644 with the owner lp and the group lp.

can’t create new request directory

The mode may be wrong on the /var/spool/lp/request directory. It should be 755 with the owner lp and the group lp.

can’t create printer-name—existing class name

The printer name you are trying to use has already been used as a class name. You need to assign another name to the printer.

can’t create new output queue

The mode on the file /var/spool/lp/seqfile is incorrect. It should be 644, and the mode on the directory should be 755. The owner and the group should be lp.

can’t create new sequence number file

The mode on the file /var/spool/lp/seqfile is incorrect. It should be 644, and the mode on the directory should be 755. The owner and the group should be lp.

can’t create request file xx

The mode on the file /var/spool/lp/request/printer-name/id is incorrect. Printer-name is the name of the printer such as dqp10, and id is the request identification number. The mode of the file should be 444, and the mode of the directory should be 755. The owner and the group should be lp.

can’t fork

Either you have several processes running and are not allowed to run any more, or the system has all the processes running that it can handle. You must rerun this command later.

can’t lock acceptance status

The file /var/spool/lp/QSTATLOCK prevents more than one lp request from being taken at any one time. You must rerun this command later.

can’t lock output queue

The file /var/spool/lp/QSTATLOCK prevents more than one lp request from being printed on a printer at a time. You must rerun this command later.

can’t lock printer status

The temporary file /var/spool/lp/PSTATLOCK prevents more than one lp request from being printed on a printer at a time. You must rerun this command later.

can’t lock sequence number file

The file /var/spool/lp/SEQLOCK prevents more than one lp request from getting the next printer-id (request identification) number at one time. You must rerun this command later.

can’t move request printer-id

Printer-id is the request identification number that cannot be moved. You will probably have to change the modes on the files and directories in /var/spool/lp/request. Also, after you shut down the lp scheduler, you must manually move the request from the disabled printer directory to the new destination.

can’t open class file

The lp program is trying to access the list of classes for printers. One reason it may not be able to open the class file is that the system might have the maximum number of files open that are allowed at any one time. You can correct this by typing the command at a later time.

can’t open member file

The lp program is trying to access the list of members in the directory /var/spool/lp/member. The system could have the maximum number of files open that are allowed at any one time. You can correct this by typing the command at a later time.

can’t open xx file in MEMBER directory

There are a number of reasons why file xx in the /var/spool/lp/member directory cannot be opened. The mode on the file could be incorrect; it should be 644. The system could have the maximum number of files open that are allowed at any time; you can correct this by typing the command at a later time.

can’t open xx file in class directory

If file xx cannot be opened, it is possible that the mode on the file or directory is incorrect. The file mode should be 644, and the directory mode should be 755. Another possibility is that the system has the maximum number of files open that are allowed at any one time. The latter problem can be corrected by typing the command at a later time.

can’t open xx

You cannot print on printer xx because the mode is incorrect on the /dev/tty file. The mode should be 622.

can’t open FIFO

The mode on the named pipe file /var/spool/lp/FIFO may be incorrect. It should be 600. Or the system could have the maximum number of files open that are allowed at any one time. You can correct the latter problem by typing the command at a later time.

can’t open MEMBER directory

The mode on the directory /var/spool/lp/member could be incorrect. It should be 755. Another possibility is that the system could have the maximum number of files open that are allowed at any one time. If this is the case, try typing the command at a later time.

can’t open acceptance status file

The mode on the file /var/spool/lp/qstatus may not be correct; it should be 644. Another possibility is that the system could have the maximum number of files open that are allowed at any one time. You can correct the latter problem by typing the command at a later time.

can’t open default destination file

Check the mode on the file /var/spool/lp/default; it should be 644. If the mode is correct, it could be that the system has the maximum number of files open that are allowed at any one time. You can correct this by trying the command at a later time.

can’t open file file

You incorrectly typed the filename, or you do not have the correct modes set. If you are the owner, the mode should be at least 400.

can’t open output queue

Check the mode on the file /var/spool/lp/outputq; it should be 644. This error message could also be generated if the system has the maximum number of files open that are allowed at any one time. Try entering the command at a later time.

can’t open printer status file

The mode on the file /var/spool/lp/pstatus is incorrect; it should be 644. This message is also generated if the system has the maximum number of files open that are allowed at any one time. You can correct this by trying the command at a later time.

can’t open request directory

The mode on the directory /var/spool/lp/request is incorrect; it should be 655. The system may also have the maximum number of files open that are allowed at any one time. You can correct this by trying the command at a later time.

can’t open request file xx

The mode on the file /var/spool/lp/member/request/xx is incorrect. The mode should be 644. The system may also have the maximum number of files open that are allowed at any one time. You can correct this by trying the lpmove command at a later time.

can’t open system default destination file

The mode on the file /var/spool/lp/default is incorrect. The mode should be 644. The system may also have the maximum number of files open that are allowed at any one time. You can correct this by trying the command again at a later time.

can’t open temporary output queue

The mode on the file /var/spool/lp/outputq is incorrect. The mode should be 644. The system may also have the maximum number of files open that are allowed at any one time. You can correct this by trying the command at a later time.

can’t proceed—scheduler running

Many of the lpadmin command options cannot be executed while the scheduler is running. Stop the scheduler using the lpshut command and then try invoking the command again.

can’t read current directory

The lp and lpadmin commands cannot read the directory containing the file to be printed. The directory name may be incorrect, or you do not have read permission on that directory.

can’t remove class file

The mode may be wrong on the file /var/spool/lp/class. It should be 755. The owner and the group should be lp. The file in that directory may also have the wrong mode; it should be 644.

can’t remove printer

The mode may be wrong on the /var/spool/lp/member directory. It should be 755, and the files in that directory should be 644. Both the directory and the files should be owned by lp and the group should be lp.

can’t remove request directory

The mode may be wrong on the /var/spool/lp/request directory. It should be 755 and should be owned by lp, and the group should be lp. The directory may still have pending requests to be printed, which must be removed before the directory can be removed.

can’t set user id to lp Administrator’s user id

The lpsched and lpadmin commands can be used only when you are logged in as lp or root.

can’t unlink old output queue

The lpsched program cannot remove the old output queue. You must remove it manually by using the command

rm /var/spool/lp/outputq

can’t write to xx

The lpadmin command cannot write to device xx. The mode is probably wrong on the /dev/ttyxx or /dev/plp file. It should be 622 and owned by lp.

cannot create temp file filename

The system may be out of free space on the /var filesystem. Use the command

df /var

to determine the number of free blocks. Several hundred blocks are required to ensure that the system performs correctly.

class xx has disappeared!

Class xx was probably removed after the scheduler was started. The system may be out of free space on the /var filesystem. To find out, use the following command:

df /var

Use the lpshut command to stop the scheduler and restore the class from a backup.

class xx non-existent

The class xx may have been removed because the system is out of free space on the /var filesystem. To find out how much free space is available, use the following command:

df /var

The class will probably have to be restored from a backup.

class directory has disappeared!

The /var/spool/lp/class directory has been removed. The system may be out of free space on /var; use the df /var command to find out. The class directory contains all the data for each printer class. To restore this directory, get these files and directory from a backup.

corrupted member file

The /var/spool/lp/member directory has a corrupted file in it. You should restore the directory from backup.

default destination dest non-existent

Either the default destination is not assigned, or the printer dest has been removed. Use the lpadmin command to set up a default destination or set your LPDEST environment variable to the value of the destination.

destination dest has disappeared!

A destination printer, dest, has been removed after lpsched was started. Use the lpadmin command to remove the printer.

destination printer no longer accepting requests

The printer has been disabled using the reject command. Use the accept command to reenable the printer.

destination dest non-existent

The destination printer you specified as an argument to the accept or lpadmin command is not a valid destination name, or it was removed after the scheduler was started.

destination printer was already accepting requests

The destination printer was previously enabled. Once a printer is accepting requests, any further accept commands are ignored.

destination printer already not accepting requests

A reject command had already been sent to the printer. Use the accept command to allow the printer to start accepting requests again.

destination printer-name is not accepting requests – move in progress …

The printer has been disabled by the reject command, and requests are being moved from the disabled printer to another printer. The printer can be enabled again by the accept command.

destinations are identical

When using the lpmove command, you need to specify a printer to move the print requests from and a different printer to move the requests to.

disabled by scheduler: login terminal

The login terminal has been disabled by the lp scheduler. Use the enable command to reenable the printer.

error in printer request printer-id

Printer-id is the actual request identification number. An error has likely occurred in the printer. Check the printer and reset it if needed.

illegal keyletter xx

An invalid option, xx, was used. See the reference page for the correct options.

keyletters -xx and -yy are contradictory

This combination of options to the lpadmin program cannot be used together.

keyletter xx requires a value

The option xx requires an argument. For example, in the command line

lpadmin -m model

the argument to the -m option is the name of a model interface program.

keyletters -e, -i, and -m are mutually exclusive

These options to the lpadmin command cannot be used together. Refer to the lpadmin(1M)
reference page for information on usage.

lp: xx

In this message the variable xx could be one of several arguments. Typically, it is telling you that the default destination is not assigned.

member directory has disappeared!

The /var/spool/lp/member directory has been removed. The system is probably out of free disk space in the /var filesystem. You need to clean up the /var filesystem and then install the lp commands or retrieve them from a backup.

model xx non-existent

The name that you are using for a model interface program is not valid. A list of valid models is in the /var/spool/lp/model directory.

new printers require -v and either -e, -i, or -m

A printer must have an interface program, which is specified by -e, -i, or -m options. The -v option specifies the device file for the printer. For more information on these options, refer to the lpadmin(1M) reference page.

no destinations specified

There are no destination printers specified. Use the lpadmin command to set one up.

no printers specified

There are no printers specified. Use the lpadmin command to set one up.

non-existent printer xx in PSTATUS

A printer with the name xx is in the /var/spool/lp/pstatus file but no longer exists. Use the lpadmin command to remove the printer.

non-existent printer printer-name in class xx

The printer that you are trying to address in class xx has been removed from that class.

out of memory

The message states that there is not enough memory to contain the text to be printed.

printer printer-name already in class xx

The printer you are trying to move to class xx is already in that class. You cannot move a printer to a class that it is already in.

printer printer-name has disappeared!

The printer has been removed, and the enable command cannot find it. The printer was most likely removed after the workstation was rebooted or after the scheduler was started.

printer printer-name non-existent

Printer-name is the name of a printer that was removed after the scheduler was started. You must use the command

lpadmin -xprinter-name

printer status entry for printer has disappeared

The /var/spool/lp/pstatus file has been corrupted. You need to resubmit the printer request.

printer printer-name was not busy

The printer is not printing a request at this time. Either the request you wanted to cancel is finished printing or you have specified the wrong printer.

request printer-id non-existent

You are attempting to cancel a request that does not exist. You may have given the wrong printer name or wrong request ID number, or the request may have finished printing.

request not accepted

The request was not accepted by lp. The scheduler may not be running. Use the lpstat -t command to find out more information.

requests still queued for printer-name—use lpmove

Printer-name is a printer that still has requests waiting to be printed. Use the lpmove command to move those requests to another printer.

scheduler is still running—can’t proceed

You cannot perform this command while the scheduler is running. Use the lpshut command first.

spool directory non-existent

The directory /var/spool has been removed. Use the mkdir command to restore the directory. This has probably removed some of the necessary lp files. You may have to reinstall the lp commands.

standard input is empty

You specified an invalid filename either by incorrectly typing a name or by specifying a nonexistent file. Nothing will be printed from this request.

this command for use only by lp Administrators

This command is restricted to someone logged in as root or lp.

too many options for interface program

The lp command called the appropriate interface program with too many arguments. For more information on the options and arguments that can be used with the lp command, refer to the lp(1)
reference page.


Tape Drive Error Indications

Following are some examples of commands and error messages. This is not an exhaustive list.

  • tar tvf /dev/nrtape

    tar: /dev/nrtape: No such device

  • cpio -itvI /dev/nrtape

    cpio: ERROR: Cannot open </dev/nrtape> for input. No such device

  • tar t

    tar: archive file /dev/tape does not exist or is a regular file

  • /usr/etc/restore t

    /dev/tape: No such file or directory

Enviado em Referencia, hp-ux | Deixar um comentário »

PROCEDIMENTOS PARA GERENCIAR O LVM

Publicado por agostinhojr em 13 Abril, 2007

Quando voce instala a maquina ja e possivel definir o numero de filesystems desejados e o tamanho de cada um. Porem, com o passar do tempo, dependendo dos recursos de disco consumidos pela sua aplicacao, ou devido a compra de discos adicionais, torna-se necessario alterar a configuracao inicial: ou voce aumenta o tamanho de um filesystem, ou o diminui, ou cria novos filesystems.

Vamos reforcar alguns conceitos de uma forma bem simples antes de prosseguirmos com os exemplos:

VG == Volume Group: e o grupo de volumes de disco configurados na maquina. Em cada VG voce pode incluir 1 ou mais discos.

LVOL == Logical Volume: e a particao do disco. Quando voce criar o disco em um VG, deve particiona-lo (em 1 ou mais “pedacos”).

File System: depois de particionado o disco, voce podera criar um
sistema de arquivos para montar em um diretorio.

OBS.: Se voce precisar usar um “raw device”, basta criar
o VG e o LVOL (nao precisa criar o filesystem).

Queremos tambem ressaltar algumas observacoes importantes:

- O barra (/), onde esta o “/dev/vg00/lvol1″, nao pode ser
modificado, ou seja, nao e possivel aumentar e nem diminuir o seu
tamanho. Para altera-lo, e necessario uma reinstalacao do Sistema
Operacional.

- Voce pode alterar os volumes, atraves do SAM ou manualmente, com
excecao do /usr (se estiver em um volume logico separado do “/”), o
qual deve ser alterado apenas manualmente.

- Para alterar os volumes logicos (lvols), eles devem estar
desmontados.

- Nunca deixe de fazer backup regularmente e principalmente antes de
qualquer alteracao na configuracao do LVM.

A seguir listamos 8 exemplos de duvidas que ocorrem com mais
frequencia:

A – Como criar um novo VG;
B – Como remover um VG;
C – Como incluir um disco novo em um VG ja existente;
D – Como excluir um disco de um VG;
E – Como criar um novo LVOL;
F – Como remover um LVOL;
G – Como aumentar o tamanho de um LVOL;
H – Como diminuir o tamanho de um LVOL.

A – ) COMO CRIAR UM NOVO VG:

Nesse exemplo supomos que voce tinha apenas 1 disco configurado na
maquina e agora vai criar um novo VG para o segundo disco (um disco
novo):

1) Execute o comando “ioscan” para saber o endereco do disco:

# /usr/sbin/ioscan -fC disk

Class I H/W Path Driver S/W State H/W Type Description
================================================================
disk 1 52.5.0 disc3 CLAIMED DEVICE HP C2474S
disk 0 52.6.0 disc3 CLAIMED DEVICE HP C2247M1

Observe que temos um disco no endereco 6 e outro no endereco 5.

2) Verifique qual dos dois esta alocado no(s) VG(s) existente(s):

# /sbin/vgdisplay -v | grep “PV Name”
PV Name /dev/dsk/c0t6d0

Observe que realmente so temos um disco alocado em VG. Note que
esse disco e o dispositivo “c0t6d0″, o qual esta no endereco 6.
O disco de endereco 5 e o de dispositivo “c0t5d0″.

3) Crie um novo VG para o novo disco:

# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0×010000
|_> esse valor nao pode ser repetido
# /sbin/pvcreate /dev/rdsk/c0t5d0
# /sbin/vgcreate /dev/vg01 /dev/dsk/c0t5d0

B – ) COMO REMOVER UM VG:

Assumimos nesse exemplo que voce tem dois discos no VG01 e esse VG
tem dois LVOLs criados:

1) Devemos, em primeiro lugar, desmontar os filesystems do VG em
questao:

# /usr/sbin/umount /dev/vg01/lvol1
# /usr/sbin/umount /dev/vg01/lvol2

2) Agora, vamos remover os LVOLs criados para ele:

# /sbin/lvremove -f /dev/vg01/lvol1 /dev/vg01/lvol2

3) Em seguida, descobrimos quais discos fazem parte do VG01, para
removermos:

# /sbin/vgdisplay -v vg01 | grep “PV Name”
PV Name /dev/dsk/c0t5d0
PV Name /dev/dsk/c0t4d0

4) Verificamos nesse exemplo que temos dois discos no VG01.
Devemos remover “quase todos os discos” do VG01 (somente
deixamos um):

# /sbin/vgreduce /dev/vg01 /dev/dsk/c0t4d0

5) Restando apenas um disco no VG, basta remove-lo:

# /sbin/vgremove /dev/vg01

C – ) COMO INCLUIR UM DISCO NOVO EM UM VG JA EXISTENTE:

Assumimos nesse exemplo que voce somente tem o VG00, com um disco.
Vamos incluir o novo disco nesse mesmo VG:

1) Execute o comando “ioscan” para saber o endereco do disco:

# /usr/sbin/ioscan -fC disk

Class I H/W Path Driver S/W State H/W Type Description
================================================================
disk 1 52.5.0 disc3 CLAIMED DEVICE HP C2474S
disk 0 52.6.0 disc3 CLAIMED DEVICE HP C2247M1

Observe que temos um disco no endereco 6 e outro no endereco 5.

2) Verifique qual dos dois esta alocado no(s) VG(s) ja
existente(s):

# /sbin/vgdisplay -v | grep “PV Name”
PV Name /dev/dsk/c0t6d0

Observe que realmente so temos um disco alocado em VG. Note que
esse disco e o dispositivo “c0t6d0″, o qual esta no endereco 6.
O disco de endereco 5 e o de dispositivo “c0t5d0″.

3) Agora e so inclui-lo no VG00:

# /sbin/pvcreate /dev/rdsk/c0t5d0
# /sbin/vgextend /dev/vg00 /dev/dsk/c0t5d0

D – ) COMO EXCLUIR UM DISCO DE UM VG:

Assumimos nesse exemplo que voce tem dois discos no VG01 e esse VG tem dois LVOLs criados. O disco a ser removido e o de endereco 4. Tome o seguinte cuidado: pode ser que um determinado LVOL esteja ocupando uma parte de cada disco. Nesse caso, esse LVOL e perdido.

1) Devemos, em primeiro lugar, desmontar os filesystems do VG em
questao:

# /usr/sbin/umount /dev/vg01/lvol1
# /usr/sbin/umount /dev/vg01/lvol2

2) E necessario descobrir quais LVOLs fazem parte do disco de
endereco 4:

# /sbin/lvdisplay -v /dev/vg01/lvol2 | pg
— Logical volumes —

— Distribution of logical volume —
PV Name LE on PV PE on PV
/dev/dsk/c0t5d0 12 12
/dev/dsk/c0t4d0 40 40
||
\\==========> essa e a informacao que nos interessa.
— Logical extends —

# /sbin/lvdisplay -v /dev/vg01/lvol1 | pg
— Logical volumes —

— Distribution of logical volume —
PV Name LE on PV PE on PV
/dev/dsk/c0t5d0 12 12
||
\\==========> essa e a informacao que nos interessa.
— Logical extends —

Observe que nos comandos acima conseguimos visualizar que o
LVOL2 ocupa dois discos e o LVOL1 ocupa apenas um. O LVOL que
esta ocupando o disco a ser removido e o LVOL2.

3) Agora vamos remover o LVOL que ocupa o disco em questao:

# /sbin/lvremove -f /dev/vg01/lvol2

4) Livre de LVOLs, basta remover o disco do VG:

# /sbin/vgreduce /dev/vg01 /dev/dsk/c0t4d0

E – ) COMO CRIAR UM NOVO LVOL:

Nao se esqueca que para criar um LVOL, o VG ja deve estar previamente criado. Nesse exemplo assumimos que o VG01 ja esta criado, ja possui o LVOL1 e agora queremos usar o restante de seu espaco para criar outro LVOL (lvol2).

1) Primeiro devemos descobrir se ha espaco desalocado no VG e
quanto de espaco ainda ha disponivel:

# /sbin/vgdisplay vg01 | grep Free
Free PE 25

Se o numero resultante desse comando for 0, significa que nao
sera possivel criar um novo LVOL.

2) Vamos criar um LVOL com 25 extensoes (que tem 4Mb cada uma). O
tamanho em bytes e de (25 * 4) == 100Mb.

# /sbin/lvcreate -l 25 vg01

OBS.: O novo lvol e um numero sequencial, a partir do ultimo
criado. Como so tinhamos o LVOL1, o proximo a ser criado e
o LVOL2.

3) Se voce for usar um Raw Device, ou alocar essa area para swap
fisico, nao deve criar o sistema de arquivos. Porem, se voce
quiser usar esse LVOL para um sistema de arquivos, para montar
em um diretorio, deve cria-lo da seguinte forma:

# /usr/sbin/newfs -F vxfs /dev/vg01/rlvol2

4) Para monta-lo, ja deve existir o diretorio destino (e vazio!):

# mkdir /mnt
# /usr/sbin/mount /dev/vg01/lvol2 /mnt

5) Para que o sistema de arquivos seja montado automaticamente
durante o boot e necessario inclui-lo no arquivo /etc/fstab:

# vi /etc/fstab

/dev/vg01/lvol2 /mnt vxfs delaylog 0 2

OBS.: Verifique no manual a sintaxe da fstab para conhecer
mais detalhes.

F – ) COMO REMOVER UM LVOL:

Assumimos nesse exemplo a remocao do LVOL2 que esta no VG01:

1) Desmonte o LVOL em questao:

# /usr/sbin/umount /dev/vg01/lvol2

2) Remova o LVOL:

# /sbin/lvremove -f /dev/vg01/lvol2

3) Nao se esqueca de remove-lo da tabela “/etc/fstab”, antes de
resetar a maquina.

G – ) COMO AUMENTAR O TAMANHO DE UM LVOL:

Assumimos nesse exemplo o aumento do tamanho do LVOL2, que esta no VG01. Atualmente ele tem 572Mb e incluiremos nesse LVOL mais 40Mb.

LEMBRETE: nao e possivel aumentar o barra (“/”), que esta no LVOL1 do
VG00!!!

1) Verifique se ha espaco disponivel no VG, a fim de inclui-lo no
LVOL em questao:

# /sbin/vgdisplay vg01 | grep Free
Free PE 25

Se o numero resultante desse comando for 0, significa que nao
sera possivel aumentar um LVOL.

Nesse caso temos 25 extensoes (de 4Mb cada uma), totalizando
entao 100Mb ainda disponiveis.

Como queremos apenas 40Mb, usamos 10 extensoes (40 / 4 = 10).

2) Desmonte o LVOL em questao:

# /usr/sbin/umount /dev/vg01/lvol2

3) Garanta que o LVOL esta realmente desmontado, atraves do comando
“mount”: nao deve aparecer a linha desse LVOL.

4) Vamos agora descobrir quantas extensoes de 4Mb temos alocadas
atualmente no LVOL:

# /sbin/lvdisplay -v /dev/vg01/lvol2 | grep Current
Current LE 143

5) Totalizamos agora o novo numero de extensoes logicas:

143 + 10 = 153
| | |
| | |——-> total de extensoes (=> 153 * 4 = 612Mb).
| |————-> total que temos intencao de adicionar
| (=> 10 * 4 = 40Mb)
|——————> total de extensoes atualmente
(=> 143 * 4 = 572Mb)

Dessa forma chegamos a um novo tamanho de 612Mb.

6) Vamos agora aumentar o tamanho do LVOL:

# /sbin/lvextend -l 153 /dev/vg01/lvol2

7) Depois de aumentado o tamanho do LVOL, precisamos aumentar o
tamanho do sistema de arquivos para compatibilizar os tamanhos:

# /usr/sbin/extendfs –F vxfs /dev/vg01/rlvol2

8) Por ultimo, e so montar novamente o LVOL e usa-lo ja com o novo
tamanho!

H – ) COMO DIMINUIR O TAMANHO DE UM LVOL:

Assumimos nesse exemplo a diminuicao do LVOL2 que esta no VG01. Hoje, o LVOL2 esta com 612Mb e queremos deixa-lo com apenas 500Mb.

LEMBRETE: nao e possivel diminuir o tamanho do barra (“/”), que esta
no LVOL1 do VG00!!!

1) Em primeiro lugar devemos fazer um backup do diretorio onde esta
montado o LVOL2, pois ao diminuirmos o seu tamanho, perderemos
os dados:

# cd /diretorio
# find . -print | cpio -ocvB > /dev/rmt/c0t0d0BEST

2) Em seguida, desmontamos o LVOL:

# cd / ; umount /dev/vg01/lvol2

3) Garanta que o LVOL esta realmente desmontado, atraves do comando
“mount”: nao deve aparecer a linha desse LVOL.

4) Como o LVOL esta com 612Mb e queremos diminui-lo para 500Mb,
devemos calcular o numero de extensoes contidas em 500Mb:

calcule: 500 / 4 = 125

5) Reduza agora o tamanho do LVOL:

# /sbin/lvreduce -l 125 /dev/vg01/lvol2

6) Crie um novo sistema de arquivos (pois nao e possivel apenas
diminuir o tamanho do sistema de arquivos):

# /usr/sbin/newfs -F vxfs /dev/vg01/rlvol2

7) Monte o filesystem e restaure os dados do backup:

# mount /dev/vg01/lvol2 /diretorio
# cd /diretorio
# cpio -icvdumB < /dev/rmt/c0t0d0BEST

GERENCIAMENTO DO LVOL COM ADVANCED JFS

1. Como aumentar o tamanho do lvol:

Atencao: Para os procedimentos abaixo E’ necessario que o pacote HP OnLine JFS Advanced VxFS esteja instalado.

1.1 – Verifique se existe espaco disponivel no vg00:

# /sbin/vgdisplay -v vg00 |grep Free
Free PE 178

Se o numero mostrado for 0, indica que o seu vg nao tem espaco
disponivel para criar um novo lvol.

Atencao: Note que no item anterior, nos desmontamos o lvol; nesse
caso, com o pacote instalado, nao E’ necessario.

1.2 – Como queremos aumentar o lvol para o tamanho de 140MB, podemos
utilizar:

# /sbin/lvextend -L 140 /dev/vg00/lvol10
Logical volume “/dev/vg00/lvol10″ has been successfully extended. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

1.3 – Aumente o tamanho do sistema de arquivos para compatibilizar o
tamanho:

# /usr/sbin/fsadm -F vxfs -b 143360 /teste
fsadm: /dev/vg00/rlvol10 is currently 102400 sectors – size will be increased

onde:
-b (total lvol * 1024)

1.4 – Para confirmar que o lvol foi realmente aumentado, pode-se executar:

#/usr/bin/bdf
ou
#/usr/sbin/lvdisplay /dev/vg00/lvol10

2. Reduzindo o tamanho do lvol

2.1 – Tire backup do lvol (por seguranca).
2.2 – Nao E’ necessario desmontar o lvol.
2.3 – Reduzindo o lvol:

# /usr/sbin/fsadm -F vxfs -b 102400 /teste
fsadm: /dev/vg00/rlvol10 is currently 155648 sectors – size will be reduced

#/usr/sbin/lvreduce -L 100 /dev/vg00/lvol10
Then a logical volume is reduced useful data might get lost; do you really want the command to proceed (y/n) : y Logical volume “/dev/vg00/lvol10″ has been successfully reduced. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

2.4 – Para confirmar que o lvol foi realmente aumentado, pode-se
executar:

#/usr/bin/bdf
ou
#/usr/sbin/lvdisplay -v /dev/vg00/lvol10

Enviado em hp-ux | Deixar um comentário »

Iniciar diversos processos (processos paralelos) para uma mesma atividade. (Perl)

Publicado por agostinhojr em 21 Março, 2007

O Objetivo do script abaixo é iniciar diversos comandos do sistema operacional ou outro qualquer até o limite definido pelo variavel $process.

Por exemplo: copiar diversos arquivos de um filesystem para outro qualquer.
E necessário criar um arquivo onde cada linha de comando possua todos os parametros necessários para o procedimento.

cp -p /usr/scripts/arq1 /var/scripts
cp -p /usr/scripts/arq2 /var/scripts

Este arquivo deverá ser passado como argumento para o script que fara a leitura de cada linha e executara até o final deste arquivo.

Dica: para gerar este tipo de arquivo eu tenho utililizado o excel, onde eu gero uma lista dos arquivo/diretorios e importo no excel para tratamento utilizando a função concatenar. Assim gera uma celula com uma função e depois replico para as demais, facilitando e agilizando em muito o processo de criação do arquivo.

#!/bin/perl

use Proc::Background

open ( INPUT, $ARGV[0]) || die “Erro ao abrir o arquivo $ARGV[0]\n”;

while(<INPUT>) {
$line = $_;
$conta = $conta + 1;
$process= `ps -e | grep -i “cp -pr” | grep -v grep | wc -l` ;
while( $process > 7 ) {
sleep 30;
$process= `ps -e | grep -i “cp -pr” | grep -v grep | wc -l` ;
}
print “$conta -> $line”;
my $proc1 = Proc::Background->new($line);
}

Enviado em hp-ux | Deixar um comentário »