Lost content

As we say in Brazil “casa de ferreiro, espeto de pau”. I just lost 3 years of the blog’s posts, along with all images.
I’m a sysadmin for a living and people trust me to handle their data, even so, I’ve managed to loose my own. That’s f#$4ing ridiculous.
I mean, its not much, just about a dozen posts but its a pain anyway since I’m going to have to rebuild all those posts from scratch and search around for the original images. Damn.

Low budget VMware capacity planning (part 1)

Today I started a research on options regarding capacity planning for an esxi deployment. Basically this project aims to virtualize ~30 physical servers.

First things first, I need to know whats the kind of load (cpu, mem, disk) I have globally. After that hopfully I will be able to size the hosts and begin the migration.
A chat with some esx ppl over #vmware follows:

[08:14am] MindTheGap: hello ppl. Im looking for metrics on how to plan an esx deployment, specially regarding client loads. Ok, I can measure network troughput, iops, MB/s but how do you size cpu requirements?
[08:14am] milestone: MindTheGap why not use the vmware capacity planner?
[08:14am] MindTheGap: I mean, a 20% load on a pentium4 means something completely different on a xeon
[08:20am] MindTheGap: i'm mostly calculating presentload/presentprocessorghz = X/futurecpughz where X would me the estimated load on the future processor but due to different architecture of newer processors, ghz also dont mean nothing.
[08:21am] MindTheGap: milestone, capacity planner is not free, at least the last time I looked up.
[08:22am] milestone: MindTheGap maybe it is worth the money... How bis is your setup?
[08:22am] MindTheGap: that would be presentload/presentprocessorghz = X/futurecpughz*numberofcores
[08:22am] twkm: empirical testing might prove useful to obtain your own ratios.
[08:22am] MindTheGap: milestone, not that big. something like 30 physical servers to be virtualized on a very tight budget.
[08:23am] twkm: ahh, good old very tight.
[08:23am] MindTheGap: :)
[08:23am] twkm: always enough money to have 30 servers, never enough to have 3 really good ones.
[08:23am] MindTheGap: tell me about it...
[08:24am] MindTheGap: its the fact of life of most Sysadmins
[08:24am] twkm: i like vmware's roi calculator. almost impossible to get it to present results for a transition.
[08:24am] johnt: capacity planner is only available for trained vmware partners at http://optimize.vmware.com/
[08:25am] johnt: MindTheGap perhaps you should calculate in Operations / Second
[08:26am] johnt: . /should/could/
[08:27am] MindTheGap: johnt, how should I do it? on a linux (to be)guest for instance?
[08:27am] twkm: that's the tricky bit, with today's processors, even with the p4.
[08:28am] twkm: put the known 20% p4 load on a proposed xeon (you can get an eval box, nyet?), and see what you get. tricky, but it can be instructive.
[08:29am] MindTheGap: johnt, I actually have not poked around /proc/ but I assume some statistics would be scattered there, yes?
[08:29am] twkm: esx, yes. esxi, no.
[08:29am] MindTheGap: twkm, sure, but Im trying to avoid it.
[08:29am] twkm: esx(i) is not linux.
[08:30am] MindTheGap: im talking about metrics, once i have it I can do it for the (would be)host as well
[08:30am] MindTheGap: and since the hosts have the same specs its ok
[08:30am] twkm: as you said, different cpu's. it won't be a constant.
[08:33am] MindTheGap: I got 3 maybe 4 hosts. all of them are Dell t410 with perc6i driving 2x 15k 500GB SAS, 8GB RAM and E5504 Nehalem procs.
[08:33am] twkm: if you are using esx for your eval you'd want to look at /proc/vmware/...
[08:35am] MindTheGap: i plan to use esxi on stand alone mode for now than maybe go for vsphere later on depending on the budget.
[08:36am] twkm: then you cannot see any stats on the host, and you'll have to get them via the api (e.g., in vsphere client).
[08:36am] MindTheGap: johnt, the operations/sec sounded good. can you elaborate on that please?
[08:37am] MindTheGap: im focusing on the guests now, then I will size the hosts and plan on how I will distribute the guests.
[08:40am] MindTheGap: twkm, I will measure the processor of the hosts while running linux on them, after taking 5% of esxi overhead maybe I will get a goot aproximation. well, I think
[08:40am] twkm: sounds like a starting point.
[08:45am] MindTheGap: so, just for the sake of clarity. there are no options for a "semi-professional" esxi deployment regarding to capacity planning, yes? either I do it by hand, creating my own metrics as I go or I will need to contact a vmware partner and give'em loads of money, is it correct? Dont take me wrong I'm not cheap I just dont have the money.
[08:46am] twkm: the not professional option is what you just got.
[08:46am] twkm: for the money spent you got the sort of results one would expect.
[08:47am] MindTheGap: twkm, oh, I very certain of that. but like I said, got no money but have to do it anyway.
[08:48am] MindTheGap: Actually it will be a good exercise. will make a post out of it. thanks everyone.
[08:49am] MindTheGap: I will start to hang out here more as I'm also preparing for my VCP next month, so I hope to chat w you all again. thanks twkm and johnt.
[08:50am] twkm: cpp;/
[08:50am] twkm: *boggle*
[08:50am] twkm: make that ... cool.

 

So, as I suspected, there are no options for a small scale deployment. Either you go for a full consulting with a VMware partner or you do it yourself.

Since some shops don’t have the money to spend on a full scale VMware solution, there is a gap between a low end deployment and a high end one.

Being so, I’ll move on with a diy aproach…

For the iops, mb/s and io contention I will use a very simple sampling of iostat output treated with awk resulting on a csv i can load on a spreadsheet.

Lets start with an awk script:


# Utilização: iostat -k N Y | awk -f iostat.awk > arquivodesaida.csv
# Exemplo: iostat -k 1 60 | awk -f iostat.awk > iostat.csv
BEGIN {
printf("%10s ;%10s ;%10s ;%10s ;%10s","CPU(Sy+Us)","I/O Wait","iops","kB_read/s","kB_wrtn/s")
}
(NF==6 && !/sda/ && !/evice/) {
printf("n%10s ;%10s ;", $1+$3, $4)
}
/sda/ {
printf ("%10s ;%10s ;%10s", $2, $3, $4)
}

This script gives me a nice output like this:

CPU(Sy+Us) ; I/O Wait ; iops ; kB_read/s ; kB_wrtn/s
16.55 ; 10.41 ; 195.29 ; 214.72 ; 516.47
0 ; 0.00 ; 0.00 ; 0.00 ; 0.00
0.25 ; 0.00 ; 0.00 ; 0.00 ; 0.00
0 ; 0.00 ; 0.00 ; 0.00 ; 0.00
0.5 ; 0.00 ; 0.00 ; 0.00 ; 0.00

to be continued…

How to disable journaling on a HFS+ volume

Mac OS X’s native file system (HFS+) supports journaling, a feature that is enabled by default on all new volumes. Journaling is a very nice feature as it allows a quick recovery of the file system’s status should anything bad happen to the machine — e.g. a power failure or a crash. With a journaled file system, the operating system can easily undo or redo the last operations executed on the disk without losing meta-data, effectively avoiding a full file system check.

However, journaling introduces a performance penalty for write operations. Every time the operating system has to modify the file system, it must first update the journal, then execute the real operation and at last mark the operation as completed in the journal. In most situations, this penalty is worth it for the reasons stated above. (Note: I haven’t benchmarked this penalty; it may be unnoticeable!)

There are some scenarios in which it can be avoided though. For example: I keep several disk images in my machine that hold the source code of some projects — NetBSD, pkgsrc — because these need to be placed in case-sensitive file systems. Up until now I had these configured as journaled HFS+ file systems, but I just figured out that I could gain some performance points by disabling this feature at the risk of losing the robustness introduced by journaling. After all, crashes are rare and power failures are non-existant in a laptop; plus the data stored in the images can be easily refetched at will in case of a disaster.

It turns out that the Disk Utility allows you to easily enable journaling for a volume (just check out the big icon in the toolbar), but the interface provides no way to disable it. Or at least I haven’t found that option. According to multiple articles I found, it was possible in older OS X versions. So I realized that the feature had to be available somewhere in recent versions.

And that’s right: the command-line diskutil program is able to disable journaling for a given mounted volume. Just run it as:

# diskutil disableJournal /Volumes/TheVolumeName

And voila! Journaling disabled.

shamelessly copied from: http://blog.julipedia.org/2007/04/how-to-disable-journaling-on-hfs-volume.html

Hacking the Trendnet TEW652BRP v2 to work as a wireless bridge

Although version 1 of this router is completely customizable through alternative firmwares, version 2 has another chipset and very little tweaking will be possible, for now.

The TEW652BRP v1 and v2 are two completely different routers. The first has a 400Mhz Atheros 9130 System on a Chip, making it perfect for aftermarket firmwares such as the openwrt. The former, although having the same model number sports a RealTek 330Mhz RTL8196B core. Both have 4MB Flash, 32MB RAM and 5 10/100 ethernet ports.

<code>
# cat /proc/cpuinfo
system type        : RTL8652
processor        : 0
cpu model        : R3000 V0.0
BogoMIPS        : 329.31
wait instruction    : yes
microsecond timers    : no
tlb_entries        : 32
extra interrupt vector    : no
hardware watchpoint    : no
ASEs implemented    :
VCED exceptions        : not available
VCEI exceptions        : not available
</code>

The source code of the RTL8196B driver is not publically avaliable and probably will have to be written from scratch. Chances are it will never happen.

Anyways, it does have some of its code under GPL so i’m trying to hack it to work on bridge mode.

As Trendnet has published the firmware source along with the required toolchain, the first thing I tried to do was get shell access at the router. Turned out it was not that easy.

