четверг, 29 ноября 2012 г.

iManager. Перенос на другой сервер

Netware 6.5 sp8 eDir8.3.7
Вывожу из эксплуатации старый сервер. Новый с среде VMWare.
iManager 2.7.3 (Field Patch 4 for iManager 2.7.3)
На новом сервере iManager подхватил новые плагины, CIFS не корректно работает, на старом все устраивало. Задача сделать iManager на новом, как на старом.

Скопировал папку sys\tomcat со старого на новый сервер

tc4stop
tc5stop
ap2webdn
java -exit

sys:\tomcat\4\bin\startup
sys:\tomcat\5.0\bin\startup
ap2webup

-----------------------------------------------------------------------
Если устарели сертификаты, Переиздать и перегрузить Apache
But whenever I type tc4stop or tc5stop or tomcat4 or tomcat 5 all the
console responds with is...."Loading Module Perl.NLM. Autoloading Module
LibPerl.NLM

I don't think that's the correct behavior if I am trying to shutdown or
start Tomcat. Any thoughts?

That tactic is below...

NETWARE: tc4stop
(Terminate Tomcat. For Tomcat 5.0, use tc5stop instead.)

NETWARE: ap2webdn
(Shutdown the Apache web server.)

NETWARE: java -exit
(Shutdown Java.)

NETWARE: pkidiag
(This will open the PKI wizard for detecting and repairing public key
infrastructure in Netware. Follow the menu items namely 4, 5, 6, 0)

NETWARE: tckeygen
(Restore LDAP connectivity for Tomcat.)

After a few minutes, start the services.

NETWARE: tomcat
(You may also use /tomcat/5.0/bin/startup start to start Tomcat 5.0.)

NETWARE: ap2webup
(Start up the Apache web server.)


суббота, 3 ноября 2012 г.

Создание LVM (ещё раз)

Диск нужно инициализировать:
# pvcreate /dev/sdb
Создать группу томов (с размером Physical extents равным 16MB):
# vgcreate -s 16M vg0 /dev/sdb

Для нескольких дисков одновременно
Диски нужно инициализировать:
# pvcreate /dev/sdb /dev/sdс
Создать группу томов (с размером Physical extents равным 16MB):
# vgcreate -s 16M vg0 /dev/sdb /dev/sdс

Активация группы томов:
# vgscan
# vgchange -ay


# pvcreate /dev/sdb
# vgcreate -s 16M vg0sd /dev/sdb
# lvcreate -l 100%FREE -n lv0sd vg0sd
# mkfs.ext4 /dev/vg0sd/lv0sd
или
# mkfs.ext4 -b4096 -m0 /dev/vg0sd/lv0sd

----------------------------------------------
  • В виртуальных средах для LVM лучше использовать диск без создания разделов.
  • По умолчанию размер Physical extents size (PE size) равен 4 MB (в старой версии LVM было ограничение на размер LV из-за максимального числа PE 64k в LV.
    т.е. max размер LV =  (PE size) * 64k )
 -
увеличить
$ lvextend -l 10239 /dev/POSTGRES/pgbases
$ umount /dev/POSTGRES/pgbases
$ resize_reiserfs /dev/POSTGRES/pgbases
$ mount /dev/POSTGRES/pgbases
уменьшить
 
$ umount /dev/POSTGRES/pgbases
$ resize_reiserfs -s-15G /dev/POSTGRES/pgbases
$ lvreduce -L-15G /dev/POSTGRES/pgbases
$ pvresize --setphusicalvolumesize 25G /dev/sdb
$ mount /dev/POSTGRES/pgbases 
 -
посмотреть pvdisplay или vgdisplay

# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               vg02
  PV Size               279.46 GB / not usable 1.63 MB
  Allocatable           yes (but full)
  PE Size (KByte)       4096
  Total PE              71541
  Free PE               0
  Allocated PE          71541
  PV UUID               ieXhsc-Yw7c-mGM4-pWaS-eq1K-YOUT-pFkN0h

  --- Physical volume ---
  PV Name               /dev/hda2
  VG Name               VolGroup00
  PV Size               74.43 GB / not usable 22.62 MB
  Allocatable           yes (but full)
  PE Size (KByte)       32768
  Total PE              2381
  Free PE               0
  Allocated PE          2381
  PV UUID               JD6jbO-OeDL-RzJy-OFW5-NnRD-Uzng-JyAcUW

