RAID(X) – OMV

Crear un RAID 1 en Linux (Ubuntu)

Con mdadm se puede crear un RAID 1 y poner dos discos «clonados». Si falla uno seguirá el otro, sin cortes de funcionamiento.

La herramienta mdadm (algo así como Multi Device Administrator) permite crear RAID de varios niveles (organizaciones de los datos entre los discos) y es la que utilizo en este artículo.

El RAID de nivel 1 (o RAID 1) consiste duplicar la información en dos discos duros. Ambos discos duros tienen exactamente el mismo contenido, de forma que si uno deja de funcionar, el otro sigue funcionando sin que ningún usuario note nada. En cuanto se reemplace el disco erróneo, ambos discos volverán a sincronizarse (guardar los mismos datos) y el sistema volverá a estar duplicado. Salvo que se estropeen los dos discos duros a la vez, el sistema no dejará de funcionar.

En el ejemplo he utilizado dos discos duros de 80GB (aproximadamente) para crear el RAID. Los discos son /dev/sda y /dev/sdb. El RAID resultante se llama /dev/md0. El sistema operativo es Ubuntu y lo tengo instalado en un disco de 40GB (/dev/sdc) que no influye en este artículo. Todos los discos duros son muy antiguos puesto que son para hacer pruebas.

Otros artículos relacionados

En mi web hay varios artículos relacionados con RAID:

Preparación del sistema

Tengo un artículo que explica cómo identificar discos duros en Linux.

Primero es necesario conocer los nombres de los discos duros. Personalmente suelo hacer un listado del directorio /dev/disk/by-id para mostrarme los discos duros y ver un pequeño nombre descriptivo de cada uno, lo cual me permite identificarlos.

root@wasge-raid:~# ls -l /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root  9 abr  5 16:48 ata-Maxtor_6L080L0_L25CTR1G -> ../../sda
lrwxrwxrwx 1 root root 10 abr  5 16:48 ata-Maxtor_6L080L0_L25CTR1G-part1 -> ../../sda1
lrwxrwxrwx 1 root root  9 abr  5 16:48 ata-ST340014A_5JVJX771 -> ../../sdc
lrwxrwxrwx 1 root root 10 abr  5 16:48 ata-ST340014A_5JVJX771-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 abr  5 16:48 ata-ST340014A_5JVJX771-part2 -> ../../sdc2
lrwxrwxrwx 1 root root 10 abr  5 16:48 ata-ST340014A_5JVJX771-part5 -> ../../sdc5
lrwxrwxrwx 1 root root  9 abr  5 16:48 ata-ST380011A_4JV0DD60 -> ../../sdb
lrwxrwxrwx 1 root root 10 abr  5 16:48 ata-ST380011A_4JV0DD60-part1 -> ../../sdb1

De ésta información se deduce que tengo tres discos duros con sus particiones:

  • /dev/sda es un Maxtor 6L080L0
    • /dev/sda1 es la primera partición.
  • /dev/sdb es un Seagate ST380011A
    • /dev/sdb1 es la primera partición.
  • /dev/sdc es un Seagate ST340014A
    • /dev/sdc1 Es la primera partición
    • /dev/sdc2 Es la segunda partición
    • /dev/sdc5 Es la tercera partición.

En mi caso, /dev/sda y /dev/sdb son dos discos duros (Maxtor y Seagate) de aproximadamente 80GB. Al no ser exactamente del mismo tamaño, el RAID 1 se creará de tamaño ligeramente inferior al disco más pequeño. /dev/sdc es un disco de 40GB utilizado para el sistema operativo.

Yo he utilizado la herramienta gparted (gráfica, sin comandos) para eliminar todas las particiones existentes en los dos discos duros usados en el RAID (/dev/sda y /dev/sdb) y crear una sola partición primaria en cada uno. Las particiones creadas son /dev/sda1 y /dev/sdb1.

