Jeudi 26 avril 2012 4 26 /04 /Avr /2012 08:24

I've installed an openfiler on the KVM with directe access to disk.

 

I use a file to hold the Virtaul machine and I give it a directe acess to disk /dev/hda and /dev/hdb

 

1 - Generate the VM

 

cat <EOF>>/srv/VM/openfiler29.sh
#!/bin/bash

NAME='openfiler29'
DISK='5'
ISO='/srv/VM/ISO/openfileresa-2.99.1-x86_64-disc1.iso'

virt-install \
-n${NAME} \
--description 'OpenFiler 2.99' \
--ram 512 \
--vcpus=1 \
--autostart \
--os-type linux \
--hvm \
--accelerate \
-v \
--network bridge=br0,model=virtio \
--disk path=/srv/VM/OS/lv_${NAME}_os.qcow2,size=${DISK} \
-c ${ISO} \
--vnc --vnclisten=0.0.0.0 --vncport=5901\
-k fr-fr

EOF


we finish by connecting to the VM with vnc on port 5901.
I suggest to add an ssh authentification to do the rest of the configuration remotely (lots of documentation about this on the web)

2 - update the openfiler

Here are some command to do have the last version

conary update conary
conary updateall
conary update openfiler

add some package
conary install patch testdisk

 

3 - correction and modification

 

RAID-1(from : http://www.everything-virtual.com/?p=349)

conary update mdadm=openfiler.rpath.org@rpl:devel/2.6.4-0.2-1
ln -s /sbin/lvm /usr/sbin/lvm

 

Virtual drive in openfiler those show by the use of virtio. We need to had some line in /opt/openfiler/sbin/list-disks.pl

I've done a small patch. you can apply this way :

 

cd /opt/openfiler/sbin/

conary install patch
patch -bR -p1 /opt/openfiler/sbin/list-disks.pl< ./list-disks.pl.patch
chown openfiler.openfiler /opt/openfiler/sbin/list-disks.pl
chmod 755 /opt/openfiler/sbin/list-disks.pl

 

cat list-disks.pl.patch

 

--- list-disks.pl    2012-04-22 14:24:14.000000000 +0200
+++ /opt/openfiler/sbin/list-disks.pl    2009-05-16 19:07:57.000000000 +0200
@@ -188,11 +188,6 @@
             # Promise raid controller
             push(@devs, "/dev/$1");
         }
-        elsif (/\d+\s+\d+\s+\d+\s+vd(\S)\s/ || /\d+\s+\d+\s+\d+\s+vd(\S\D)\s/) {
-             # virtio raid device
-             local $d = $1;
-             push(@devs, "/dev/vd$d");
-         }
     }
    
     close(PARTS);
@@ -329,11 +324,7 @@
                 $disk->{'desc'} = &text('select_device', 'IDE', uc($1));
                 $disk->{'type'} = 'ide';
             }
-            elsif ($disk->{'device'} =~ /\/vd(\S)$/) {
-                # VIRTIO disk
-                $disk->{'desc'} = &text('select_device', 'IDE', uc($1));
-                $disk->{'type'} = 'ide';
-            }   
+           
             elsif ($disk->{'device'} =~ /\/xvd(\S)$/) {
                 # Xen disk
                 $disk->{'desc'} = &text('select_device', 'IDE', uc($1));

 

3 -

 

change the Virtual MAchine definition to allow access to disk directly

 

virsh dumpxml openfiler29 >openfiler29.xml

 

root@HostVm:/srv/VM# cat openfiler29.xml
<domain type='kvm' id='15'>
  <name>openfiler29</name>
  <uuid>e16ff78f-ac6b-f35e-a31d-f8b0a547db5d</uuid>
  <description>OpenFiler 2.99</description>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-1.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/srv/VM/OS/lv_openfiler29_os.qcow2'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdd' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/dev/sda'/>
      <target dev='hdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/dev/sdb'/>
      <target dev='hdc' bus='virtio'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:95:ec:fc'/>
      <source bridge='br0'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/4'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/4'>
      <source path='/dev/pts/4'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5901' autoport='no' listen='0.0.0.0' keymap='fr'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='apparmor' relabel='yes'>
    <label>libvirt-e16ff78f-ac6b-f35e-a31d-f8b0a547db5d</label>
    <imagelabel>libvirt-e16ff78f-ac6b-f35e-a31d-f8b0a547db5d</imagelabel>
  </seclabel>
</domain>

 

update openfiler29 VM

 

virsh dumpxml openfiler29 >openfiler29.xml

virsh shutdown openfiler29

virsh define openfiler29.xml

virsh start openfiler29

 

 

4 - active directory Integration

Copy and past from an other web site http://www.ozziks.com/2008/12/13/join-openfiler-to-active-directory/

Par nitocris - Publié dans : Linux
Ecrire un commentaire - Voir les 0 commentaires
Samedi 31 mars 2012 6 31 /03 /Mars /2012 07:36

Une installation en 32-bits sur Natty (11.04)

 

sudo apt-get install build-essential
cd ~/temp
https://sites.google.com/a/hunny.be/www/epson-alc1100-filter_1.2-1_i386.deb
wget https://sites.google.com/a/hunny.be/www/epson-alc1100-filter-cups_1.2-1_i386.deb
wget http://fr.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-24ubuntu1_i386.deb
sudo dpkg --force-architecture --force-depends -i libstdc++5_3.3.6-24ubuntu1_i386.deb
sudo dpkg --force-architecture --force-depends -i epson-alc1100-filter-cups_1.2-1_i386.deb
sudo dpkg --force-architecture --force-depends -i epson-alc1100-filter_1.2-1_i386.deb

sudo invoke-rc.d cups restart
cd -

 

Une installation en mode 64-bits sur Precise Pangolin (12.04 beta2)

 

sudo apt-get install build-essential
mkdir ~/temp
cd ~/temp

wget https://sites.google.com/a/hunny.be/www/epson-alc1100-filter-cups_1.2-1_i386.deb
sudo dpkg --force-architecture --force-depends -i epson-alc1100-filter_1.2-1_i386.deb
wget http://fr.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-24ubuntu1_i386.deb
sudo dpkg -x libstdc++5_3.3.6-24ubuntu1_i386.deb .
sudo cp -a usr/lib/i386-linux-gnu/libstdc++.so.5* /usr/lib32/
sudo dpkg --force-architecture --force-depends -i libstdc++5_3.3.6-24ubuntu1_i386.deb
sudo dpkg --force-architecture --force-depends -i epson-alc1100-filter-cups_1.2-1_i386.deb
sudo dpkg --force-architecture --force-depends -i epson-alc1100-filter_1.2-1_i386.deb

sudo apt-get install -f

sudo invoke-rc.d cups restart

 

Par nitocris - Publié dans : Linux
Ecrire un commentaire - Voir les 0 commentaires
Dimanche 25 mars 2012 7 25 /03 /Mars /2012 11:25

Un check du disque indique une erreur physique :

root@freenas:~# smartctl -l selftest /dev/sdc
smartctl 5.40 2010-03-16 r3077 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed: read failure 90% 2675 821561257

On relance le test pour avoir une information recente :

 

root@freenas:/var/lib/ntp# smartctl -t short /dev/sdc
smartctl 5.40 2010-03-16 r3077 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 2 minutes for test to complete.
Test will complete after Sun Mar 25 11:49:00 2012

Use smartctl -X to abort test

 

Quelques minutes après

 

root@freenas:/var/lib/ntp# smartctl -l selftest /dev/sdc
smartctl 5.40 2010-03-16 r3077 [i686-pc-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed: read failure 90% 2677 821561257
# 2 Short offline Completed: read failure 90% 2675 821561257

 

 

On verifie si les espace on déjà été réalloués :ici ce n'est pas le cas, les valeurs son à 0

 

root@freenas:~# smartctl -A /dev/sdc |grep Reallocated
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

5 Reallocated_Sector_Ct 0x0033 252 252 010 Pre-fail Always - 0
196 Reallocated_Event_Count 0x0032 252 252 000 Old_age Always - 0

On Verifie sur quelle partition : ici /dev/sdc5

root@freenas:~# fdisk -lu /dev/sdc

Disque /dev/sdc: 1000.2 Go, 1000204886016 octets
255 têtes, 63 secteurs/piste, 121601 cylindres, total 1953525168 secteurs
Unités = secteurs de 1 * 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d'E/S (minimale / optimale) : 512 octets / 512 octets
Identifiant de disque : 0x000c9c9b

Périphérique Amorce Début Fin Blocs Id Système
/dev/sdc1 2048 4196351 2097152 82 Linux swap / Solaris
La partition 1 ne se termine pas sur une frontière de cylindre.
/dev/sdc2 30371840 1953523711 961575936 5 Étendue
/dev/sdc3 * 4196352 30371839 13087744 83 Linux
/dev/sdc5 30373888 1953523711 961574912 83 Linux

 

On verifie le type de formatage

 

root@freenas:~# blkid | grep /dev/sdc5
/dev/sdc5: UUID="d970d235-6438-43d9-b6dc-8904c67ca05e" TYPE="reiserfs"

 

On demonte la paritition et on effectue un check "rapide" en lecture

 

root@freenas:~# umount /dev/sdc5
root@freWill read-only check consistency of the filesystem on /dev/sdc5
Will put log info to 'stdout'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
enas:~# reiserfsck /dev/sdc5
###########
reiserfsck --check started at Sun Mar 25 11:03:39 2012
###########
Replaying journal: Done.
Reiserfs journal '/dev/sdc5' in blocks [18..8211]: 0 transactions replayed
Checking internal tree.. finished
Comparing bitmaps..finished
Checking Semantic tree:
finished
No corruptions found
There are on the filesystem:
Leaves 164119
Internal nodes 987
Directories 190
Other files 1810
Data block pointers 165948281 (70011999 of them are zero)
Safe links 0
###########
reiserfsck finished at Sun Mar 25 11:20:05 2012
###########

 

Reparation

source : http://smartmontools.sourceforge.net/badblockhowto.html

[Step 1] On recupere la taille des secteurs

root@freenas:~# debugreiserfs /dev/sdc5 | grep '^Blocksize'
debugreiserfs 3.6.21 (2009 www.namesys.com)
Blocksize: 4096

[Step 2] On calcul le nombre de secteurs

Le debut de la partition : 30373888

Le secteur en erreur : 821561257

Taille des block : 4096

# echo "(821561257-30373888)*512/4096" | bc -l
98898421.12500000000000000000

On Verifie que cette valeur est plus petite que le nombre de block de la partition (98 898 421<=240 393 728)


root@freenas:~# debugreiserfs /dev/sdc5 | grep "Count of blocks on the device"
debugreiserfs 3.6.21 (2009 www.namesys.com)

Count of blocks on the device: 240393728

[Step 3] On cherche des infos sur ce block

root@freenas:~# debugreiserfs -l 98898421 /dev/sdc5
debugreiserfs 3.6.21 (2009 www.namesys.com)

Filesystem state: consistent

 

Ici il semble qe le block ne soit pas alloué.

 

Alors on fait une recherche autour en mode non destructif :

 

root@freenas:~# badblocks -b 4096 -p 3 -s -v -n /dev/sdc5 `expr 98898421 + 100` `expr 98898421 - 100`
Vérification des blocs défectueux dans un mode non destructif de lecture-écriture
Du bloc 98898321 au bloc 98898521

[Step 4-A] Reallocation

On trouve aucun secteur defectuex, alors on force la ré-alloction : 
root@freenas:/var/lib/ntp# dd if=/dev/zero of=/dev/sdc5 count=1 bs=4096 seek=98898421
1+0 enregistrements lus
1+0 enregistrements écrits
4096 octets (4,1 kB) copiés, 0,000565237 s, 7,2 MB/s


[Step 4-A] Error

root@freenas:~# badblocks -b 4096 -p 3 -s -v -n /dev/sdc5 $((98982613+10)) $((98982613-10))
Vérification des blocs défectueux dans un mode non destructif de lecture-
écriture
Du bloc 98982603 au bloc 98982623
Vérification des blocs défectueux (test non destructif de lecture-écriture)
Test en cours avec un motif aléato989826130% effectué, 0:19 écouléulé
complété
Passe complétée, 1 blocs défectueux repérés.

debugreiserfs -1 98982613 /dev/sdc5
debugreiserfs 3.6.21 (2009 www.namesys.com)

98982613 is used in ondisk bitmap

bread: Cannot read the block (98982613): (Input/output error).

Abandon



Par nitocris - Publié dans : Linux
Ecrire un commentaire - Voir les 0 commentaires
Lundi 30 janvier 2012 1 30 /01 /Jan /2012 19:27

Le L293 est un "QUADRUPLE HALF-H DRIVERS". Le L293D petite version du L293. Le L293D Il supporte 600mA par canal, comme on utilise un moteur bipolaire ça fait 2*600mA. i lpossède des diodes qui proteges les ligne ce qui le rend souple d'utilisation.

Son rendement est mediocre, seulement 40%.

 

Si on a besion de plus de puissance, 2 solutions :

1 - remplacer le L293 par un SN754410 directement broche pour broche

2 - emplier un L293d sur un autr eL293D en soudant les pattes l'une sur l'autre.

 

On va se contenter d'un seul L293D, le but étant de faire une moteur de Robofocus, pas un grille pain.

 

Pour le moteur : un ST2818M1006-B - MOTEUR PAS A PAS 0.9DEG. 2 PHASES, alimentaition en 4.56V (presque 5V), 670mA/phase , couple 10.6N.cm, poids 176gr. avec un petite demultiplication d'au moins 1:6 on arrive à la cible

Par nitocris
Ecrire un commentaire - Voir les 0 commentaires
Vendredi 6 janvier 2012 5 06 /01 /Jan /2012 17:34

 

Le L293D est un "Quadruple Half-H drivers". capable de drivesr une moteur à raison de 600mA par ligne.

 

connexion entre les 2

 

Caractéristique du moteur 28byj48, c'estun motuer unipolaire à 4 enroulements : link

 

 

 

Et Son cablage :

A0191-3.jpg

 

Cablage de la carte : link ou autre cas : link

 

Exemple de cablage sur une carte avec uln2003 :

  stepper3.jpg

 

Schéma de cablage typique L293D

Le Port 2 du moteur est commun avec le 5, c'est le fil rouge du moteur.

Le 1 => fil Rose

Le 3 => Orange

Le 4 => Jaune

Le 6=> Bleu

 

 

 

 

l293d-stepper.gif

On note ques les ports P4 et P5 son inversé.

Rose =>P1=>3=>1Y

Orange =>P2=>6=>2Y

Rouge =>P3=>GND

Bleu=>P4=>14=>Y4

Jaune=>P5=>11=>Y3

mshieldv1-schem-b-copie-1

 

PS : j'ai inversé le Rose et le Orange à la fin.

 

 

Après essais :

- Le moteur est lent

- il ne supporte pas le MCIROSTEPPING.

- pour une maquette c'est plutot facile à utiliser.

 

Model Rated Voltage(DCV) Resistance Ω/Phase(at25ºC) Max.Freeload Pull-in Frequency(PPS) Max.Freeload Pull-out Frequency(PPS) Pull-in Torque(mN.m) Operation Frequency(PPS)  Detent Torque(mN.m)  Tempera-ture Rise(K) Noise(dB)  Step Angle(1-2phase) 
Insulation
Class 
28BYJ48 5 60 ≥500 ≥900 ≥29.4 100  ≥29.4 ≤40 ≤35 5.625°/64 E
28BYJ48 12 130 ≥500 ≥900 ≥44.1 100  ≥29.4 ≤40 ≤35 5.625°/64 E
28BYJ48 12 200 ≥500 ≥900 ≥34.3 100  ≥29.4 ≤40 ≤35 5.625°/64 E
28BYJ48 12 250 ≥500 ≥900 ≥34.3 100  ≥29.4 ≤40 ≤35 5.625°/64 E
28BYJ48 12 300 ≥500 ≥900 ≥34.3 100  ≥29.4 ≤40 ≤35 5.625°/64 E
28BYJ48 12
320
≥500 ≥900 ≥29.4 100  ≥29.4 ≤40 ≤35 5.625°/64 E
28BYJ48 12 380 ≥500 ≥900 ≥29.4
100
≥29.4 ≤40 ≤35 5.625°/64 E
Par nitocris - Publié dans : RoboFocus
Ecrire un commentaire - Voir les 0 commentaires
 
Créer un blog gratuit sur over-blog.com - Contact - C.G.U. - Rémunération en droits d'auteur - Signaler un abus