О LVM по русски
--------------------------------------
пример, на домашней машине:

pvcreate /dev/sda1
vgcreate vg0q1  /dev/sda1
pvscan
vgscan
lvcreate -l 100%FREE -n Vol1 vg01
mkfs.ext3 /dev/vg01/Vol1
lvdisplay
mkdir /mnt/vol1
vgscan
vgchange -ay
mount /dev/vg01/Vol1 /mnt/vol1
vgdisplay

-----

fdisk /dev/sda
fdisk /dev/sdb
pvcreate /dev/sda1
pvcreate /dev/sdb1
pvscan
vgcreate vg01 /dev/sda1
vgcreate vg02 /dev/sdb1
pvscan
vgscan
lvscan
lvcreate -l 100%FREE -n lv03 vg01
lvcreate -l 100%FREE -n lv04 vg02
lvscan
vgscan
pvscan
mkfs.ext3 /dev/vg01/lv03
mkfs.ext3 /dev/vg02/lv04
vgdisplay vg01
vgscan

--------------------------------------

pvcreate /dev/sdb
vgcreate -s 16M vg0sd /dev/sdb
lvcreate -l 100%FREE -n lv0sd vg0sd
mkfs.ext4 /dev/vg0sd/lv0sd
или
mkfs.ext4 -b4096 -m0 /dev/vg0sd/lv0sd
--------------------------------------

Чтоб сделать подключение диска постоянным, надо прописать в файл /etc/fstab строку с идентификатором раздела и другими параметрами.

Идентификатор устройства узнаем командой:

blkid

Далее откроем привычным редактором файл /etc/fstab, например так:

vi /etc/fstab

и впишем туда строку следующего вида:

UUID=ca7e6047-670a-428f-a2da-452e8b00015b /photos/ ext4 users,defaults,umask=0 0 0

среда, 31 октября 2012 г.

Пароль Windows

Для локальный учётный записей


Для снятия забытых паролей очень удобная утилита


Для ДОМЕНА

(не проверял)
Сводится к подмене utilman.exe на cmd.exe
move D:\windows\system32\utilman.exe D:\windows\system32\utilman.bak
copy D:\windows\system32\cmd.exe D:\windows\system32\utilman.exe 

Второй способ, через запуск службы

понедельник, 29 октября 2012 г.

Bacula Centos

Установка из rpm  http://repos.fedorapeople.org/repos/slaanesh/bacula

To install the repository, run as root the following commands.

For RHEL/Centos:

wget http://repos.fedorapeople.org/repos/slaanesh/bacula/epel-bacula.repo \
 -O /etc/yum.repos.d/epel-bacula.repo

For Fedora:

wget http://repos.fedorapeople.org/repos/slaanesh/bacula/fedora-bacula.repo \
        -O /etc/yum.repos.d/fedora-bacula.repo 
 
 
 
-------------------------------------------------------------- 
mysql на другом сервере 
 
yum install mysql-server
 
service mysqld start 

/usr/bin/mysql_secure_installation
 
mysql -u root -p 



GRANT ALL PRIVILEGES ON *.* TO 'my_user'@'localhost'
 IDENTIFIED BY 'my_password' WITH GRANT OPTION;
 
select user,host,password from mysql.user; 

# set root password
set password for root@localhost=password('password');
set password for root@'127.0.0.1'=password('password');
set password for root@'www.server.world'=password('password');

# delete anonymous user
delete from mysql.user where user='';
 
 
-------------------------------------------------------------- 
на bacula 
 
yum install bacula-director 
yum install bacula-storage 
yum install bacula-console 
 
[root@bacula bacula]# alternatives --config libbaccats.so

There are 3 programs which provide 'libbaccats.so'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib64/libbaccats-mysql.so
   2           /usr/lib64/libbaccats-sqlite3.so
*+ 3           /usr/lib64/libbaccats-postgresql.so

Enter to keep the current selection[+], or type selection number: 1
 
cd /usr/libexec/bacula 
./create_mysql_database -h bcatalog.domain.ru -u root -p
./make_mysql_tables -h bcatalog.domain.ru -u root -p
./grant_mysql_privileges -h bcatalog.domain.ru -u root -p 
 
Задать пароль для пользователя bacula  


Пример FileSet для windows 
 
FileSet {
  Name = "windows-n2229-doc"
  Include {
    Options {
      signature = MD5
      Compression=GZIP
      Ignore Case = yes
    }
    File = "D:/Книги"
    File = "D:/vbs"
# обратите внимание на двойной бекслэш и кавычки! - видимо для старый версий
#    File = "D:\\Книги"
#    File = "D:\\vbs"
#    File = "D:\\Public\\tex\\Maps"
#    File = "D:\\Public\\Отдел\ продаж1"
}
Exclude {
    File = "*.mp3"
    File = "*.avi"
    File = "*.wmv"
    File = "*.tmp"
 }
}
 
 
 
---------------------------------------------
Отлично расписано 
#
# для каждого клиента под Linux
#
FileSet {
  Name = ИмяКлиента
# не делать полное копирование после изменения списка
# Ignore FileSet Changes = Yes
  Include {
    Options {
      compression = GZIP
      signature = SHA1
      onefs = yes
      aclsupport = yes
      noatime = yes
      checkfilechanges = yes
    }
    File = /
# каждую файловую систему отдельно
    ...
  }
  Exclude {
    File = /proc
    File = /sys
    File = /net
    File = /media
# для devfs
#    File = /dev
# для прочих
    File = /dev/pts
    File = /dev/shm
    File = /tmp
    File = /var/cache/yum
    File = /.journal
    File = /.fsck
    File = /var/lib/nfs/rpc_pipefs
    File = /.autofsck
    File = /selinux
    File = /var/named/chroot/proc
    File = ...
  }
}
#
# для каждого клиента под MS Windows XP/2003
#
FileSet {
  Name = ИмяКлиента
# не делать полное копирование после изменения списка
# Ignore FileSet Changes = Yes
  Enable VSS = Yes
  Include {
    Options {
      compression = GZIP
      signature = SHA1
      onefs = yes
      portable = no
      noatime = yes
      checkfilechanges = yes
      Ignore Case = yes
      wildfile = "*.avi"
      wildfile = "*.wmv"
      wildfile = "*.mp3"
      wildfile = "pagefile.sys"
      wildfile = "hiberfil.sys"
      wilddir = "System Volume Information"
      wilddir = "TEMP"
      wild = ...
      exclude = yes
    }
    File = "e:/"
# каждый диск отдельно
    ...
  }
} 
------------
 
# долговременное хранение для серверов с возможностью восстановления 
# состояния на любой день в течении недели, на любое воскресенье в течении месяца,
# на первое воскресенье в течении года
#   ночью первого воскресенья месяца - полное копирование на тома пула ИмяКлиента-monthly
#   в остальные воскресенья - полное копирование на тома пула ИмяКлиента-weekly
#   в прочие дни - копирование изменений на тома пула ИмяКлиента-daily
Schedule {
  Name = "ИмяКлиента-year"
  Run = Level=Full Pool=ИмяКлиента-monthly 1st sun at 00:05
  Run = Level=Full Pool=ИмяКлиента-weekly 2nd-5th sun at 00:05
  Run = Level=Incremental Pool=ИмяКлиента-daily mon-sat at 00:05
}
# среднесрочное хранение для серверов с возможностью восстановления 
# состояния на любой день в течении недели, на любое воскресенье в течении месяца
#   ночью в воскресенье - полное копирование на тома пула ИмяКлиента-weekly
#   в прочие дни - копирование изменений на тома пула ИмяКлиента-daily
Schedule {
  Name = "ИмяКлиента-year"
  Run = Level=Full Pool=ИмяКлиента-weekly sun at 00:05
  Run = Level=Incremental Pool=ИмяКлиента-daily mon-sat at 00:05
} 
 
 
Для восстановления 
должно быть в файле конфигурации хотя бы одно задание job restore

для восстановления удобно использовать Strip Prefix и Add Prefix 
 
