Re: [FUG-BR] gmirror em slice
acho que isso vai resolver e fazer automático para você # switch to /bin/sh as this script uses Bourne-Shell syntax exec /bin/sh # make step-by-step list more reusable by allowing the two disk devices # and the resulting mirror device to be adapted to the local situation d1=ad0; d2=ad1; gm=gm0 # make sure the second disk is treated as a really fresh one dd if=/dev/zero of=/dev/${d2} bs=512 count=79 # place a PC MBR onto the second disk with a single FreeBSD slice # /dev/mirror/${gm} as large as the /dev/${d1}s1 We reduce the size by # one block because ${d1} and ${d1}s1 else would share the same last sector # which could lead to ${d1} be recognized as the GEOM provider instead of # ${d1}s1. Notice also that fdisk(8) usually further reduces the size by # more blocks to make sure the size is a multiple of the cylinder size. size=`fdisk /dev/${d1} | grep ', size ' |\ head -1 | sed -e 's;^.*size \([0-9]*\).*$;\1;'` size=`expr $size - 1` fdisk -v -B -I /dev/${d2} (echo "p 1 165 63 $size"; echo "a 1") | fdisk -v -f- -i /dev/${d2} # place a GEOM mirror label onto first slice of second disk (actually on # the last block of the disk slice) and activate the GEOM mirror kernel # layer (which makes the /dev/mirror/${gm} device available). gmirror label -v -n -b round-robin ${gm} /dev/${d2}s1 gmirror load # place a BSD disklabel onto /dev/mirror/${gm} which is nearly identical # to the BSD disklabel on /dev/${d1}s1 but has the slightly reduced total # slice size (partition "c" because of the additional GEOM mirror label # block) and hence a slightly smaller last partition. NOTICE: partition # "a" always should start at offset 16 because of the BSD disklabel # and partition "c" at offset 0 and notice that partition "c" has to # cover the whole disk. bsdlabel -w -B /dev/mirror/${gm} ( bsdlabel /dev/mirror/${gm} | grep 'c:'; \ bsdlabel /dev/${d1}s1 | grep -v 'c:' ) | \ awk 'BEGIN { d = 0; n = 0; } \ /c:/ { \ d = $2; \ printf("%s %d %s %s %s %s\n", $1, d, $3, $4, $5, $6); next; \ } \ /[abdefgh]:/ { \ p = $2; if (d > 0 && n+p > d) { p = d-n }; \ if ($1 == "a:") { n += $3 }; n += p; \ printf("%s %d %s %s %s %s\n", $1, p, $3, $4, $5, $6); \ } \ ' >/tmp/bsdlabel.txt bsdlabel -R /dev/mirror/${gm} /tmp/bsdlabel.txt # dump & restore filesystem data from first to second disk for p in `bsdlabel /dev/${d1}s1 |\ egrep '^ *[adefgh]:' | sed -e 's/^ *\([adefgh]\).*/\1/'`; do \ fs=`egrep "^ */dev/${d1}s1$p" /etc/fstab | awk '{ print $2; }'`; \ newfs -U /dev/mirror/${gm}$p && \ mount /dev/mirror/${gm}$p /mnt$fs && \ dump -L -0 -f- $fs | (cd /mnt$fs && restore -r -v -f-); \ done # adjust new system configuration for GEOM mirror based setup cp -p /mnt/etc/fstab /mnt/etc/fstab.orig sed -e "s;dev/${d1}s1;dev/mirror/${gm};g" \ /mnt/etc/fstab echo 'geom_mirror_load="YES"' >>/mnt/boot/loader.conf # instruct boot stage 2 loader on first disk to boot # with the boot stage 3 loader from the second disk # (mainly because BIOS might not allow easy booting from second # ATA disk or at least requires manual intervention on the console) # In general make sure your BIOS boot order is configured to try to # boot of both ATA disks. echo $d2 | sed -e 's;^\([^0-9]*\)\([0-9][0-9]*\)$;1:\1(\2,a)/boot/loader;' \ >/boot.config # reboot system # (for running on top of new GEOM mirror on second disk) shutdown -r now - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] gmirror em slice
2008/11/20 William David FUG-BR <[EMAIL PROTECTED]>: > eu também apanhei pra fazer mirror de slice . funcionou mais lembre > que depois apara vc restausar um hd com pau vc tem que ter a mesma > tabela de partição o que torna as coisas mais difíceis de ficar dando > manutenção. > pois se vc por um hd maior tera que editar a partição para ficar do > mesmo tamanho ou um pouco maior pra que o slice seja igual e > reconhecido ideal é o hd inteiro > > > > > 2008/11/20 Celso Viana <[EMAIL PROTECTED]>: >> 2008/11/19 Giancarlo Rubio <[EMAIL PROTECTED]>: >>> 2008/11/19 Celso Viana <[EMAIL PROTECTED]>: All, Numa máquina com 2 HD's (ad0 e ad1) IDE de 40 GB, com FreeBSD instalado em ad0 numa "slice" de 5 GB (ad0s1) é possível fazer RAID1 somente dessa slice (ad0s1)? >>> >>> pode sim.. Tentei com... sysctl -w kern.geom.debugflags=16 gmirror label -v -b round-robin gm0 /dev/ad0s1 ...mas não funcionou; >>> >>> Vc carregou o geom_mirror?? >>> o que gmirror list retorna?? >>> >>> Thanks -- Celso Vianna BSD User: 51318 http://www.bsdcounter.org 63 8404-8559 Palmas/TO - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd >>> >>> >>> >>> -- >>> --- >>> Giancarlo Rubio >>> - >>> Histórico: http://www.fug.com.br/historico/html/freebsd/ >>> Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd >>> >> >> Gian, >> >> Fiz tudo certinho... no HD inteiro funciona normal; mas somente na >> slice ad0s1 não consegui fazer funcionar. >> >> Thanks! >> >> -- >> Celso Vianna >> BSD User: 51318 >> http://www.bsdcounter.org >> >> 63 8404-8559 >> Palmas/TO >> - >> Histórico: http://www.fug.com.br/historico/html/freebsd/ >> Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd >> > > > > -- > -=-=-=-=-=-=-=-=-=- > William David Armstrong <.Of course it runs > Bio Systems Security Networking <|== > MSN / GT [EMAIL PROTECTED] <' OpenBSD or FreeBSD > -- > - > Histórico: http://www.fug.com.br/historico/html/freebsd/ > Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd > Patrão, pode passar os passos para fazer o RAID1 de slice? Thanks!! -- Celso Vianna BSD User: 51318 http://www.bsdcounter.org 63 8404-8559 Palmas/TO - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] gmirror em slice
eu também apanhei pra fazer mirror de slice . funcionou mais lembre que depois apara vc restausar um hd com pau vc tem que ter a mesma tabela de partição o que torna as coisas mais difíceis de ficar dando manutenção. pois se vc por um hd maior tera que editar a partição para ficar do mesmo tamanho ou um pouco maior pra que o slice seja igual e reconhecido ideal é o hd inteiro 2008/11/20 Celso Viana <[EMAIL PROTECTED]>: > 2008/11/19 Giancarlo Rubio <[EMAIL PROTECTED]>: >> 2008/11/19 Celso Viana <[EMAIL PROTECTED]>: >>> All, >>> >>> Numa máquina com 2 HD's (ad0 e ad1) IDE de 40 GB, com FreeBSD >>> instalado em ad0 numa "slice" de 5 GB (ad0s1) é possível fazer RAID1 >>> somente dessa slice (ad0s1)? >> >> pode sim.. >>> >>> Tentei com... >>> >>> sysctl -w kern.geom.debugflags=16 >>> gmirror label -v -b round-robin gm0 /dev/ad0s1 >>> >>> ...mas não funcionou; >> >> Vc carregou o geom_mirror?? >> o que gmirror list retorna?? >> >> >>> >>> Thanks >>> >>> -- >>> Celso Vianna >>> BSD User: 51318 >>> http://www.bsdcounter.org >>> >>> 63 8404-8559 >>> Palmas/TO >>> - >>> Histórico: http://www.fug.com.br/historico/html/freebsd/ >>> Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd >>> >> >> >> >> -- >> --- >> Giancarlo Rubio >> - >> Histórico: http://www.fug.com.br/historico/html/freebsd/ >> Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd >> > > Gian, > > Fiz tudo certinho... no HD inteiro funciona normal; mas somente na > slice ad0s1 não consegui fazer funcionar. > > Thanks! > > -- > Celso Vianna > BSD User: 51318 > http://www.bsdcounter.org > > 63 8404-8559 > Palmas/TO > - > Histórico: http://www.fug.com.br/historico/html/freebsd/ > Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd > -- -=-=-=-=-=-=-=-=-=- William David Armstrong <.Of course it runs Bio Systems Security Networking <|== MSN / GT [EMAIL PROTECTED] <' OpenBSD or FreeBSD -- - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] gmirror em slice
2008/11/19 Giancarlo Rubio <[EMAIL PROTECTED]>: > 2008/11/19 Celso Viana <[EMAIL PROTECTED]>: >> All, >> >> Numa máquina com 2 HD's (ad0 e ad1) IDE de 40 GB, com FreeBSD >> instalado em ad0 numa "slice" de 5 GB (ad0s1) é possível fazer RAID1 >> somente dessa slice (ad0s1)? > > pode sim.. >> >> Tentei com... >> >> sysctl -w kern.geom.debugflags=16 >> gmirror label -v -b round-robin gm0 /dev/ad0s1 >> >> ...mas não funcionou; > > Vc carregou o geom_mirror?? > o que gmirror list retorna?? > > >> >> Thanks >> >> -- >> Celso Vianna >> BSD User: 51318 >> http://www.bsdcounter.org >> >> 63 8404-8559 >> Palmas/TO >> - >> Histórico: http://www.fug.com.br/historico/html/freebsd/ >> Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd >> > > > > -- > --- > Giancarlo Rubio > - > Histórico: http://www.fug.com.br/historico/html/freebsd/ > Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd > Gian, Fiz tudo certinho... no HD inteiro funciona normal; mas somente na slice ad0s1 não consegui fazer funcionar. Thanks! -- Celso Vianna BSD User: 51318 http://www.bsdcounter.org 63 8404-8559 Palmas/TO - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] gmirror em slice
2008/11/19 William David FUG-BR <[EMAIL PROTECTED]>: > Grande patrão Celso tudo certinho > > Pode sim sem problema o ideal seria do hd inteiro. > > da uma olhadinha nisso > http://people.freebsd.org/~rse/mirror/ > http://www.onlamp.com/pub/a/bsd/2005/11/10/FreeBSD_Basics.html?page=1 > > > > -- > -=-=-=-=-=-=-=-=-=- > William David Armstrong <.Of course it runs > Bio Systems Security Networking <|== > MSN / GT [EMAIL PROTECTED] <' OpenBSD or FreeBSD > -- > - > Histórico: http://www.fug.com.br/historico/html/freebsd/ > Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd > William, No disco inteiro funciona 100%... mas somente com determinada "slice" não consegui fazer funcionar. Thanks -- Celso Vianna BSD User: 51318 http://www.bsdcounter.org 63 8404-8559 Palmas/TO - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] gmirror em slice
Grande patrão Celso tudo certinho Pode sim sem problema o ideal seria do hd inteiro. da uma olhadinha nisso http://people.freebsd.org/~rse/mirror/ http://www.onlamp.com/pub/a/bsd/2005/11/10/FreeBSD_Basics.html?page=1 -- -=-=-=-=-=-=-=-=-=- William David Armstrong <.Of course it runs Bio Systems Security Networking <|== MSN / GT [EMAIL PROTECTED] <' OpenBSD or FreeBSD -- - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
Re: [FUG-BR] gmirror em slice
2008/11/19 Celso Viana <[EMAIL PROTECTED]>: > All, > > Numa máquina com 2 HD's (ad0 e ad1) IDE de 40 GB, com FreeBSD > instalado em ad0 numa "slice" de 5 GB (ad0s1) é possível fazer RAID1 > somente dessa slice (ad0s1)? pode sim.. > > Tentei com... > > sysctl -w kern.geom.debugflags=16 > gmirror label -v -b round-robin gm0 /dev/ad0s1 > > ...mas não funcionou; Vc carregou o geom_mirror?? o que gmirror list retorna?? > > Thanks > > -- > Celso Vianna > BSD User: 51318 > http://www.bsdcounter.org > > 63 8404-8559 > Palmas/TO > - > Histórico: http://www.fug.com.br/historico/html/freebsd/ > Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd > -- --- Giancarlo Rubio - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
[FUG-BR] gmirror em slice
All, Numa máquina com 2 HD's (ad0 e ad1) IDE de 40 GB, com FreeBSD instalado em ad0 numa "slice" de 5 GB (ad0s1) é possível fazer RAID1 somente dessa slice (ad0s1)? Tentei com... sysctl -w kern.geom.debugflags=16 gmirror label -v -b round-robin gm0 /dev/ad0s1 ...mas não funcionou; Thanks -- Celso Vianna BSD User: 51318 http://www.bsdcounter.org 63 8404-8559 Palmas/TO - Histórico: http://www.fug.com.br/historico/html/freebsd/ Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd