martes, 15 de abril de 2008

LVM

# Enable LVM in disk
pvcreate /dev/sdb

# Create Volume Group
vgcreate storage0 /dev/sdb

# Active Volume Group
vgchange -a y storage0

# Create Logical Volume
lvcreate -l 2047 storage0 -n opt0

# Extend Volume Group
vgextend storage0 /dev/sdb2

# Check Volume Group
vgdisplay

# Extend Logical Volume
lvextend -L+1G /dev/storage0/opt

sábado, 5 de abril de 2008

Configure RSC SUN SPARC

Install:

To OS SOL 9 y 10.

- Enterprise 250
- Sun Fire 280R
- Sun Fire V880
- Sun Fire V480
- Sun Fire V890
- Sun Fire V490

You should install the base Solaris packages and the localization
packages for any locales supported on your system. For your reference,
the packages are:

Download: Click here

SUNWrsc - the RSC base package for installation on the host machine
SUNWrscd - the RSC documentation package
SUNWrscj - the RSC GUI package to be installed on any system wanting
to display the RSC GUI


Procedure:

To unpack for Solaris 9 & Solaris 10:
mkdir /tmp/RSC
unzip -d /tmp/RSC rsc2.2.3_packages_s9.zip
cd /tmp/RSC
pkgadd -d SUNWrsc
pkgadd -d SUNWrscd
pkgadd -d SUNWrscj

Running the rsc-config Script on the Server
On the server systems only, type the following command to configure the new firmware image:

# /usr/platform/`uname -i`/rsc/rsc-config

lunes, 24 de marzo de 2008

OpenVPN en Solaris 11 x86

Como Instalar OpenVPN en OpenSolaris x86 b79 32/64 bits
Este es el proceso empleado para instalar openvpn en
Solaris 11.

Primero debemos instalar las dependencias:

gcc
binutils
gnupg
libgcrypt
libiconv

Estas dependencias se deben Instalar con OpenSolaris Corriendo 64bits,
y utilizando el Package Manager de OpenSolaris, luego de Instalar modificar el grub para
hacer boot con 32bits:

#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title OpenSolaris 2008.11 snv_101b_rc2 X86 32bits
findroot (pool_rpool,3,a)
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
bootfs rpool/ROOT/opensolaris
kernel$ /platform/i86pc/kernel/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/boot_archive

title OpenSolaris 2008.11 snv_101b_rc2 X86 64bits
findroot (pool_rpool,3,a)
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
bootfs rpool/ROOT/opensolaris
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/$ISADIR/boot_archive

title Ubuntu 8.10, kernel 2.6.27-7-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-7-generic root=/dev/sda1 ro quiet splash
initrd /boot/initrd.img-2.6.27-7-generic
#---------------------END BOOTADM--------------------

Luego hacer un Reboot.

$> sync; reboot

Descargar las fuentes de tun/tap y openvpn y algunos
comandos de tun para verificación.
http://vtun.sourceforge.net/tun/tun-1.1.tar.gz
http://openvpn.net/index.php/downloads.html
http://www.whiteboard.ne.jp/~admin2/tuntap/
source/tunctl/tunctl.tar.gz

Compilar e instalar tuntap.
# gzcat tun-1.1.tar.gz | tar xvf –
# cd tun-1.1
 
Adicionar al archivo “Solaris/Makefile” en parámetro
“-m64” en la variable CFLAGS, quedando de la siguiente forma:
 
  CFLAGS = $(DEFS) -m64 -O2 -Wall -D_KERNEL -I.
 
Configurar y Compilar:

# ./configure
# make 
 
Probar el make install, si obtiene algun error como este:
   /usr/sbin/rem_drv tun >/dev/null 2>&1
   /usr/sbin/rem_drv tap >/dev/null 2>&1
   *** Error code 1 (ignored)
   /usr/sbin/add_drv tun   
   /usr/sbin/add_drv tap
 
Hacer la instalacion manual:

# cd solaris
# cp tun /kernel/drv
# cp tun.conf /kernel/drv
 
Configurar tun.
# devfsadm –i tun

Verificar el funcionamiento de tun.

Ejemplo)

Crear la interfaz tap0
   # /usr/local/bin/tunctl -t tap0
   Set 'tap0' persistent
   #
Borrar la interfaz tap0 
   # /usr/local/bin/tunctl -d tap0
   #
Instalar LZO para compresion en Tiempo Real:

# wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.03.tar.gz

# gzcat lzo-2.03.tar.gz | tar xvf lzo-2.03.tar.gz

# gzcat lzo-2.03.tar.gz | tar xvf -

# cd lzo-2.03

# ./configure

# make

# make install



Instalar OpenVPN.