Пример в среде windows, при этом Where = <directory> игнорируется, 
по крайней мере в bat это поле становится не доступным
Strip Prefix = <directory>
This directive applies only to a Restore job and specifies a prefix to remove from the directory name of all files being restored. This will use the File Relocation feature implemented in Bacula 2.1.8 or later. Using Strip Prefix=/etc, /etc/passwd will be restored to /passwd
Under Windows, if you want to restore c:/files to d:/files, you can use :
 Strip Prefix = c:
 Add Prefix = d:
--------------
Теперь перейдем непосредственно к восстановлению. Запускаем на сервере bconsole, выбираем restore и указывыем для восстановления соответствующий job.
На этапе выбора файлов для восстановления нам доступно несколько команд, опишу самые полезные:
help — подсказка
find — поиск нужного файла
ls,dir — просмотр файлов в текущем каталоге (каталоги с подкаталогами будут отображены с "+")
cd — смена каталога
mark file — отметить файл находящийся в текущем местоположении
mark dir/ — отметить отдельный каталог находящийся в текущем местоположении
mark * — отметить все файлы и каталоги внутри текущего каталога. Кстати, TAB здесь тоже работает
lsmark — просмотреть отмеченние файлы
pwd — показать текущий каталог
estimate — посчитать размер восстанавливаемых файлов
done — закончить отметку
Т.о. общая схема такая — ищем через find то что нужно, затем переходим в нужный каталог посредством cd и делаем mark на то, что нужно.
Важное замечание:
для bacula имеет значение регистр, не важно что клиентом выступает Windows-машина.

пятница, 26 октября 2012 г.

Install VMware Tools on Red Hat Enterprise/CentOS/Scientific Linux 6

Подключаем диск с vmware-tools

mount /dev/cdrom /mnt
разворачиваем tar в /tmp

Отключаем диск с vmware-tools

и запускаем
./vmware-install.pl


далее жмем enter (несколько раз)

Готово

Если в системе уже есть драйвера vmxnet3,pvscsi,vmmemctl, то они по умолчанию не заменяются на новые. Тогда запустить конфигуратор с параметрами

vmware-config-tools.pl --clobber-kernel-modules=vmxnet3,pvscsi,vmmemctl

Отключаем диск с vmware-tools


Проверка загрузки драйверов от VM-TOOLS смотреть здесь



Minimize virtual machine restarts or manual driver reloads

To minimize the number of virtual machine restarts, on each virtual machine check whether both the modules are actually configured and the corresponding virtual hardware is present. If these conditions are satisfied, you must restart the virtual machine.
  • To check whether the VMXNET, VMXNET3, and PVSCSI modules are configured by VMware Tools, run the following commands from the virtual machine console: grep VMXNET_CONFED /etc/vmware-tools/locations | tail -1
    grep VMXNET3_CONFED /etc/vmware-tools/locations | tail -1
    grep PVSCSI_CONFED /etc/vmware-tools/locations | tail -1

    If the output contains yes for the adapter type, VMware Tools has configured the module.
  • To check whether the virtual hardware is available, from the virtual machine console run the lspci -n command and examine the output for the following IDs: 15ad:0720 for VMXNET
    15ad:07b0 for VMXNET3
    15ad:07c0 for PVSCSI
You must restart the virtual machine or reload the driver module if the output of the grep driver_CONFED /etc/vmware-tools/locations command contains yes and the output of the lscpi -n command shows that the corresponding virtual hardware is available.
To see information about the adapter driver including its version, run the ethtool -i ethX command on the virtual machine, where X in ethX stands for the sequence number of the network adapter in the virtual machine.

Reload the VMXNET or VMXNET3 driver manually

To reload the VMXNET or VMXNET3 driver propagating its upgrade to the kernel, perform the following steps from the virtual machine console:
  1. Stop virtual machine networking.
    /etc/init.d/network stop
    
  2. Reload the driver module by running rmmod and modprobe. For example, for the VMXNET3 driver run the following commands: rmmod vmxnet3
    modprobe vmxnet3
  3. Start virtual machine networking.
    /etc/init.d/network start
     
    ! Перезагрузку выполнять из vSphere Client or vSphere Web Client. !
    ! Если из ssh, то сеть отвалится и соединение пропадет.           !

четверг, 25 октября 2012 г.

SDIDIAG


TID-10086669 Using SDIDiag - Switches and Options ( 23SEP2005)

SECURITY DOMAIN SERVER MANAGEMENT
Name
Shortcut Command Command
Add All Write Partition Servers     ADDPARTITIONSERVERS AP
Add Domain Server ADD AS
List Domain Server LISTSERVERS LS
Remove Domain Server REMOVE RS
Sync Domain Server SYNCDOMAIN SD

SERVER MANAGEMENT
Name                                           Shortcut Command     Command
Find Servers in Container FINDSERVERS FS
List Server Keys LISTKEYS LK
Resync Keys for Container RESYNC RD
Sync Server Keys from Domain SYNCSERVER SS

DIAGNOSTIC
Name                                           Shortcut Command     Command
Check Key or Domain Problems CHECK CK

OTHER COMMANDS
Name                                           Shortcut Command     Command
Help on most used commands HELP HE
Exit SDIDiag EXIT or QUIT E or I
> Redirected output to a file using the '>' redirection switch.
>> Append output to an existing file.
-A Access servers regardless of their eDirectory or NICI versions. By default SDIDiag Version 2.00 Thursday, May 22, 2003, references only servers running eDirectory version 8.7.1 or higher.
NOTE: It is strongly recommended that all servers be running a minimum of NICI 2.4.2 or higher.
-F Force operation. Depending on the command, the -F switch removes any Security Domain Servers that do not hold a writeable replica of the W0.KAP.Security object.
-G Generate a new key. When used with the SD command, all Security Domain Servers will be synchronized to hold this new key.
-I file Specify an input file of server names to access. This switch specifies a file that holds a list of serverDNs for the command to process. In most cases, the objects are fully qualified dot delimited distinguish names with one server per line. Normally the -O file switch creates this file.
-N containerDN  Specifies with a fully qualified dot delimited distinguished name of a container that the command will reference.
-O file Create an output file of server names. This switch defines a file to hold output information that may be passed to a command via the -I file switch. Normally, the -O file switch will contain a fully qualified dot delimited distinguished name list of servers.
-R Revoke all keys. The -R switch will implicitly perform a -G switch operation after revoking all the keys.
-S serverDN                                    Specifies with a fully qualified dot delimited distinguished name a server name.
NOTE: serverDN includes the tree name, for example: -S SERVERA.NOVELL.TEST-TREE
-T Two pass "Comprehensive" switch for the RD command.
-U file Create a file of server with incompatible NICI SDI support. The -U switch creates a file that contains a fully qualified dot delimited distinguished name of servers on which NICI must be upgraded to fully support multiple SDI keys. Server names are not displayed when this switch is omitted.
-V Verbose, display all messages to SDIDiag console.
-X Limit the search for servers to the container specified with the -n containerDN switch.
EXAMPLES OF SDIDiag COMMANDS

SECURITY DOMAIN MANAGEMENT
AS [-A] [-V] [-S serverDN]  [> file | >> file]
Add server -S serverDN as a Security Domain Server.
Another way to do this is to open Console One and go to the W0 object in the Security Container. Select the "Other" tab on the W0 object and add an additional server as an attribute value to the "NDSPKI:SD Key Server DN" attribute.
LK [-A] [-V] [-S serverDN]  [> file | >> file]
List keys held by the Security Domain Servers.
All servers which are listed under the "NDSPKI:SD Key Server DN" attribute on the other tab of the W0 object will be displayed with their associated SD Keys.
LS [-A] [-V] [-S serverDN]  [> file | >> file]
List the current Security Domain Servers.
Another way to gather this information is to open Console One and go to the W0 object in the Security Container. Select the "Other" tab on the W0 object and view the values of the "NDSPKI:SD Key Server DN" attribute.
RS [-A] [-V] [-S serverDN]  [> file | >> file]
Remove server -S serverDN as a Security Domain Server.
This can also been done through Console One by going to the W0 object in the Security Container. Select the "Other" tab on ther W0 object and delete a server shown as an attribute balue to the "NDSPKI:SD Key Server DN" attribute.
AP [-A] [-V] [-F] [> file | >> file]
Add any server hosting a writeable replica of the .W0.KAP.Security.Tree-Name object as a Security Domain Server.
If the -F switch is given, additionally remove any servers that do not hold a writeable replica.
 SD [-A] [-V] [-R] [-G] [-S serverDN ] [> file | >> file]
