I get all excited when I load up Github's front-page and see something like:
"robyn has forked skx/xxx to robyn/xxx"I wonder what they will do, what changes do they have in mind? Days pass, and no commits happen. Anti-social coding: Cloning the code, I guess in case I delete my repository, but not intending to make any changes.
The JSCommunicator project aims to make it easy to integrate WebRTC into existing web applications.
It provides a high-level API on top of the popular JsSIP SIP stack for JavaScript. The JSCommunicator API provides basic dialing and call control features, allowing you to focus on the application level rather than the SIP level. The configuration file suggests many possible ways it can be deployed and customized without any coding at all.
The popular DruCall module for the Drupal CMS provides a practical demonstration of how JSCommunicator can be embedded in other products, multiplying the power of WebRTC for millions of other web developers, bloggers, online shops and other sites. This part of the DruCall source code provides a practical demonstration of how JSCommunicator integrates with PHP and this demonstrates how we extract the parameters from PHP in the JavaScript and convert them to the JSCommunicator configuration object.
Practical deployments of WebRTC today
The student selected for this GSoC project will focus on two practical, real-world deployments of JSCommunicator:
If you ever find yourself doing a bit of technical support for relatives
over the phone, there's nothing like actually seeing what they are doing on
their computer. One of the best tools for such remote desktop sharing is
vnc.
Here's the best setup I have come up with so far. If you have any
suggestions, please leave a comment!
x11vnc. Here's what ~/.x11vnrc contains:
noxdamage
That option
appears to be necessary
when the desktop to share is running gnome-shell / compiz.
Afterwards, I start the client on my laptop with the following command:
ssvncviewer -encodings zrle -scale 1280x775 localhost
The scaling factor is simply the resolution of the client minus any window
decorations.
localhost:5900). That's because I'm tunelling the traffic through the ssh
connection in order to avoid relying on vnc extensions for authentication
and encryption.
Here's what the client's ~/.ssh/config needs for that simple use case:
Host server.example.com:
LocalForward 5900 127.0.0.1:5900
If the remote host (which has an internal IP address of 192.168.1.2 in
this example) is not connected directly to the outside world and instead
goes through a gateway, then your ~/.ssh/config will look like this:
Host gateway.example.com:
ForwardAgent yes
LocalForward 5900 192.168.1.2:5900
Host server.example.com:
ProxyCommand ssh -q -a gateway.example.com nc -q0 %h 22
and the remote host will need to open up a port on its firewall for the
gateway (internal IP address of 192.168.1.1 here):
iptables -A INPUT -p tcp --dport 5900 -s 192.168.1.1/32 -j ACCEPT
~/.x11vncrc on the vnc server:
ncache 10
ncache_cr
and changed the client command line to this:
ssvncviewer -compresslevel 9 -quality 3 -bgr233 -encodings zrle -use64 -scale 1280x775 -ycrop 1024 localhost
This decreases image quality (and required bandwidth) and enables
client-side caching.
The magic 1024 number is simply the full vertical resolution of the remote
machine, which sports a vintage 1280x1024 LCD monitor.
Spritz seems like a very interesting way to read quickly. It's the opposite of everything I've read (slowly) about speed reading, which focuses on using peripheral vision and not reading word-by-word. You're supposed to do things like move your eyes straight down the page, taking in whole lines at a time.
Interruptions seem like a big problem; interruptions that make me
look away, or interruptions in my brain, where I might realize I've
not been paying attention for some amount of time. Maybe they
should have navigation buttons similar to video players, so you can
skip backward 15 seconds at a time. I also do want to go back and
review previous pages sometimes for reasons that have nothing to do
with interruption, so I wouldn't want word-by-word to be the only way to
view a text -- especially when reading nonfiction. I might event want
it to work in a mode where you hold down the button on the side of
your phone or tablet in order to move the words, and then have them
automatically pause when you release. It feels like I'd want a lot of
short breaks when reading in this style.
It should also be free software, but
unfortunately I'm guessing it won't be. I hope someone will make a
free software application along these lines -- the basics seem pretty basic.
My hard-working KDE friend Mario asked me to help him to get Debian people to help him with his thesis. Here is what he writes:
Dear Free Software contributor*
I m currently in the process of writing my diploma thesis. I ve worked hard during the last few weeks and months on a questionnaire which shall collect some data for my thesis. Furthermore the data of this survey will be interesting for the Free Software communities as well.
So please take some time or add it to your todo list or, even better, go directly to my questionnaire and help me make a great diploma thesis and improve the Free Software community in some ways.
The questionnaire takes some 20 to 30 minutes. At the end of the questionnaire you ll find a way to participate in a draw where you can even win something nice.
In a first round I got the feedback that the length of the questionnaire and that some questions (mostly the ones at the beginning of the questionnaire about the 12 different tasks) are quite abstract and difficult. But please try it, try your best and take the time and brain power. The remaining part of the questionnaire [1] (after these two pages with the tasks questions) is quite
First step will be getting a NetBSD ISO image for installation
purpose. It can be downloaded from here.
Next step will be creating a disk image for installing NetBSD. This is
done using qemu-img tool like below
$ qemu-img create -f raw netbsd-disk.img 10G
$ qemu-system-x86_64 -m 256M -hda netbsd-disk.img -cdrom \
NetBSD-6.1.3-amd64.iso -display curses -boot d \
-net nic -net user
auto vdetap iface vdetap inet static address 192.168.2.1 netmask 255.255.255.0 vde2-switch -t vdetapWe can use dnsmasq as a DHCP server for the vdetap interface, but I'm not gonna explain the configuration of dnsmasq here. Run the below command to get vdetap up
modprobe tun
ifup vdetap
/etc/init.d/dnsmasq restart
newgrp vde2-net # run as user starting Qemu VM's
$ qemu-system-x86_64 -m 256M -hda \
/mnt/kailash/BSDWorld/netbsd-disk.img \
-net nic -net vde,sock=/var/run/vde2/vdetap.ctl -display curses
# ifconfig wm0 192.168.2.2 netmask 255.255.255.0
# route add default 192.168.2.1
192.168.2.2 netmask 0xffffff00 media autoselectSet the DNS server as host by adding file /etc/resolv.conf with following content.:
nameserver 192.168.2.1After this you need to do NAT/masquerading using iptables. Just copy following script to a file and execute it as root
#!/bin/sh
# Restart the dnsmasq
/etc/init.d/dnsmasq restart
# Set nat rules in iptables
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
# Replace accordingly usb0 with ppp0 for 3G
iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface vdetap -j ACCEPT
# Enable IP forwarding in Kernel
sysctl -w net.ipv4.ip_forward=1
Note that you won't be able to SSH as root to NetBSD (may be its configured to not allow by default), so you would need to create a normal user before trying to SSH from host to guest. Also make sure you add the user to wheel group to allow him execute su command.So now I've NetBSD running on my laptop with mere 256M ram and its amazingly fast even at such low RAM. I've created a new user and can SSH into it from host machine and use it just like I use a server!. I will put up the notes of my BSD adventure here periodically. The feeling of using a BSD is amazing :-)
Update: I forgot to add masquerading step, I've added it now.
A new minor upstream release 4.100 of the Armadillo templated C++
library for linear algebra was finalised by Conrad yesterday.
I rolled up the corresponding RcppArmadillo
release 0.4.100.0 which is now on CRAN and will go to
Debian shortly.
Changes in RcppArmadillo version 0.4.100.0 (2014-02-28)Courtesy of CRANberries, there is also a diffstat report for the most recent release As always, more detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.
- Upgraded to Armadillo release Version 4.100.0 (Dirt Cruiser)
- added
normalise()for normalising vectors to unit p-norm- extended the
fieldclass to handle 3D layout- extended
eigs_sym()andeigs_gen()to obtain eigenvalues of various forms (eg. largest or smallest magnitude)- automatic SIMD vectorisation of elementary expressions (eg. matrix addition) when using Clang 3.4+ with -O3 optimisation
- faster handling of sparse submatrix views
- workaround for a bug in LAPACK 3.4
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Problem description: One of my customers had a problem with their Selenium tests in the Jenkins continuous integration system. While Perl s Test::WebDriver still worked just fine the Selenium tests using Ruby s selenium-webdriver suddenly reported failures. The problem was caused by Debian wheezy s upgrade of the Iceweasel web browser. Debian originally shipped Iceweasel version 17.0.10esr-1~deb7u1 in wheezy, but during a security-update version 24.3.0esr-1~deb7u1 was brought in through the wheezy-security channel. Because the selenium tests are used in an automated fashion in a quite large and long-running build pipeline we immediately rolled back to Iceweasel version 17.0.10esr-1~deb7u1 so everything can continue as expected. Of course we wanted to get the new Iceweasel version up and running, but we didn t want to break the existing workflow while working on it. This is where on-demand slave selection through labels comes in.
Basics: As soon as you re using Jenkins slaves you can instruct Jenkins to run a specific project on a particular (slave) node. By attaching labels to your slaves you can also use a label instead of a specific node name, providing more flexibility and scalability (to e.g. avoid problems if a specific node is down or you want to scale to more systems). Then Jenkins decides which of the nodes providing the according label should be considered for job execution. In the following screenshot a job uses the selenium label to restrict its execution to the slaves providing selenium and currently there are two nodes available providing this label:
TIP 1: Visiting $JENKINS_SERVER/label/$label/ provides a list of slaves that provide that given $label (as well as list of projects that use $label in their configuration), like:

import hudson.model.* labels = Hudson.instance.getLabels() labels.each label -> println label.nameSolution: In the according customer setup we re using the swarm plugin (with automated Debian deployment through Grml s netscript boot option, grml-debootstrap + Puppet) to automatically connect our Jenkins slaves to Jenkins master without any manual intervention. The swarm plugin allows you to define the labels through the -labels command line option. By using the NodeLabel Parameter plugin we can configure additional parameters in Jenkins jobs: node and label . The label parameter allows us to execute the jobs on the nodes providing the requested label:
This is what we can use to gradually upgrade from the old Iceweasel version to the new one by keeping a given set of slaves at the old Iceweasel version while we re upgrading other nodes to the new Iceweasel version (same for the selenium-server version which we want to also control). We can include the version number of the Iceweasel and selenium-server packages inside the labels we announce through the swarm slaves, with something like:
if [ -r /etc/init.d/selenium-server ] ; then
FLAGS="selenium"
ICEWEASEL_VERSION="$(dpkg-query --show --showformat='$ Version ' iceweasel)"
if [ -n "$ICEWEASEL_VERSION" ] ; then
ICEWEASEL_FLAG="iceweasel-$ ICEWEASEL_VERSION%%.* "
EXTRA_FLAGS="$EXTRA_FLAGS $ICEWEASEL_FLAG"
fi
SELENIUM_VERSION="$(dpkg-query --show --showformat='$ Version ' selenium-server)"
if [ -n "$SELENIUM_VERSION" ] ; then
SELENIUM_FLAG="selenium-$ SELENIUM_VERSION%-* "
EXTRA_FLAGS="$EXTRA_FLAGS $SELENIUM_FLAG"
fi
fi
Then by using -labels $FLAGS EXTRA_FLAGS in the swarm invocation script we end up with labels like selenium iceweasel-24 selenium-2.40.0 for the slaves providing the Iceweasel v24 and selenium v2.40.0 Debian packages and selenium iceweasel-17 selenium-2.40.0 for the slaves providing Iceweasel v17 and selenium v2.40.0.
This is perfect for our needs, because instead of using the selenium label (which is still there) we can configure the selenium jobs that should continue to work as usual to default to the slaves with the iceweasel-17 label now. The development related jobs though can use label iceweasel-24 and fail as often as needed without interrupting the build pipeline used for production.
To illustrate this here we have slave selenium-client2 providing Iceweasel v17 with selenium-server v2.40. When triggering the production selenium job it will get executed on selenium-client2, because that s the slave providing the requested labels:
Whereas the development selenium job can point to the slaves providing Iceweasel v24, so it will be executed on slave selenium-client1 here:
This setup allowed us to work on the selenium Ruby tests while not conflicting with any production build pipeline. By the time I m writing about this setup we ve already finished the migration to support Iceweasel v24 and the infrastructure is ready for further Iceweasel and selenium-server upgrades.
So it may sound normal to receive compressed response for CSS/JS file
from Apache2 but what I faced is completely different behavior, here I
saw not just body of response but also header are getting compressed
and send to browser and browser was unable to interpret the response
there by leading page rendered without CSS and JS.
That was long story short, so let me explain in detail the case and
what I found out.
I have hosted SILPA on my VPS using
uWSGI. I had used till date using libapache2-mod-proxy-uwsgi plugin
for which uWSGI should be using network socket and in Apache2 config I
need ProxyPass directive pointing to uwsgi://host:port and
everything used to work out of box. There is a drawback for using
network socket in uWSGI that is limited amount of ports (65535) and
possible clash with other services if we use wrong port number,
additionally network sockets will be slower compared to the file
socket so yesterday I thought of changing it to file socket and
removed socket directive in the ini file for uWSGI application
container for SILPA and here is where all problems started. My updated
configuration can be seen in our documentation page
that is if you are interested to look my configuration file :-).
So you can see no response header in the above image but there is a
response and below how is response content visible on firebug.
Still weird part was when using wget/curl directly to get the CSS I
was getting correct reply and the file, which is puzzling.
So I went ahead opened the CSS url directly using browser and saved
the resulting file. When I used file command on it, output
suggested the saved file in gzip compressed!. I went ahead
uncompressed it and opened the file and inside it I found response
header and the response body! So what just happened? Did apache some
how manage to compress entire respone not just response body?
The more puzzling question was why did it work when I was using
mod_proxy_uwsgi and failed when I switched to mod_uwsgi. I had no
clue at this point why this behavior is coming up.
<IfModule mod_deflate.c>
# these are known to be safe with MSIE 6
AddOutputFilterByType DEFLATE text/html text/plain text/xml
# everything else may cause problems with MSIE 6
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
AddOutputFilterByType DEFLATE application/rss+xml
</IfModule>
So response is still gziped but this time only response body was
gziped and Content-Encoding field was set properly which makes browser
to properly uncompress the response body and use it.
So it seems like there is a difference between mod_uwsgi and
mod_proxy_uwsgi implementation. mod_uwsgi was sending the response
along with response headers which was compressed by mod_deflate there
by rendering browser helpless to interpret the response. But
mod_proxy_uwsgi seems to be only sending the response content without
response body and this content was later compressed by mod_deflate and
proper response headers were set by apache before sending it to
browser.
So now whose fault is this? Is it the bug in mod_uwsgi or, mod_deflate
not being able to exclude response headers from compression? I've no
clue! If you have a clue and you want to share it with me, please
consider writing to me over email. My details are available in
Contacts
Thanks to bernat on #debian @ irc.debian.org for helping me track down this bug and devise a workaround.
When working on my wife s netbook, I noticed that when idling on Facebook in iceweasel 24.3.0esr-1, the process was taking far too much CPU. I then retested on a wheezy system with the release iceweasel from mozilla.d.n, which at that time was 26, and I later upgraded to 27. Same problem there, too, on both versions. In fact, it seems the slowdown was amplified by the fact that I was running iceweasel in vnc4server, not the worlds most efficient X implementation.
Even with all these versions tested, I have yet to file a Debian bug, as I will need some time on a system where the slowdown is noticeable and I m using a current Debian version. But I wanted to post now to give props to bernat for his help. If you think you have this issue, go read his article linked above, which contains the workaround.
I've written before of how much I liked the British SF magazine
Interzone. Sadly I decided not to renew my subscription last year, as the
focus of my reading has been changing and I've not had enough time to keep on
top of it. (This is a consequence of my experiment with goodreads, and
I'll write more about that sometime.)
Back in October 2012 TTA Press reformatted both Interzone and its sister
publication Black Static into a half-size, semi-hard backed shape. The size
is similar to the US stalwards Analog and Asimov's, but the cover is harder
and glossier and it has a flat spine. I really like the new look, and it's a
bit of a shame I didn't complete at least a calendar year's worth of them.
I will probably pick up the odd issue now and then, when a name I recognise
catches my eye. Perhaps one day I'll have the time and inclination to read
short fiction regularly again. I'd still wholeheartedly recommend it (and
Black Static) if short fiction is your thing.
| Component | Skills |
|---|---|
| gmond agent | C |
| gmond modules | C or Python |
| JMXetric | Java |
| gmetad and rrdtool for storing time series data | C |
| Ganglia web interface | JavaScript and jQuery |
| Ganglia integration (e.g. ganglia-nagios-bridge) | Python |
| Port | Comments |
|---|---|
| 8649 | gmond: sends an XML snapshot to anybody who connects |
| 8651 | gmetad: sends an XML snapshot to anybody who connects |
| 8651 | gmetad: works a little bit like HTTP, returns a subset of the XML snapshot when you make a GET request |
udp_send_channel host = ganglia-reports.example.edu port = 8649 ttl = 1This tells you that the host ganglia-reports.example.edu is collecting the data - you could try the URL http://ganglia-reports.example.edu/ganglia/ in a web browser or try connecting to one of the TCP ports 8649, 8651 or 8652 on that host. Here is an example with netcat:
$ nc ganglia-reports.example.edu 8649 grep ^.HIt will return a list of all hosts that Ganglia knows about. Once you have a data feed, you can then configure a gmetad process on your own system to poll the remote system and generate local RRDs for you to study. Install your own Ganglia It is very easy to get your own Ganglia setup. On a Debian or Ubuntu system, just do:
# apt-get update # apt-get install ganglia-monitor ganglia-webfrontendOn Fedora and RPM-based systems (such as CentOS or RHEL with EPEL) you can do:
# yum install ganglia-gmond ganglia-webEverything should be autoconfigured. You can then browse to http://localhost/ganglia to see the charts. If you have several hosts with the gmond agent (just the ganglia-monitor.deb or ganglia-gmond.rpm) on the same LAN, they will automatically find each other using multicast and you will see an aggregated report on the machine with the web server. The data is real-time It is important to keep in mind that the data is real-time. This means you can often detect problems in real-time. If this blog appears on slashdot, for example, then that image from Universit Montpellier 2 will be hit many times. The image actually shows the network load on the web server producing the image, so you will see the slashdot effect graphically in the image itself. Processing real-time data is often the most advanced step in any data science exercise. Initially, you may simply log a few days of data to RRD files to start studying a static data set with your tool of choice, whether it is the R project, Weka or Hadoop Once you have a a hypothesis (for example, an algorithm that understands the normal characteristics of each metric) you may then take each new real-time value from the gmetad XML and test it with the algorithm. The algorithm would then raise an alert if any metric on any host deviates from its normal behavior. Mixing in other sources of data Depending upon the computing environment in your campus or organization, you may also be able to get other data sources, such as a list of people logged in to different machines at different times and the processes that each user starts and stops. This might help to make more accurate predictions about when network or computing resources will be under stress. For example, if users bob, alice and eve all appear on the same host, your algorithm might conclude that the load average will reach an excessive level within 15 minutes and send those three users a suggestion to each try other machines. Making a successful application for GSoC 2014 Here are some tips
Update on 2014-03-03: quoting Colin Watson from the comments:
Note that this is spelled GRUB_ENABLE_CRYPTODISK=y in GRUB 2.02 betas (matching the 2.00 documentation though not the implementation; not sure why Andrey chose to go with the docs).Since several people asked me how to get such a setup and it s poorly documented (as in: I found it in the GRUB sources) I decided to blog about this. When using GRUB >=2.00-22 (as of February 2014 available in Debian/jessie and Debian/unstable) it s possible to boot from a full-crypto setup (this doesn t mean it s recommended, but it worked fine in my test setups so far). This means not even an unencrypted /boot partition is needed. Before executing the grub-install commands execute those steps (inside the system/chroot of course, adjust GRUB_PRELOAD_MODULES for your setup as needed, I ve used it in a setup with SW-RAID/LVM):
# echo GRUB_CRYPTODISK_ENABLE=y >> /etc/default/grub # echo 'GRUB_PRELOAD_MODULES="lvm cryptodisk mdraid1x"' >> /etc/default/grubThis will result in the following dialog before getting to GRUB s bootsplash:
Moving from Lilo to GRUB, using LVM as default, etc throughout the last years it was time to evaluate how well LVM works without a separate boot partition, possibly also on top of Software RAID. Big disks are asking for partitioning with GPT, just UEFI isn t my default yet, so I m still defaulting to Legacy BIOS for Debian/wheezy (I expect this to change for Debian/jessie and according hardware approaching at my customers).
So what we have and want in this demonstration setup:
root@grml ~ # grml-version grml64-full 2013.09 Release Codename Hefeknuddler [2013-09-27]Partition setup:
root@grml ~ # parted /dev/sda GNU Parted 2.3 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) mklabel gpt (parted) mkpart primary 2048s 4095s (parted) set 1 bios_grub on (parted) name 1 "BIOS Boot Partition" (parted) mkpart primary 4096s 100% (parted) set 2 raid on (parted) name 2 "SW-RAID / Linux" (parted) quit Information: You may need to update /etc/fstab.Clone partition layout from sda to all the other disks:
root@grml ~ # for f in b,c,d ; sgdisk -R=/dev/sd$f /dev/sda The operation has completed successfully. The operation has completed successfully. The operation has completed successfully.Make sure each disk has its unique UUID:
root@grml ~ # for f in b,c,d ; sgdisk -G /dev/sd$f The operation has completed successfully. The operation has completed successfully. The operation has completed successfully.SW-RAID setup:
root@grml ~ # mdadm --create /dev/md0 --verbose --level=raid5 --raid-devices=4 /dev/sd a,b,c,d 2 mdadm: layout defaults to left-symmetric mdadm: layout defaults to left-symmetric mdadm: chunk size defaults to 512K mdadm: size set to 1465004544K mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md0 started. root@grml ~ #SW-RAID speedup (system dependent, YMMV):
root@grml ~ # cat /sys/block/md0/md/stripe_cache_size 256 root@grml ~ # echo 16384 > /sys/block/md0/md/stripe_cache_size # 16MB root@grml ~ # blockdev --getra /dev/md0 6144 root@grml ~ # blockdev --setra 65536 /dev/md0 # 32 MB root@grml ~ # sysctl dev.raid.speed_limit_max dev.raid.speed_limit_max = 200000 root@grml ~ # sysctl -w dev.raid.speed_limit_max=9999999999 dev.raid.speed_limit_max = 9999999999 root@grml ~ # sysctl dev.raid.speed_limit_min dev.raid.speed_limit_min = 1000 root@grml ~ # sysctl -w dev.raid.speed_limit_min=100000 dev.raid.speed_limit_min = 100000LVM setup:
root@grml ~ # pvcreate /dev/md0 Physical volume "/dev/md0" successfully created root@grml ~ # vgcreate homesrv /dev/md0 Volume group "homesrv" successfully created root@grml ~ # lvcreate -n rootfs -L4G homesrv Logical volume "rootfs" created root@grml ~ # lvcreate -n bootfs -L1G homesrv Logical volume "bootfs" createdCheck partition setup + alignment:
root@grml ~ # parted -s /dev/sda print
Model: ATA WDC WD15EADS-00P (scsi)
Disk /dev/sda: 1500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB BIOS Boot Partition bios_grub
2 2097kB 1500GB 1500GB SW-RAID / Linux raid
root@grml ~ # parted -s /dev/sda unit s print
Model: ATA WDC WD15EADS-00P (scsi)
Disk /dev/sda: 2930277168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 2048s 4095s 2048s BIOS Boot Partition bios_grub
2 4096s 2930276351s 2930272256s SW-RAID / Linux raid
root@grml ~ # gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.5
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 2930277168 sectors, 1.4 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 212E463A-A4E3-428B-B7E5-8D5785141564
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 2930277134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2797 sectors (1.4 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 4095 1024.0 KiB EF02 BIOS Boot Partition
2 4096 2930276351 1.4 TiB FD00 SW-RAID / Linux
root@grml ~ # mdadm -E /dev/sda2
/dev/sda3:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 7ed3b741:0774d529:d5a71c1f:cf942f0a
Name : grml:0 (local to host grml)
Creation Time : Fri Jan 31 15:26:12 2014
Raid Level : raid5
Raid Devices : 4
Avail Dev Size : 2928060416 (1396.21 GiB 1499.17 GB)
Array Size : 4392089088 (4188.62 GiB 4497.50 GB)
Used Dev Size : 2928059392 (1396.21 GiB 1499.17 GB)
Data Offset : 262144 sectors
Super Offset : 8 sectors
State : clean
Device UUID : c1e4213b:81822fd1:260df456:2c9926fb
Update Time : Mon Feb 3 09:41:48 2014
Checksum : b8af8f6 - correct
Events : 72
Layout : left-symmetric
chunk size : 512k
Device Role : Active device 0
Array State : AAAA ('A' == active, '.' == missing)
root@grml ~ # pvs -o +pe_start
PV VG Fmt Attr PSize PFree 1st PE
/dev/md0 homesrv lvm2 a-- 4.09t 4.09t 1.50m
root@grml ~ # pvs --units s -o +pe_start
PV VG Fmt Attr PSize PFree 1st PE
/dev/md0 homesrv lvm2 a-- 8784175104S 8773689344S 3072S
root@grml ~ # pvs -o +pe_start
PV VG Fmt Attr PSize PFree 1st PE
/dev/md0 homesrv lvm2 a-- 4.09t 4.09t 1.50m
root@grml ~ # pvs --units s -o +pe_start
PV VG Fmt Attr PSize PFree 1st PE
/dev/md0 homesrv lvm2 a-- 8784175104S 8773689344S 3072S
root@grml ~ # vgs -o +pe_start
VG #PV #LV #SN Attr VSize VFree 1st PE
homesrv 1 2 0 wz--n- 4.09t 4.09t 1.50m
root@grml ~ # vgs --units s -o +pe_start
VG #PV #LV #SN Attr VSize VFree 1st PE
homesrv 1 2 0 wz--n- 8784175104S 8773689344S 3072S
Cryptsetup:
root@grml ~ # echo cryptsetup >> /etc/debootstrap/packages root@grml ~ # cryptsetup luksFormat -c aes-xts-plain64 -s 256 /dev/mapper/homesrv-rootfs WARNING! ======== This will overwrite data on /dev/mapper/homesrv-rootfs irrevocably. Are you sure? (Type uppercase yes): YES Enter passphrase: Verify passphrase: root@grml ~ # cryptsetup luksOpen /dev/mapper/homesrv-rootfs cryptorootfs Enter passphrase for /dev/mapper/homesrv-rootfs:Filesystems:
root@grml ~ # mkfs.ext4 /dev/mapper/cryptorootfs
mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=128 blocks, Stripe width=384 blocks
262144 inodes, 1048192 blocks
52409 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1073741824
32 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
root@grml ~ # mkfs.ext4 /dev/mapper/homesrv-bootfs
mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=128 blocks, Stripe width=384 blocks
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
Install Debian/wheezy:
root@grml ~ # mount /dev/mapper/cryptorootfs /media root@grml ~ # mkdir /media/boot root@grml ~ # mount /dev/mapper/homesrv-bootfs /media/boot root@grml ~ # grml-debootstrap --target /media --password YOUR_PASSWORD --hostname YOUR_HOSTNAME * grml-debootstrap [0.57] - Please recheck configuration before execution: Target: /media Install grub: no Using release: wheezy Using hostname: YOUR_HOSTNAME Using mirror: http://http.debian.net/debian Using arch: amd64 Important! Continuing will delete all data from /media! * Is this ok for you? [y/N] y [...]Enable grml-rescueboot (to have easy access to rescue ISO via GRUB):
root@grml ~ # mkdir /media/boot/grml root@grml ~ # wget -O /media/boot/grml/grml64-full_$(date +%Y.%m.%d).iso http://daily.grml.org/grml64-full_testing/latest/grml64-full_testing_latest.iso root@grml ~ # grml-chroot /media apt-get -y install grml-rescueboot[NOTE: We're installing a daily ISO for grml-rescueboot here because the 2013.09 Grml release doesn't work for this LVM/SW-RAID setup while newer ISOs are working fine already. The upcoming Grml stable release is supposed to work just fine, so you will be able to choose http://download.grml.org/grml64-full_2014.XX.iso by then. :)] Install GRUB on all disks and adjust crypttab, fstab + initramfs:
root@grml ~ # grml-chroot /media /bin/bash (grml)root@grml:/# for f in a,b,c,d ; do grub-install /dev/sd$f ; done (grml)root@grml:/# update-grub (grml)root@grml:/# echo "cryptorootfs /dev/mapper/homesrv-rootfs none luks" > /etc/crypttab (grml)root@grml:/# echo "/dev/mapper/cryptorootfs / auto defaults,errors=remount-ro 0 1" > /etc/fstab (grml)root@grml:/# echo "/dev/mapper/homesrv-bootfs /boot auto defaults 0 0" >> /etc/fstab (grml)root@grml:/# update-initramfs -k all -u (grml)root@grml:/# exitClean unmounted/removal for reboot:
root@grml ~ # umount /media/boot root@grml ~ # umount /media/ root@grml ~ # cryptsetup luksClose cryptorootfs root@grml ~ # dmsetup remove homesrv-bootfs root@grml ~ # dmsetup remove homesrv-rootfsNOTE: On a previous hardware installation I had to install GRUB 2.00-22 from Debian/unstable to get GRUB working.
# grub-install --recheck /dev/sda error: unknown LVM metadata header. error: unknown LVM metadata header. /usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/mapper/cryptorootfs. Check your device.map. Auto-detection of a filesystem of /dev/mapper/cryptorootfs failed. Try with --recheck. If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/boot/grub/device.map" --target=fs -v /boot/grub" to <bug-grub@gnu.org>
The next step on this front will be the addition of path-based
searches, using the excellent Postgres trigram
indexes.
Next.