wget http://openvpn.net/release/openvpn-2.0.9.tar.gz
# gzcat openvpn-2.0.9.tar.gz | tar xvf –
# cd openvpn-2.0.9
##### ./configure --disable-lzo  # Para deshabilitar compresion de lzo
# ./configure --with-lzo-lib=/usr/local/lib

# make
# make install
 
Ahora podemos dar un reboot al servidor y verificar
que el tun sube correctamente.
[00:12:38][root@alcatraz /]$sync; reboot 
[00:12:38][root@alcatraz /]$ dmesg | grep -i tun
Mar 24 00:09:47 alcatraz tun: [ID 654686 kern.notice] Universal TUN/TAP device driver ver 1.1 03/23/2008 (C) 1999-2000 Maxim Krasnyansky
Mar 24 00:09:47 alcatraz pseudo: [ID 129642 kern.info] pseudo-device: tun0
Mar 24 00:09:47 alcatraz genunix: [ID 936769 kern.info] tun0 is /pseudo/tun@0
Mar 24 00:09:48 alcatraz tap: [ID 654686 kern.notice] Universal TUN/TAP device driver ver 1.1 03/23/2008 (C) 1999-2000 Maxim Krasnyansky
[00:13:01][root@alcatraz /]$

Crear un archivo de configuración similar a:
 
client
dev tun
proto udp
remote x.x.x.x 1194
resolv-retry infinite
nobind
# Las dos siguientes opciones no van en windows
user nobody
group nobody
 
persist-key
persist-tun
ca ca.crt
cert marco.crt
key marco.key
# comp-lzo
verb 4
 
 
Tener encuenta que esta configuración utiliza certificados digitales,
para lo cual debes haberlos creado con anterioridad.
Y finalmente un script de inicio rapido:
 
# vi /etc/init.d/vpn
Y adicionar acorde donde tengas alojados los certificados digitales.
nohup openvpn --config /export/home/marco/.openvpn/marco.conf &

domingo, 9 de marzo de 2008

Solaris ZFS

1. Crear un pool zfs:

zpool create -f storage0 c2t600A0B800011EF78000057824630B63Fd0s2

2. Chequear que el pool sea creado correctamente:

zpool list

3. Crear dos file system:

zfs create storage0/OraIndices
zfs create storage0/OraDatos

4. Verificar que los file system estan creados y montados correctamente.

zfs list

5. Cambiar los puntos de montura acorde a la necesidades.

zfs set mountpoint=/OraDatos storage0/OraDatos
zfs set mountpoint=/OraIndices storage0/OraIndices

6. Fijar un tamaño al file system.

zfs set quota=20g /OraDatos
zfs set quota=50g /OraDatos

7. Validar el performance:

zpool iostat -v

sábado, 16 de febrero de 2008

how to install virtualbox in ubuntu 7.10

how to install virtualbox in ubuntu 7.10

First you need to install the following packages

sudo apt-get install libxalan110 libxerces27

wget http://www.virtualbox.org/download/1.5.4/virtualbox_1.5.4-27034_Ubuntu_gutsy_i386.deb

Once you download the package you have virtualbox_1.5.4-27034_Ubuntu_gutsy_i386.deb file

Install.deb file using the following command

sudo dpkg -i virtualbox_1.5.4-27034_Ubuntu_gutsy_i386.deb

At the time of installation if you have any dependency problems like the following errors

Selecting previously deselected package virtualbox.
(Reading database … 174459 files and directories currently installed.)
Unpacking virtualbox (from virtualbox_1.5.4-27034_Ubuntu_gutsy_i386.deb) …
dpkg: dependency problems prevent configuration of virtualbox:
virtualbox depends on libxalan110; however:
Package libxalan110 is not installed.
virtualbox depends on libxerces27; however:
Package libxerces27 is not installed.
dpkg: error processing virtualbox (–install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
virtualbox

If you see the above error message you can use the following command to install all the required dependencies

sudo apt-get -f install

This will complete the installation

Starting the VirtualBox Graphical User Interface

If you want to start Virtualbox GUI use the following command from your terminal(Applications—>Accessories— >Termianl)

VirtualBox

Once it opens you should see the following screen

sábado, 9 de febrero de 2008

How to mount iso in solaris 10


a. Create an installation image from the mounted ISO image:

unzip compressed-file.zip
lofiadm -a pathname/image.iso /dev/lofi/1
If /dev/lofi/1 is already in use, refer to the lofiadm (1M) man page.

mkdir mountpoint
mount -F hsfs /dev/lofi/1 mountpoint
cd mountpoint
find . -print | cpio -pdum shared-location/comms5

b. After copying is done, unmount the ISO image:

cd
umount mountpoint
lofiadm -d /dev/lofi/l