Synchronize the Security Domain Servers. The optional -R switch revokes all existing keys and generates a new SD key for use within the tree. The optional -G switch generates a new SD key.

NOTE: If either the -R or -G switches are used, then the RD command may need to be used to resynchronize the new keys to the other servers in the tree.
Revoked keys are retained and used to access any existing items, however, they are not used to manage new keys.
SERVER MANAGEMENT
FS [-N containerDN] [-X] [-O file] [-U file]
Find all servers starting with the -N containerDN and all sub-containers unless the -X switch is given, in which case, limit the search to the -N containerDN only. Output all eDirectory 8.7.1 servers or higher to a file using the -O file while all other server that are listed are outputed to the -U file. The -O file  may be used as an input to any commands that the support the -I file switch.
LK [-A] [-V] [-S serverDN ] [> file | >> file]
List keys held by -s serverDN.
Example of using LK is:
SDIDIAG> LK -A -S .servername.org.tree_name
RD [-A] [-V] [-T] [-N containerDN] [> file | >> file]
Resynchronize the Security Domain Servers with other servers in the tree.
If the -T switch is given, RD or RESYNC, performs a two pass operation by first ensuring that the Security Domain Servers have a copy of all keys on all referenced servers.
Secondly, RD resynchronizes all servers with the updated Security Domain Servers.
If the -N switch is omitted, RD attempts to resync all servers within the tree; whereas when the -N containerDN switch is provided, RD only resynchronizes the Security Domain with all servers holding writeable replicas of the specified containerDN partition. It 1460 persist, then a full RESYNC may be attempted which may take a considerable time as every server will need to be contacted.
Examples of using RD are:
SDIDIAG> RD -T -n .orgUnit.org.tree_name.
SS [-A] [-V] [-R] [-S serverDN] [-I file] [-N containerDN]
Synchronize all keys on the specified -S serverDN, severs in listed in the -I file, or server hosting a writeable replica of the -N containerDN with the Security Domain Servers. The -R switch may optionally be given to revoke all the existing keys on the server before synchronizing with the Security Domain Servers.
Example of using SS is:
SDIDIAG> SS -A -R -S .servername.org.tree_name
DIAGNOSTIC
CK [-A] [-V] [-N containerDN] [> file | >> file]
Check and display possible problems and display recommendations for the Security Domain Servers. If the -N containerDN is provided, also check the servers hosting a writeable replica of the -N containerDN object for possible problems and provide recommendations.
Examples of using CK are:
SDIDIAG> CK
SDIDIAG> CK -N .orgUnit.org.tree-name
SDIDIAG> CK -A -N .orgUnit.org.tree-name >> SYS:\TEMP\OUTPUT.TXT






пятница, 19 октября 2012 г.

Install Nw65sp8

eDir 8.7 (instead of eDir 8.8) for a new server installation

If you need to install a new server with eDir 8.7, then boot from NW65SP8 Overlay CDs or DVD. When prompted to press any key to interupt the boot process, do so. Press "p" and specify this parameter (including the squared brackets):
[INST:spedir]
Press ENTER, then "i" to proceed with the installation as usual. This will give you eDir 8.7.3.10, instead of 8.8.4.        Взято

Installing VMware Tools in a NetWare Virtual Machine

1. Power on the virtual machine.
2. Select VM > Install VMware Tools.
The remaining steps take place inside the virtual machine.
3. Load the CD-ROM driver so the CD-ROM device mounts the ISO image as a volume. Do one of the following.
  • In the system console for a NetWare 6.5 virtual machine, type
  • LOAD CDDVD
  • In the system console for a NetWare 6.0 or NetWare 5.1 virtual machine, type
  • LOAD CD9660.NSS
    4. When the driver finishes loading, you can begin installing VMware Tools. In the system console, type
    vmwtools:\setup.ncf
    When the installation finishes, the message VMware Tools for NetWare are now running appears in the Logger Screen (NetWare 6.5 and NetWare 6.0 guests) or the Console Screen (NetWare 5.1 guests).
    5. Restart the guest operating system. In the system console, type
    restart server