viernes, 22 de agosto de 2014

Crear y eliminar particiones con fdisk en Linux

Para crear particiones usando la herramienta fdisk, primero debemos comprobar los discos del sistema disponibles y las particiones que ya haya creadas, para ello utilizamos el parámetro -l:
$ sudo fdisk -l

Disco /dev/sda: 160.0 GB, 160041885696 bytes
255 cabezas, 63 sectores/pista, 19457 cilindros
Unidades = cilindros de 16065 * 512 = 8225280 bytes
Identificador de disco: 0x000c3c51

Dispositivo Inicio    Comienzo   Fin     Bloques  Id  Sistema
/dev/sda2            3233        9855    53199247+  83  Linux
/dev/sda4            9856       19457    77128065   83  Linux
En la salida de fdisk hemos verificado que tenemos un único disco /dev/sda de 160 GB, sobre el cual ya hay dos particiones creadas con sistemas Linux, /dev/sda2 y /dev/sda4. Si nos fijamos bien, vemos que el disco tiene 19457 cilindros y que las particiones comienzan en el 3233, por lo que tenemos espacio libre para crear más si lo deseamos.
Vamos a crear entonces una partición de prueba que utilice el resto de espacio disponible en el disco, comenzamos ejecutando fdisk sobre el disco a utilizar:
$ sudo fdisk /dev/sda
Si pulsamos la m una vez dentro podremos visualizar las distintas opciones con su respectiva letra de ejecución:
Orden  Acción
   a   Conmuta el indicador de iniciable
   b   Modifica la etiqueta de disco bsd
   c   Conmuta el indicador de compatibilidad con DOS
   d   Suprime una partición
   l   Lista los tipos de particiones conocidos
   m   Imprime este menú
   n   Añade una nueva partición
   o   Crea una nueva tabla de particiones DOS vacía
   p   Imprime la tabla de particiones
   q   Sale sin guardar los cambios
   s   Crea una nueva etiqueta de disco Sun
   t   Cambia el identificador de sistema de una partición
   u   Cambia las unidades de visualización/entrada
   v   Verifica la tabla de particiones
   w   Escribe la tabla en el disco y sale
   x   Funciones adicionales (sólo para usuarios avanzados)
Vamos a crear una nueva partición, así que pulsamos “n”:
Orden (m para obtener ayuda): n
Acción de la orden
   e   Partición extendida
   p   Partición primaria (1-4)
Seleccionamos si queremos una partición extendida o primaria, en este caso podemos crearla como primaria, pulsamos “p” y dejamos que automáticamente se configure el número de la partición (se puede especificar, del 1 al 4). Después podemos seleccionar el primer y último cilindro a utilizar para la partición. Como yo voy a usar el resto de espacio disponible será del 1 al 19457 tal y como hemos visto antes, también podríamos indicar el tamaño de la partición en K, M o G. Lo dejamos por defecto en este caso:
p
Número de partición (1-4): 3
Primer cilindro (1-19457, valor predeterminado 1):
Último cilindro, +cilindros o +tamaño{K,M,G} (1-3232, valor predeterminado 3232):
Se está utilizando el valor predeterminado 3232
Ahora escribimos los cambios y salimos de fdisk:
Orden (m para obtener ayuda): w
¡Se ha modificado la tabla de particiones!

Llamando a ioctl() para volver a leer la tabla de particiones.

El núcleo todavía usa la tabla antigua.
La nueva tabla se usará en el próximo reinicio.
Se están sincronizando los discos.
Finalmente debemos ejecutar el comando partprobe para indicar al kernel que vuelva a leer la tabla de particiones:
$ sudo partprobe
Y ya tenemos nuestra nueva partición creada, ahora únicamente faltaría asignar el sistema de ficheros deseado (ext3, ext4, ntfs, etc):
$ sudo fdisk -l

Disco /dev/sda: 160.0 GB, 160041885696 bytes
255 cabezas, 63 sectores/pista, 19457 cilindros
Unidades = cilindros de 16065 * 512 = 8225280 bytes
Identificador de disco: 0x000c3c51

Dispositivo Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/sda2            3233        9855    53199247+  83  Linux
/dev/sda3               1        3232    25961008+  83  Linux
/dev/sda4            9856       19457    77128065   83  Linux
Formateamos la partición como ext4:
$ mkfs.ext4  /dev/sda3
mke2fs 1.41.4 (27-Jan-2009)
mkfs.ext4: Permiso denegado mientras se intentaba determinar el tamaño del sistema de ficheros
alex@sistemas:~$ sudo mkfs.ext4  /dev/sda3
mke2fs 1.41.4 (27-Jan-2009)
Etiqueta del sistema de ficheros=
Tipo de SO: Linux
Tamaño del bloque=4096 (bitácora=2)
Tamaño del fragmento=4096 (bitácora=2)
1623840 nodos-i, 6490252 bloques
324512 bloques (5.00%) reservados para el superusuario
Primer bloque de datos=0
Número máximo de bloques del sistema de ficheros=0
199 bloque de grupos
32768 bloques por grupo, 32768 fragmentos por grupo
8160 nodos-i por grupo
Respaldo del superbloque guardado en los bloques:
 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
 4096000

Escribiendo las tablas de nodos-i: hecho
Creating journal (32768 blocks): hecho
Escribiendo superbloques y la información contable del sistema de ficheros: hecho

Este sistema de ficheros se revisará automáticamente cada 27 montajes o
180 días, lo que suceda primero.  Utilice tune2fs -c o -i para cambiarlo.
Ahora podemos montar la partición y comenzar a usarla:
$ sudo mount //dev/sda3
Vemos que está disponible con el comando df:
$ df -h | grep /dev/sda3
/dev/sda3              25G  172M   23G   1% /test

Eliminar particiones con fdisk

Eliminar una partición usando fdisk es más sencillo que crearla, lo primero que haremos será desmontarla del sistema con el comando umount:
$ sudo umount /dev/sda3
Accedemos de nuevo a la gestión del disco con fdisk:
$ sudo fdisk /dev/sda
Una vez dentro, eliminamos la partición con la letra “d” y seguido el número de la partición, escribimos después los cambios con “w”:
Orden (m para obtener ayuda): d
Número de partición (1-4): 3

Orden (m para obtener ayuda): w
¡Se ha modificado la tabla de particiones!

Llamando a ioctl() para volver a leer la tabla de particiones.
Ejecutamos de nuevo partproble para hacer efectivos los cambios sin reiniciar:
$ sudo partprobe
Y la partición ha sido eliminada, un fdisk -l no devolverá la partición:
$ sudo fdisk -l | grep sda3

martes, 19 de agosto de 2014

Medir circuito rpm



RPM READINGS

In the next pages some sensing circuits are explained. These circuits are currently under test and will be added soon to the base SP1/SP3 products to ease the task of reading ignition on engines
In addition, some ignition systems are explained, and how to read ignition with them

Capacitive RPM sensing circuit

This is the current RPM sensing circuit on the SP1. Ignition pulses goes through the HV cable to the capacitive clamp, and they arrive to the rpm connector on the SP1. There, the signal goes to the top layer of the board and is transmitted by the board capacity through the bottom layer of the board, and then it enters on the circuit.

This is the current ignition circuit in the SP1/SP3



capacitive pickup


Inductive RPM sensing circuit

Current from ignition pulses creates an magnetic field inside the RPM pickup, and this is transformed into a current pulse inside the pickup coil.
The pickup pulse is aplied directly to a SCR (thyristor) that discharges completely the inner capacitor on the SP1, this cause filtered pulses in the line that goes to the SP1 to avoid other short pulses to fire it. The other components placed with the SCR are provided to filter the pickup pulses.
Only current pulses should fire SCR. If you place the inductive pickup near a HV cable, it will catch HV pulses, or EMI pulses. This pulses go through the pickup cable to the conditioning circuit as common mode signals (inside the two wires), but are filtered with the 10 nf capacitor and the resistor to prevent the SCR to be fired.
The 22 pf capacitor, 100K resistor, 1N4148 diode and BC547 transistor has been removed from the current sensing circuit inside SP1. One 47 nf capacitor has been add to prevent the NE555 to be fired with gliches in the line. Only pulses caused by the MCR100 SCR will discharge the capacitor and then will fire the NE555.

Inductive sensing circuit.
Click here to go to the upgrade guide



Inductive pickup
This circuit "measures" ignition current, so it only will read such current pulses of certain level. When used on wasted spark ignitions, two situtacions are present:

1) When engine accelerates, one spark happens when engine is compressing the air-fuel mixture, and then pressure is present inside the cylinder, and the spark needs more voltage to cross the gap, so high energy is present in the HV cable.
The next spark (in the same cylinder) happens when engine is in exhaust phase, then the exhaust valve is opened and then low pressure is present inside the cylinder, thus low voltage is needed to cross the gap, and then the ignition energy is low. Theorically both pulses have the same current but due to a parasitistic capacitive effect each pulse is sensed with different amplitude.


2) When engine is running at high speed, and throttle is closed suddenly, all sparks happens when engine has low pressure, because the throttle is closed and only a few air-fuel mixture is present.
Thus all sparks have low current, and the SCR circuit only senses a few of them. This is shown at the Dynamometer software as a failure on the rpm channel.


Capacitive sensing circuit to be used with modified SP1/SP3 units


Click here to see some sample tests recorded with these circuits



IGNITION TYPES

Click here to see how CDI and TCI works

MULTI CYLINDER ENGINES (How to read rpm?)
Cylinder to get spark is selected with a distributor. This schema is obsolete.
To read RPM in this schema, you only need to place the capacitive clamp on the main HV cable (from coil to distributor). This will pick all RPM pulses (2 sparks per rev), thus you should select "/2" option on the program to get the actual rpm value.


Two cylinders are fired at the same time. One of them is in compression phase, and it fires the air-fuel mixture when spark is made. The other cylinder is in exhaust phase, and spark has no effect over it.
To read RPM in this schema, you only need to place the capacitive clamp on any of the outter HV (1 or 4) taking care that the sensing cable doesn't touch the other HV cables to prevent to catch pulses from the other coil.
This will pick RPM pulses from one coil (1 spark per rev), thus you should select "x1" option on the program to get the actual rpm value.
If pulses from the other coil are often (but not always) catched, readings will be unaccurate. One solution may be to catch wire 1 and wire 2 with the rpm pickup. In this case "/2" option should be used

In this schema each spark has its own coil, and there is no HV cable from the coil to the spark. This schema can be used both for TCI and CDI ignitions. The ECU can fire each spark one by one.
To read RPM the difficulty with the current capacitive method is that the HV pulse is made inside the coil and there is no HV cable, so it is difficult to catch the ignition pulses with the capacitive clamp.
A thick wire can be placed inside the coil going outside it, so the capacitive clamp can be placed over it.
If using an inductive pickup, the current pulses in the coil cables can be read with the pickup. These pulses use to be higher than on HV cable, so readings should be good. Keep in mind that these cables have polarity, one of the is 12 Volt, and the other is switched to ground to charge the coil, so the current only flows in one sense.

How is placed the inductive pickup on the primary?
Here is shown one on-spark coil with the inductive pickup is placed on one of the cables. As the inductive pickup has polarity, it only work when the current cross the black side towards the side with the spark picture (as here)



The two cylinders are fired at the same time (equal as wasted spark), but the firing time is not always the same because the cylinders are in V configuration.
When Cylinder 1 is compressing the mixture, cylinder 2 is starting exhaust phase, so spark in cylinder 2 has no effect. And when cylinder 2 is compressing, cylinder 1 is ending exhaust phase, but no new air-fuel mixture has started to enter, so spark in this moment has not effect.
When read timings it seems to be not steady. For example at 3000 rpm (20 ms), timing will be: 25 ms, 15 ms, 25 ms, 15 ms, and so on...
We has solved this problem in the SP1 and SP3 by group always two samples:
(25 + 15)/2 = 40 / 2 = 20 ms -> 3000 rpm
and if sequence is taken backwards it works too:
(15 + 25)/2 = 40 / 2 = 20 ms -> 3000 rpm
no sample, at the moment


Fuente
http://www.sportdevices.com/rpm_readings/index.htm

Route add en centos

Alternatively, you can use old good route command:
# route add -net 192.168.55.0 netmask 255.255.255.0 gw 192.168.1.254 dev eth1