Después hay que instalar (si no está instalada) la herramienta mdadm para gestionar el RAID.

apt-get install mdadm

Crear el RAID 1 con mdadm

Estos comandos deberían funcionar en la mayoría de distribuciones linux, tanto para crear un RAID 1 en Ubuntu Server como crear un RAID 1 en Raspbian, puesto que se usa mdadm, el cual está disponible en casi todas.

Una vez preparado el sistema se crea el RAID. Aquí explico el comando utilizado:

  • mdadm (Herramienta para gestionar el RAID)
    • --create (Crear un RAID)
    • --verbose (Mostrar texto para indicar el proceso)
    • /dev/md0 (El nombre del nuevo RAID, tradicionalmente se utiliza md0)
    • --level=1 (Nivel del RAID, en este caso nivel 1)
    • --raid-devices=2 (Cuántos dispositivos se utilizan, en este caso dos discos duros)
    • /dev/sda1 (Nombre de la primera partición del primer disco duro)
    • /dev/sdb1 (Nombre de la primera partición del segundo disco duro)

Se ejecuta el comando y empieza el proceso. Es bastante rápido, prácticamente instantáneo, pero una vez creado el sistema tardará bastantes minutos en sincronizar ambos discos por primera vez.

root@wasge-raid:~# mdadm --create --verbose  /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm: /dev/sda1 appears to contain an ext2fs file system
    size=80041984K  mtime=Thu Jan  1 01:00:00 1970
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
mdadm: /dev/sdb1 appears to contain an ext2fs file system
    size=78148608K  mtime=Thu Jan  1 01:00:00 1970
mdadm: size set to 78082944K
mdadm: largest drive (/dev/sda1) exceeds size (78082944K) by more than 1%
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.

Una vez hecho esto, el sistema empezará a sincronizar los dos discos duros. Ahora mismo empieza el proceso de sincronización entre ambos discos.

Ver estado del RAID 1

Para ver los detalles del RAID se utiliza el comando mdadm –detail y se especifica el RAID que se quiere consultar.

root@wasge-raid:~# mdadm --detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Sat Apr  4 22:29:10 2015
     Raid Level : raid1
     Array Size : 78082944 (74.47 GiB 79.96 GB)
  Used Dev Size : 78082944 (74.47 GiB 79.96 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Tue Jan  1 01:18:09 2002
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : wasge-raid:0  (local to host wasge-raid)
           UUID : eaacaecd:db26f692:11bc71b2:a879bb4c
         Events : 54

    Number   Major   Minor   RaidDevice State
       2       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1

En la parte inferior aparecen listados los dos discos duros como «active sync», es decir, activos y sincronizados. Durante el proceso de sincronización aparecen datos diferentes.

Las fechas y horas del ejemplo no son coherentes debido a errores del ordenador en el que lo probé.

También se puede obtener información del RAID con otro comando, el cual genera información más detallada cuando se están sincronizando los discos. El comando es cat /proc/mdstat. Una vez sincronizados los discos debería generar alfo similar a esto:

root@wasge-raid:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 sdb1[1] sda1[2]
      78082944 blocks super 1.2 [2/2] [UU]
      
unused devices: <none>

Configuración permanente de mdadm

Aparentemente, si se deja así, al reiniciar el servidor el RAID pasará a llamarse /dev/md127. Para evitarlo hay que guardar los datos del RAID en un archivo de configuración de mdadm.

Para ello se necesita el UUID del RAID, el cual se muestra con el comando mdadm --detail /dev/md0 o mdadm --detail/dev/md127. En mi caso es eaacaecd:db26f692:11bc71b2:a879bb4c.

Hay que editar el archivo de configuración de mdadm. El archivo es /etc/mdadm/mdadm.conf y contiene algo así.

# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays

# This file was auto-generated on Sat, 04 Apr 2015 22:14:21 +0200
# by mkconf $Id$

Debajo de la línea «definitions of existing MD arrays» no hay nada. Y ahí está el problema. Hay que especificar cuál es el RAID para que el sistema siga maneniendo el nombre que se le ha asignado (en este caso /dev/md0). El contenido de la línea en éste ejemplo es:

# definitions of existing MD arrays
ARRAY /dev/md0 UUID=eaacaecd:db26f692:11bc71b2:a879bb4c

Desde ese momento, al reiniciar el sistema operativo, el RAID se seguirá llamando /dev/md0

Formatear el nuevo RAID

El RAID ya está creado, ahora hay que formatearlo para poder empezar a utilizarlo. En el ejemplo he utilizado el sistema de archivos EXT 4.

mkfs.ext4 /dev/md0

Ahora ya está el RAID creado y formateado, pero estaría bien poder hacer algo con él, así que habrá que montarlo.

Montar el nuevo RAID

Para montarlo se puede utilizar un comando temporal, que durará hasta la próxima vez que se reinicie el sistema o hasta que se desmonte. El comando para montarlo es mount y el comando para desmontarlo es umount.

mount /dev/md0 /mnt/minuevoraid

En caso de que no haya habido problemas, la carmeta /mnt/minuevoraid contiene 80GB de espacio y es como cualquier otra carpeta del sistema, perfectamente funcional y sin ningún tipo de restricción.

Una vez probado, para dejarlo permanentemente en cuanto arranque el sistema operativo se puede añadir el «punto de montaje» en fstab. Para ello hay que editar el archivo /etc/fstab y añadir la línea:

/dev/md0 /mnt/minuevoraid ext4 defaults

Y fin. Después de esto todo debería funcionar a la perfección. Si no es así, por favor, ponte en contacto conmigo e intentaré ayudarte a resolver cualquier duda.

All together now: Notes on Session 8 of TED2020

It’s been an unforgettable eight weeks of TED2020, the first-ever virtual TED conference. For the final session: a call to moral leadership, a rethink on what it means to be a citizen, some pointers on how to make a good argument from a Supreme Court litigator and much more. Below, read a recap of the inspiring ideas by amazing speakers (and check out the full coverage of the conference here).

“If you make a good argument, it has the power to outlive you, to stretch beyond your core, to reach future minds,” says Supreme Court litigator Neal Katyal. He speaks at TED2020: Uncharted on July 9, 2020. (Photo courtesy of TED)

Neal Katyal, Supreme Court litigator

Big idea: Empathy and long-term drive are key to crafting persuasive and successful arguments.

Why? Winning an argument isn’t just about drowning out an opponent or proving them wrong — it’s about leveraging empathy and human connection to draw a comprehensive understanding of the circumstance and, ultimately, highlight the most just solution. As a Supreme Court litigator, Neal Katyal has argued some of the most impactful cases of recent history, including the case against the 2017 Muslim travel ban and the case against waterboarding and Guantanamo Bay military tribunals. In his experience, he realized that while good courtroom practices include extensive practice and avoiding displays of emotion, crafting a successful argument takes more. Sometimes arguments fail — and it’s at that moment of failure that empathy is most important. Katyal hasn’t won every case he’s argued, but through failure he’s been able to better understand the core of his work and refine his arguments to resonate more deeply. By drawing strength and drive from our personal histories and principles, we can identify why our arguments advance justice and how we can articulate it more clearly to our opponents. “The question is not how to win every argument — it’s how to get back up when we lose,” Katyal says. “In the long run, good arguments will win out. If you make a good argument, it has the power to outlive you, to stretch beyond your core, to reach future minds. Even if you don’t win right now, if you make a good argument, history will prove you right.”


“America is above all an idea, however unrealized and imperfect, one that only exists because the first settlers came here freely without worry of citizenship,” says immigrant rights advocate Jose Antonio Vargas. He speaks at TED2020: Uncharted on July 9, 2020. (Photo courtesy of TED)

Jose Antonio Vargas, immigrant rights advocate

Big idea: Americans need to identify their own immigrant narratives — and overturn their preconceived notions of what it means to be a citizen.

How? If you live in the United States and are not a Native American (whose ancestors were already in North America when the first European settlers arrived) or an African American (whose ancestors were brought to the US by force), you are the descendant of an immigrant — and chances are you haven’t thought enough about what American citizenship means, says Jose Antonio Vargas. “What most people don’t understand about immigration is what they don’t understand about themselves — their family’s old migration stories and the processes they had to go through before green cards and walls even existed, or what shaped their understanding of citizenship itself,” he says. By asking yourself three questions — “Where did you come from?” “How did you get here?” and “Who paid?” — Vargas believes that people can come to realize that citizenship doesn’t mean simply being accepted into a society by an accident of birth or a rule of law; it also means participating in and contributing to a community, and educating others. And it demands that we become something greater than ourselves: citizens who are ultimately responsible to each other.


Abena Koomson-Davis performs “People Get Ready” and “Love in Need of Love” at TED2020: Uncharted on July 9, 2020. (Photo courtesy of TED)

Performer, educator and wordsmith Abena Koomson Davis keeps the session moving with a capella performances of “People Get Ready” and “Love in Need of Love.”


“Let this be our moment to move forward with the fierce urgency of a new generation, fortified with our most profound and collective wisdom,” says Jacqueline Novogratz, founder and CEO of Acumen. She speaks at TED2020: Uncharted on July 9, 2020. (Photo courtesy of TED)

Jacqueline Novogratz, founder and CEO of Acumen

Big idea: We must start the hard, long work of moral revolution, putting our shared humanity and the sustainability of the earth at the center of our systems and prioritizing the collective instead of the individual.

How? Our problems are interdependent and entangled. To fix them, we need more than a systems shift — we need a mindshift, says Jacqueline Novogratz. Pulling from her storied career empowering people in underdeveloped communities worldwide, she shares some of the wisdom and knowledge she’s earned in transforming her own unbridled optimism into hard-edged hope and lasting change. For humanity to spark its own moral revolution, we need an entirely new set of operating principles, of which she offers three to start: moral imagination, in seeing people equal to ourselves, neither idealizing or victimizing; holding opposing values in tension, with leaders cultivating trust by making important decisions in service of others, not themselves; and accompaniment, encouraging others to join in and walk along the side of morality. This work may seem tough, but Novogratz reminds us that we don’t change in the easy times, we change in the difficult times. Discomfort can be seen as a proxy for progress. “Let this be our moment to move forward with the fierce urgency of a new generation, fortified with our most profound and collective wisdom” she says. “And ask yourself: What can you do with the rest of today, and the rest of your life, to give back to the world more than you take?”


Eric Whitacre introduces “Sing Gently,” an original composition performed by a virtual choir made up of singers from across the globe. He speaks at TED2020: Uncharted on July 9, 2020. (Photo courtesy of TED)

Eric Whitacre, composer and conductor

Big idea: A virtual choir — representing 17,572 singers across 129 countries — can show us how connected we all still are.

How? When the COVID-19 crisis hit, Whitacre felt compelled to create a virtual choir. (Check out his epic performance from TED2013 to hear what that sounds like.) He wanted to make a kind of music to help the world heal, to encourage a gentle way of living with each other. So he composed “Sing Gently,” a piece inspired by the Japanese art form kintsugi — the art of repairing broken pottery with gilded epoxies, thereby illuminating the pottery’s “wounds,” as opposed to hiding them. Whitacre hopes that his staggeringly large virtual choir, spliced together with contributions of singers across the globe, will have the same kind of effect on our torn social fabric. “When we are through all of this, we will be stronger and more beautiful because of it,” he says.


“I truly feel that if all of us took care of the earth as a practice, as a culture, none of us would have to be full-time climate activists,” says Xiye Bastida. She speaks at TED2020: Uncharted on July 9, 2020. (Photo courtesy of TED)

Xiye Bastida, climate activist

Big idea: Humanity needs to cultivate the heart and courage to love the world.

How? In a letter to her abuela, Xiye Bastida reflects on being a leading voice of youth climate activism and Indigenous and immigrant visibility. Bastida’s days are occupied with mobilizing masses in New York City to join the climate movement, joining Greta Thunberg’s global climate strike and becoming fluent in climate science (all while sacrificing the normal activities of a teenager). “I do this work because you showed me that resilience, love and knowledge are enough to make a difference,” she writes to her abuela. Bastida shows us that, with unwavering commitment rooted in love, we are capable of igniting far more than we can imagine. “People make it so easy for me to talk to them, but they make it so hard for me to teach them,” Bastida says. “I want them to have the confidence to always do their best. I want them to have the heart and the courage to love the world.”

from TED Blog https://ift.tt/2WeTfOM

Go sailing with this stop-motion 3D-printed boat

Shot on a Raspberry Pi Camera Module, this stop-motion sequence is made up of 180 photos that took two hours to shoot and another hour to process.

The trick lies in the Camera Module enabling you to change the alpha transparency of the overlay image, which is the previous frame. It’s all explained in the official documentation, but basically, the Camera Module’s preview permits multiple layers to be rendered simultaneously: text, image, etc. Being able to change the transparency from the command line means this maker could see how the next frame (or the object) should be aligned. In 2D animation, this process is called ‘onion skinning’.

You can see the Raspberry Pi Camera Module on the bottom left in front of Yuksel’s hand

So why the Raspberry Pi Camera Module? Redditor /DIY_Maxwell aka Yuksel Temiz explains: “I make stop-motion animations as a hobby, using either my SLR or phone with a remote shutter. In most cases I didn’t need precision, but some animations like this are very challenging because I need to know the exact position of my object (the boat in this case) in each frame. The Raspberry Pi camera was great because I could overlay the previously captured frame into the live preview, and I could quickly change the transparency of the overlay to see how precise the location and how smooth the motion.”

Stringing!!! 🙂 … these are actual prints, Ender 3 Pro’s horse-to-horse reproducibility is pretty good. from r/3Dprinting

You can easily make simple, linear stop-motion videos by just capturing your 3D printer while it’s doing its thing. Yuksel created a bolting horse (above) in that way. The boat sequence was more complicated though, because it rotates, and because pieces had to be added and removed.

The official docs are really comprehensive and span basic to advanced skill levels. Yuksel even walks you through getting started with the installation of Raspberry Pi OS.

Yuksel’s Raspberry Pi + Lego microscope

We’ve seen Yuksel’s handiwork before, and this new project was made in part by modifying the code from the open-source microscope (above) they made using Raspberry Pi and LEGO. They’re now planning to make a nice GUI and share the project as an open-source stop-motion animation tool.

The post Go sailing with this stop-motion 3D-printed boat appeared first on Raspberry Pi.

Noticia Original

The Hayes Chronograph, a remake for 2020

smbakeryt built his own Hayes Chronograph:

I’ve always wanted a Hayes Chronograph, but have never been able to acquire one, so I finally broke down and just made my own. The Hayes Chronograph was a compliment to Hayes line of smart modems, and implemented a real time clock for computers that didn’t have a built-in clock. They were popular in the early 1980s, and became less popular as computers began to either come with clocks built in, or add-on boards with clocks became popular. My “remake” keeps the theme of having a Vacuum Fluorescent Display (VFD), but switches to a GPS as a source of time synchronization. A raspberry pi is used as control — this thing could be used as an NTP server!. My design retains the DB25 for communication with the host computer, and attempts to replicate the original Hayes protocol.

See the full post at smbaker.com.

from Dangerous Prototypes https://ift.tt/38XD6SX