Repackaging the firmware with /etc/inittab pointing to “/bin/busybox telnetd &” failed, as well as trying to run anything. Not even a simple ping would launch.
/etc/inittab, /etc/rcS, /etc/init.d/*, all failed to start any programs. Actually it was a very frustrating process as i had to recompile the firmware numerous times.

Reading through similar hardware information http://wiki.x-wrt.org/index.php/Trendnet_TEW-632BRP I managed to get shell through its serial port.
Pinout is shown below. Note that TX and RX are swapped, following the serial pinout from the TEW632 WILL NOT WORK. The right pinout for the TE652BRPv2 is:

<code>
pin 1 = +3.3V
pin 2 = TX
pin 3 = RX
pin 4 = Ground
</code>

Also, the speed of the serial port on this router is 38400.

For an easy interface, another router (WRT54gs) was used to make the serial connection avoiding the rs232 hassle.
One can just connect the wrt and trendnet serial lines directly. RX-TX  TX-RX  GND-GND
Once connected, just install and run picocom on the wrt like this:

<code>
~ # picocom -b 38400 /dev/tts/1
picocom v1.4

port is        : /dev/tts/1
flowcontrol    : none
baudrate is    : 38400
parity is      : none
databits are   : 8
escape is      : C-a
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : ascii_xfr -s -v -l10
receive_cmd is : rz -vv

Terminal ready
</code>

Here is the output from boot:

<code>
—RealTek(RTL8196B)at 2009.02.27-14:02-0500 version v1.3 [16bit](330MHz)
no rootfs signature at E0000!
Jump to image start=0x80500000…
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 25876k/32768k available (2325k kernel code, 6892k reserved, 298k data, 120k init, 0k highmem)
Mount-cache hash table entries: 512
Checking for ‘wait’ instruction…  available.
NET: Registered protocol family 16
PCI: Bridge: 0000:00:00.0
IO window: 18c00000-18c00fff
MEM window: 19000000-190fffff
PREFETCH window: disabled.
PCI: Enabling device 0000:00:00.0 (0000 -> 0003)
NET: Registered protocol family 2
IP route cache hash table entries: 256 (order: -2, 1024 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
Squashfs 2.2-r2 (released 2005/09/08) (C) 2002-2005 Phillip Lougher
Squashfs 2.2 includes LZMA decompression support
io scheduler noop registered
io scheduler anticipatory registered (default)
Skipping PCI bus scan due to resource conflict
PCI: Bridge: 0000:00:00.0
IO window: 18c00000-18c00fff
MEM window: 19000000-190fffff
PREFETCH window: disabled.
Realtek GPIO Driver for Flash Reload Default
init gpio_ioctl Successful,  major = 201
Serial: 8250/16550 driver $Revision: 1.1.1.1 $ 1 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x0 (irq = 12) is a 16550A
Probing RTL8186 10/100 NIC…
eth0 added. vid=9 Member port 0x1de…
eth1 added. vid=8 Member port 0x1…
PPP generic driver version 2.4.2
MPPE/MPPC encryption/compression module registered
NET: Registered protocol family 24
PPTP driver version 0.7
RTL8192SE driver version 1.15 (2009-09-08)
PCI: Enabling device 0000:01:00.0 (0000 -> 0003)
correcting to 32
RealTek E-Flash System Driver. (C) 2002 RealTek Corp.
Found 1 x 4M Byte MXIC MX29LV320AB at 0xbd000000
table size = 0x400000, table region is 4
mtd->numeraseregions = 0x4
Creating 5 MTD partitions on “DiskOnChip Millennium”:
0x00000000-0x00010000 : “boot+cal”
0x00010000-0x000f0000 : “linux”
0x000f0000-0x003e0000 : “rootfs”
0x003e0000-0x003f0000 : “nvram”
0x003f0000-0x00400000 : “mac”
Netfilter messages via NETLINK v0.30.
ip_conntrack version 2.4 (256 buckets, 2048 max) – 236 bytes per conntrack
ip_conntrack_rtsp v0.6.21 loading
ip_nat_rtsp v0.6.21 loading
ip_conntrack_pptp version 3.1 loaded
ip_nat_pptp version 3.0 loaded
ip_tables: (C) 2000-2006 Netfilter Core Team
ipt_time loading
ClusterIP Version 0.8 loaded successfully
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Realtek FastPath v1.02
VFS: Mounted root (squashfs filesystem) readonly.
Go to out!!
Freeing unused kernel memory: 120k freed
mount /proc file system ok!
mount /var  file system ok!
init started:  BusyBox v1.01 (2010.02.08-23:07+0000) multi-call binary
BusyBox v1.01 (2010.02.08-23:07+0000) Built-in shell (ash)
Enter ‘help’ for a list of built-in commands.
</code>

As I said, trying to run things on this router from traditional startup scripts failed. Busybox on this router does have its inittab honoring enabled but it will just not work. It seems all the start/stop and management code is run from the “rc” proprietary code. Running through rc’s objects one can clearly see it has an important role.

<code>
caio@linuxdev:~/tew652/src/Matrix/projects/TEW-652BRPR1/apps/rc$ ls
app.o    firewall.o  Makefile  network.o  platform.o  process.o  rc    route.o  wantimer.o
build.h  lan.o       mtd.o     Pconfig    ppp.o       psmon.o    rc.o  wan.o    wlan.o
</code>

Anyway, the next step is to try and see if the wireless control tools has any hints on their inner workings.

Running strings on wlan.o shows calls to iwpriv, brctl and lots of other stuff.

To try to reverse its code would be a complete nightmare and I didnt have the time or knowledge to go down this route, so I took a different aproach.

Googling some of its strings, a realtek developers document showed up. Also some russian site with info on the DLINK G700.
Apparently, all wireless controls are the same for realtek chips, limited only by the the individual chips capabilities.
According to the specification, RTL8196B is capable of working on all modes, Client, AP and WDS.
Since the controls are avaliable as binaries (iwpriv), finding out the right commands was a matter of time.

My needs are only to bridge a pair of these TEW652BRP v2 so what I came up with was:

#set the working mode to Client.
<code>
iwpriv wlan0 set_mib opmode=8
</code>

#set the ssid of the access point to connect
<code>
iwpriv wlan0 set_mib ssid=”TRENDNETACCESSPOINT”
</code>

The rest of the configuration can be made from the administrative interface as they are shared among all working modes.

So, to brigde both routers what I did was:

replicate all wireless settings on both routers
issue a “iwpriv wlan0 set_mib opmode=8” on the client
ifconfig down/up on wlan0 interface of the client

After that the access point showed the client mac address connected as one of its clients.

Next, get this things done on boot time. Although busybox does not read inittab or any other default init scripts, it does source /etc/profile, so it can be done from there.

convertendo uma instalacao normal em RAID1

Adicionando um segundo hd, juntando tudo num RAID1, e com alguma sorte não perdendo nada.

1 – adicionar o segundo hd

root@ubuntu:/home/caio# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00008f89

Device Boot Start End Blocks Id System
/dev/sda1 * 1 993 7976241 83 Linux
/dev/sda2 994 1044 409657+ 5 Extended
/dev/sda5 994 1044 409626 82 Linux swap / Solaris

Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn’t contain a valid partition table

2 – instalar suporte a raid

root@ubuntu:/home/caio# apt-cache search mdadm
mdadm – tool to administer Linux MD arrays (software RAID)
root@ubuntu:/home/caio# apt-get install mdadm
Reading package lists… Done
Building dependency tree
Reading state information… Done
Recommended packages:
mail-transport-agent
The following NEW packages will be installed:
mdadm
0 upgraded, 1 newly installed, 0 to remove and 266 not upgraded.
Need to get 220kB of archives.
After unpacking 627kB of additional disk space will be used.
Get:1 http://br.archive.ubuntu.com gutsy/main mdadm 2.6.2-1ubuntu2 [220kB]
Fetched 220kB in 2s (99.3kB/s)
Preconfiguring packages …
Selecting previously deselected package mdadm.
(Reading database … 92659 files and directories currently installed.)
Unpacking mdadm (from …/mdadm_2.6.2-1ubuntu2_i386.deb) …
Setting up mdadm (2.6.2-1ubuntu2) …
Generating mdadm.conf… done.
Removing any system startup links for /etc/init.d/mdadm-raid …
update-initramfs: deferring update (trigger activated)
* Starting MD monitoring service mdadm –monitor [ OK ]

Processing triggers for initramfs-tools …
update-initramfs: Generating /boot/initrd.img-2.6.22-14-generic

3 – clonar a a tabela de particao e salvar backup da tabela no arquivo setores-sdb.bak

root@ubuntu:/home/caio# sfdisk -d /dev/sda | sfdisk /dev/sdb -O setores-sdb.bak
Checking that no-one is using this disk right now …
OK

Disk /dev/sdb: 1044 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
/dev/sdb: unrecognized partition table type
Old situation:
No partitions found
New situation:
Units = sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System
/dev/sdb1 * 63 15952544 15952482 83 Linux
/dev/sdb2 15952545 16771859 819315 5 Extended
/dev/sdb3 0 – 0 0 Empty
/dev/sdb4 0 – 0 0 Empty
/dev/sdb5 15952608 16771859 819252 82 Linux swap / Solaris
Successfully wrote the new partition table

Re-reading the partition table …

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)

4 – setar tipos de todas as particoes de /dev/sdb para FD (Linux raid autodetect), exceto a particao extendida

root@ubuntu:/home/caio# sfdisk –change-id /dev/sdb 1 FD
Done
root@ubuntu:/home/caio# sfdisk –change-id /dev/sdb 3 FD
Done
root@ubuntu:/home/caio# sfdisk –change-id /dev/sdb 4 FD
Done
root@ubuntu:/home/caio# sfdisk –change-id /dev/sdb 5 FD
Done

5 – criar RAID devices (modo degradado). md0 para a raiz e md1 para swap

root@ubuntu:/home/caio# mdadm -C /dev/md0 –level=raid1 –raid-devices=2 missing /dev/sdb1
mdadm: array /dev/md0 started.
root@ubuntu:/home/caio# mdadm -C /dev/md1 –level=raid1 –raid-devices=2 missing /dev/sdb5
mdadm: array /dev/md1 started.
root@ubuntu:/home/caio# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[1]
7976128 blocks [2/1] [_U]

md1 : active raid1 sdb5[1]
409536 blocks [2/1] [_U]

unused devices:

6 – criar swap no /dev/md1

root@ubuntu:/home/caio# mkswap /dev/md1
Setting up swapspace version 1, size = 419360 kB
no label, UUID=9e18cec6-63a5-434a-9581-f99b58fbaadd
root@ubuntu:/home/caio# swapon /dev/md1
root@ubuntu:/home/caio# swapon -s
Filename Type Size Used Priority
/dev/sda5 partition 409616 0 -1
/dev/md1 partition 409528 0 -2

7 – criar sistema de arquivos no md0

root@ubuntu:/home/caio# mkfs -t ext3 /dev/md0
mke2fs 1.40.2 (12-Jul-2007)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
997472 inodes, 1994032 blocks
99701 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2042626048
61 block groups
32768 blocks per group, 32768 fragments per group
16352 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 21 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

8 – copiar todos arquivos para o novo device RAID

root@ubuntu:/home/caio# mkdir /mnt/md0
root@ubuntu:/home/caio# mount /dev/md0 /mnt/md0/
root@ubuntu:/# find . -xdev -print0 | cpio -0pdvum –sparse /mnt/md0

9 – alterar fstab

# /dev/sda1
#antes
#UUID=e40d8ae6-03c1-4519-91d9-2d2b17a23832 / ext3 defaults,errors=remount-ro 0 1
#depois
/dev/md0 / ext3 defaults,errors=remount-ro 0 1

# /dev/sda5
#antes
#UUID=e596805b-c899-4c46-981e-56d6dc6ae600 none swap sw 0 0
#depois
/dev/md1 /swap sw 0 0

10 – editar menu.lst

title Ubuntu 7.10, kernel 2.6.22-14-generic RAID
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=/dev/md0 ro quiet nosplash
initrd /boot/initrd.img-2.6.22-14-generic-raid
quiet

11 – instalar o grub

grub> device (hd0) /dev/sdb
grub> root (hd0,0)
grub> setup (hd0)
Checking if “/boot/grub/stage1” exists… yes
Checking if “/boot/grub/stage2” exists… yes
Checking if “/boot/grub/e2fs_stage1_5” exists… yes
Running “embed /boot/grub/e2fs_stage1_5 (hd0)”… 17 sectors are embedded.
succeeded
Running “install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst”… succeeded
Done.
grub> quit

12 – criar novo initrd para o RAID

cd /mnt/md0
mount -o bind /proc ./proc
mount -o bind /dev ./dev
chroot /mnt/md0
mkinitramfs -r /dev/md0 -o initrd.img-2.6.22-14-generic-raid

13 – testar boot

entrar no grub, setar root como hd1,0
definir configfile como /boot/grub/menu.lst
bootar.
o sistema deve bootar normalmente mas pelo RAID (ainda em modo degraded)

14 – configurar as particoes do sda para RAID

root@ubuntu:/home/caio# sfdisk –change-id /dev/sda 1 FD
Done
root@ubuntu:/home/caio# sfdisk –change-id /dev/sda 3 FD
Done
root@ubuntu:/home/caio# sfdisk –change-id /dev/sda 4 FD
Done
root@ubuntu:/home/caio# sfdisk –change-id /dev/sda 5 FD
Done

15 – Adicionar os sda ao RAID

root@ubuntu:/home/caio# mdadm /dev/md0 -a /dev/sda1
mdadm: added /dev/sda1
root@ubuntu:/home/caio# mdadm /dev/md1 -a /dev/sda5
mdadm: Cannot open /dev/sda5: Device or resource busy

ops, o sda5 esta sendo usado para swap

root@ubuntu:/home/caio# swapon /dev/md1
root@ubuntu:/home/caio# swapon -s
Filename Type Size Used Priority
/dev/sda5 partition 409616 0 -1
/dev/md1 partition 409528 0 -2
root@ubuntu:/home/caio# swapoff /dev/sda5
root@ubuntu:/home/caio# swapon -s
Filename Type Size Used Priority
/dev/md1 partition 409528 0 -2

root@ubuntu:/home/caio# mdadm /dev/md1 -a /dev/sda5
mdadm: added /dev/sda5

agora sim. neste momento o RAID está sendo sincronizado.
verifique o status com:

root@ubuntu:/home/caio# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md1 : active raid1 sda5[0] sdb5[1]
409536 blocks [2/2] [UU]

md0 : active raid1 sda1[0] sdb1[1]
7976128 blocks [2/2] [UU]

unused devices:

16 – reinstalar grub

grub>
device (hd0) /dev/sda
root (hd0,0)
setup (hd0)
quit

17 – bootar e certificar que tudo funciona e que o raid está integro

caio@ubuntu:~$ cat /proc/mounts
rootfs / rootfs rw 0 0
none /sys sysfs rw,nosuid,nodev,noexec 0 0
none /proc proc rw,nosuid,nodev,noexec 0 0
udev /dev tmpfs rw 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
/dev/md0 / ext3 rw,data=ordered 0 0
/dev/md0 /dev/.static/dev ext3 rw,data=ordered 0 0
tmpfs /var/lock tmpfs rw,nosuid,nodev,noexec 0 0
tmpfs /lib/modules/2.6.22-14-generic/volatile tmpfs rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
devpts /dev/pts devpts rw 0 0
tmpfs /var/run tmpfs rw,nosuid,nodev,noexec 0 0
tmpfs /var/lock tmpfs rw,nosuid,nodev,noexec 0 0
securityfs /sys/kernel/security securityfs rw 0 0
caio@ubuntu:~$ cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md1 : active raid1 sda5[0] sdb5[1]
409536 blocks [2/2] [UU]

md0 : active raid1 sda1[0] sdb1[1]
7976128 blocks [2/2] [UU]

unused devices: <none>

Último dia do julgamento do TPB (The Pirate Bay)

Terminou hoje o julgamento do caso do The Pirate Bay.
Por se tratar de um caso “complexo”, a sentença só será dada em 14 de abril de 2009 às 10:00 UTC.

Demostre seu apoio assim:

– Envie tweets com a keyword #spectrial

– Abra uma conta em www.bambuser.com e poste um video. Ele poderá ser passado no onibus estacionado do lado de fora do forum em Stockholm.
Veja como faze-lo:

– Assista a coletiva? de imprensa na integra aqui:
http://bambuser.com/channel/Spectrial/broadcast/73736

– Assista aos videos de Anna Oscarsson, RP? do TPB aqui:
http://bambuser.com/channel/Spectrial

– Acompanhe o blog do TPB sobre o julgamento aqui:
http://trial.thepiratebay.org/