tag:blogger.com,1999:blog-32374324593432351222024-03-14T08:26:55.460+02:00Ex glacie gaudiumThe blog of a man stuck in the ice...Peter Antoniachttp://www.blogger.com/profile/16563005134260327090noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-3237432459343235122.post-43673105198366250622013-09-29T04:00:00.000+03:002013-09-29T19:09:32.178+03:00Recovering from a major RAID5 with 2 disks failing out of 4Yes. The title is a bit unrealistic, because if you have 2 disks failing out of 4, you are out of business. But I was lucky. One disk was failing into <span style="color: red;">WRITE</span> (at least that is what S.M.A.R.T. was saying). The other one was failing into <span style="color: red;">READ</span> (well, I didn't need S.M.A.R.T. to tell me anything, it just failed!). So, how did I manage (and believe me, this was a long, sleepless night, full of events). First, I took the disk that was failing <span style="color: red;">WRITE</span> commands and put it in another computer where I had some extra, unused disks (well, I just have them hanging there...). There, I copied the disk using dd (ah, you need Linux for this to work! Is there anything else but Linux for these kind of jobs anyway?):
<br />
<pre class="brush: bash">dd if=/dev/sd${OLD} of=/dev/sd${NEW} # where you can replace your drives with the ones fitting your case
</pre>
<br />
And here is where I got lucky! I managed to copy the whole drive on the new drive. But I wasn't not that lucky. When I put the drive back in the array. BOOHOOO! My RAID5 had 2 good drives now (one of them was the new one) but the third one was a <span style="color: red;">SPARE</span>!!! So, I still couldn't assemble the array. But there is a catch, I could rebuild the array without touching the data... Here is how it was looking before:
<br />
<pre class="brush: bash">cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md0 : inactive sdb3[4](S) sda3[0] sdc3[2]
XXXXXXXXXX blocks
</pre>
<br />
As you can see, the sdb3 is seen as a <span style="color: red;">SPARE</span>! Now, that is wrong, and it shouldn't be. So, I had to risk, declare the whole array as wrong and hope that the <span style="color: red;">SPARE</span> could actually have the information to get me out of this stall state. So, here is how I activated the <span style="color: red;">SPARE</span>:
<br />
<pre class="brush: bash">mdadm --stop /dev/md0 # Stop the md0 array
mdadm -Cv /dev/md0 --assume-clean --level=5 --layout=left-symmetric --chunk=64 --raid-devices=4 /dev/sda3 /dev/sdb3 /dev/sdc3 missing # Remember, sdb was a SPARE and the sdd was GONE :)
[...CUT...]
Continue creating array? yes # I answered here with yes...
mdadm: array /dev/md0 started.
</pre>
<br />
After that, I stopped, took a break (or a deep breath) and then looked into the array status:
<br />
<pre class="brush: bash">cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md0 : active raid5 sdc3[2] sdb3[1] sda3[0]
4391961792 blocks level 5, 64k chunk, algorithm 2 [4/3] [UUU_]
</pre>
<br />
You can see that the last one is gone missing (is marked as "_"). Better way to look at it is via:
<br />
<pre class="brush: bash">mdadm --detail /dev/md0
/dev/md0:
Version : [...CUT...]
Creation Time : [...CUT...]
Raid Level : raid5
Array Size : [...CUT...]
Used Dev Size : [...CUT...]
Raid Devices : 4
Total Devices : 3
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : [...CUT...]
State : clean, degraded
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 64K
UUID : [...CUT...]
Events : [...CUT...]
Number Major Minor RaidDevice State
0 8 3 0 active sync /dev/sda3
1 8 19 1 active sync /dev/sdb3
2 8 35 2 active sync /dev/sdc3
3 0 0 3 removed
</pre>
<br />
Next, all you need to do is add another clean drive (no partition table, you can wipe it out with dd if=/dev/zero of=/dev/sd${CLEAN} bs=512 count=8) and then make sure to let the array md0 know about it like this:
<br />
<pre class="brush: bash">mdadm -a /dev/md0 /dev/sdd3
mdadm: added /dev/sdd3
</pre>
<br />
Now, if you have problems with the partition of the drive, you can replicate the partition from one of the active drives (in my case, /dev/sda as master, and /dev/sdd as the target) like this:
<br />
<pre class="brush: bash">sfdisk -d /dev/sda | sfdisk /dev/sdd
</pre>
<br />
At the end of the process, you should see something like this:
<br />
<pre class="brush: bash">mdadm --detail /dev/md0
/dev/md0:
Version : [...CUT...]
Creation Time : [...CUT...]
Raid Level : raid5
Array Size : [...CUT...]
Used Dev Size : [...CUT...]
Raid Devices : 4
Total Devices : 4
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : [...CUT...]
State : clean, degraded, recovering
Active Devices : 3
Working Devices : 4
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 64K
Rebuild Status : 0% complete
UUID : [...CUT...]
Events : 0.8
Number Major Minor RaidDevice State
0 8 3 0 active sync /dev/sda3
1 8 19 1 active sync /dev/sdb3
2 8 35 2 active sync /dev/sdc3
4 8 51 3 spare rebuilding /dev/sdd3
</pre>
<br />
And if you want to go closer to the kernel, you can always enter the sysfs like this:
<br />
<pre class="brush: bash">cd /sys/block/md0/md
ls -al
[...CUT...]
</pre>
<br />
You can sync, (echo check > sync_action) etc...<br />
<br />
Well, that is all folks. I hope it gives other lost souls (or damage raid5 disks unlucky ones) a good idea how to recover the data. Drop a comment if you have questions or additions...
Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0Oulu, Finland65.030423104405344 25.47729492187564.601559604405338 24.186401421875 65.459286604405349 26.768188421875tag:blogger.com,1999:blog-3237432459343235122.post-58265790436242072382013-03-17T18:00:00.000+02:002013-03-18T15:22:00.639+02:00OpenSSH key, Amazon EC2 RSA, Android and dropbear (from Terminal IDE)Here is the thing: I have quite complicated SSH key (uses AES-128-CBC) and while there are posts about converting the openssh key to dropbear format, they fail to mention that the openssh key needs to be in some PEM (or more streamline) format. That might seam easy, but when you try to convert using the common example, you might end up getting an error like this:
<br />
<pre class="brush: bash">/usr/lib/dropbear/dropbearconvert openssh dropbear ~/.ssh/id_rsa /tmp/id_rsa.db
Error: Ciphers other than DES-EDE3-CBC not supported
Error reading key from '~/.ssh/id_rsa'
</pre>
That happens especially if you have keys generate by the Amazon Web Services, or EC2. Those generally look like this:
<br />
<pre class="brush: bash">head -3 ~/.ssh/id_rsa_amazon_ec2
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,1234567890ABCSFTDHIJKLMNOPQRSTUV
</pre>
<br />
Now, that sucks! And google-ing didn't get me very far. So, if you have no idea what to make from that error, well, fear not, as there is a simple solution, coming from openssl. You will need to convert your key to PEM and then, use the dropbearconvert tool like this:
<br />
<pre class="brush: bash">openssl rsa -in ~/.ssh/id_rsa -outform pem > ~/.ssh/id_rsa.pem
</pre>
You will need to enter your pass phrase if using one:
<br />
<pre class="brush: bash">Enter pass phrase for id_rsa:
writing RSA key
</pre>
<br />
<blockquote class="tr_bq">
At this point, technically, that key is the same but you have removed the passphrase (you could do the same by using ssh-keygen -p -f ~/.ssh/id_rsa, but then, you will have to put it back).</blockquote>
<br />
And now, using the converter on the PEM:
<pre class="brush: bash">/usr/lib/dropbear/dropbearconvert openssh dropbear ~/.ssh/id_rsa.pem ~/.ssh/id_rsa.db
</pre>
<br />
And you will get your key:
<br />
<pre class="brush: bash">Key is a RSA key
Wrote key to '~/.ssh/id_rsa.db'
</pre>
<br />
Hope this helps someone like me that uses the Amazon generated SSH keys and needs them in the Android side (by the way, I needed it for use with Terminal IDE ssh, which I love)...
NOTE: You should remove that file from your system as it is password-less. This could allow someone to use it without knowing your pass phrase!Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-19428770952629088612012-04-30T09:38:00.001+03:002012-04-30T09:40:02.178+03:00N9 and N950: Harmattan way, or how to get your deb package out of the store.nokia.com...Well, if you had problems like I did with installing some applications from the <a href="https://store.nokia.com/">https://store.nokia.com</a>, here is the very simple recipe how to get around the problem.
<br />
<br />
But first, a brief introduction into the whys. I wanted to install an application that I saw demonstrated by a friend. When I tried installing it from the Store, it failed with an error about not being able to download. I was puzzled for a long time, filled a bug, waited some time until I thought to give it a try and install it in the old fashion way: manually. So, I fired up a console, find out a way to get the debian packge and then install it.
<br />
<br />
This entry is how to get the debian package file out. For that, you need the console (terminal) and hence you need the device to have the developer mode enabled.
<br />
<br />
In the console, you just need to do this:
<br />
<pre class="brush: bash">/usr/bin/osa --get packagename > packagename_versioin_armel.deb
</pre>
<br />
Hope this helps some folks out there searching for answers, and those that still don't have one, go buy it while you can!
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&bc1=000000&IS1=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=exglaciegaudi-20&o=1&p=8&l=as1&m=amazon&f=ifr&ref=tf_til&asins=B005Z32UI2" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-61250555445772277162011-12-30T09:06:00.000+02:002012-08-21T20:06:27.299+03:00MOSLO, a short story of how is it cookedWell, <a href="http://tablets-dev.nokia.com/moslo.php">MOSLO</a> has been OUT for some time now, and I was thinking it might be time for me to explain more about it!<br />
<br />
First, for those not knowing it yet, it is available here: <a href="http://wiki.meego.com/ARM/N950">http://wiki.meego.com/ARM/N950</a>.
The <a href="http://tablets-dev.nokia.com/moslo.php">MOSLO</a> was done to support multiple OS loading on the N9/N950 devices from Nokia.<br />
<br />
The basic "architecture" or flow is this:<br />
<ol>
<li>Bootloader launches the kernel</li>
<li>The kernel boots from rootfs</li>
<li>Rootfs contains the scripts to either:</li>
<ol>
<li> export USB to the Host PC so that the developer can put another kernel (in the boot/bzImage) and rootfs or</li>
<li>load the boot/bzImage from the "exported USB" image if there is such kernel</li>
</ol>
</ol>
Another thing about <a href="http://tablets-dev.nokia.com/moslo.php">MOSLO</a> is how to install it. Here we need to understand a bit about the role of the Harmattan flashing architecture. The design is to load into the device the right software that will do the work of flashing <a href="http://tablets-dev.nokia.com/moslo.php">MOSLO</a>. For that, we can use any Harmattan image (or "fiasco.bin") that is released with the One Click Flasher (or OCF).<br />
<br />
Once we have the right image loaded, we can send the MOSLO to be flashed. As such, <a href="http://tablets-dev.nokia.com/moslo.php">MOSLO</a> comes packaged for N950 or N9.Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-63573316369872601962011-05-21T09:48:00.000+03:002011-05-21T09:48:04.992+03:00Ubuntu, extra repositories (ppa's) and living on the edge...For those that are using launchpad, the term PPA should be quite familiar. This short entry is for them. I have been using PPA since 4-5 years ago. Before, I used to have my own repos in: packages.antoniac.name. <b>Then</b>, something changed and Ubuntu guys, through launchpad.net, started allowing personal package archive access (or PPA) and builds. Now, the trouble with them is the conflicting of packages (you might think). However, behind the PPA submission of packages is a clever name convention and ultimately you have quite a good control of where the package comes from. Now, to add more honey to the sweet thing, you could use several commands to automate inclusion and removal of the ppa's:<br />
<br />
<pre class="brush: bash">sudo aptitude install ppa-purge # To be able to remove it later (if you don't have it)
sudo apt-add-repository ppa:pan1nx/ppa
sudo aptitude update
sudo aptitude safe-upgrade # or install new packages
sudo ppa-purge ppa:pan1nx/ppa # To remove the packages and install the original
</pre><br />
Hope this help some of you handle the ppa's in a friendlier way...Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-60581141457293995432011-04-20T22:57:00.001+03:002011-06-19T00:08:54.894+03:00Console rulez (as in linux console)Yep, once again I find myself dragged into blabbing about the beauty of the consoles. I had some troubles with the network and the only way to work in the servers room was, you guessed, console.<br />
<br />
Now, I want to briefly share some goodies with you:<br />
<br />
<dl><dt><u><b>wavemon</b></u></dt>
<dd>Awesome tool for helping you with debugging the wifi signal at the server (if you have such thing at the server)</dd>
<dt><u><b>iperf</b></u></dt>
<dd>Another good tool to test the performance between two points on the network</dd>
<dt><u><b>nload</b></u></dt>
<dd>Comes very handy if you need a graph showing the bandwidth. There are other tools here, like iptraf, etc. I just like this one...</dd> </dl><br />
Hack, I should expand this article later when I remember other goodies like this...Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-41033347295413278862011-02-17T09:44:00.002+02:002012-03-26T22:43:07.844+03:00QNAP, FlexGet and Transmission or How to watch your favorite TV shows without a DVR/TiVo...Well, if you, like me, enjoy downloading shows from the web via RSS, there is FlexGet (from <a href="http://flexget.com/">FlexGet.com</a>. Problem is, how to get that egg running on your NAS (especially when you have the old QNAP x09). Here are some steps to come to your aid:<br />
<br />
<ol>
<li>You need to have ipkg. I used the QPKG to install the IPKG then, in ipkg, I use the repository from:<br />
<br />
<pre class="brush: bash">http://ipkg.nslu2-linux.org/feeds/optware/tsx09/cross/unstable/Packages</pre>
</li>
<li>Second, you need to install the right python setuptools (after running ipkg update, of course):<br />
<br />
<pre class="brush: bash">[~] # ipkg install py25-setuptools
Installing py25-setuptools [.....]
Successfully terminated.
</pre>
<br />
Be patient, this took a while to install...<br />
</li>
<li>Then, from the <a href="http://flexget.com/wiki/InstallWizard/Linux/Environment/FlexGet">FlexGet page</a> you get the right download and install it (at the time at this post I was running it like this):<br />
<br />
<pre class="brush: bash">mkdir /share/tmp
export TEMP=/share/tmp
cd /share/tmp/
wget http://download.flexget.com/unstable/FlexGet-1.0r1419-py2.6.egg
ls
# shows FlexGet-1.0r1419-py2.6.egg
easy_install ./FlexGet-1.0r1419-py2.6.egg</pre>
Another alternative to fix the TEMP is to make the /tmp size bigger:
<pre class="brush: bash">mount -o remount,size=128M /tmp</pre>
<br />
Make sure you change the default temp directory as it will run out of space if you use the default one.<br />
</li>
<li>Now you have it installed in /opt/local/bin/flexget and you should make it work for you. Edit the crontab and add (username is whatever user you have there, or other favorite location). Beware that crontab is in /etc/config/crontab or /mnt/HDA_ROOT/.config/crontab:<br />
<pre class="brush: bash">0 4 * * * /opt/local/bin/flexget --cron -c /share/*USERNAME*/.flexget/config.yml
</pre>
</li>
<li>Config file shold be linked also:<br />
<br />
<pre class="brush: bash">ln -s /share/username/.flexget/config.yml /share/MD0_DATA/.qpkg/Optware/local/config.yml
</pre>
</li>
<li>Install transmission<br />
<pre class="brush: bash">ipkg install transmission</pre>
</li>
<li>Install your own rc.local that will auto-start the transmission at reboot:<br />
<pre class="brush: bash">cat > /share/*USERNAME*/rc.local <<EOF
#!/bin/sh
echo "/share/MD0_DATA/.qpkg/Optware/lib/" >> /etc/ld.so.conf
ldconfig
export EVENT_NOEPOLL=0
export TRANSMISSION_WEB_HOME=/share/MD0_DATA/.qpkg/Optware/share/transmission/web
/share/MD0_DATA/.qpkg/Optware/bin/transmission-daemon -p 9091 -T -a YOUR.SUBNET.IP.* -w /share/Qdownload/ -g /share/Qdownload/config/ > /var/log/debug_tm.txt
EOF
</pre>
</li>
<li>And if you want to be more of a maniac and optimize the TCP/IP stack default, you can append this:<br />
<pre class="brush: bash">cat >> /share/*USERNAME*/rc.local <<EOF
# Some tcp/ip optimizations
ifconfig eth0 txqueuelen 50000
# ifconfig eth1 txqueuelen 50000
# default: 0
echo 1 > /proc/sys/net/ipv4/tcp_rfc1337
# default: 0
echo 2 > /proc/sys/net/ipv4/tcp_frto
# default: 0
echo 1 > /proc/sys/net/ipv4/tcp_mtu_probing
# default: 0
echo 1 > /proc/sys/net/ipv4/tcp_workaround_signed_windows
# default: 0
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
# default: 0
echo 1 > /proc/sys/net/ipv4/tcp_low_latency
# default: 0
echo 1 > /proc/sys/net/ipv4/tcp_ecn
EOF
</pre>
</li>
</ol>
<br />
Comments are welcome. There are other fine tunning things that you can do also, especially regarding the transmission configuration, twonkymedia, or even flexget, so fell free to ask me questions...<br />
<br />
Useful link for:<br />
1. <a href="http://forum.qnap.com/viewtopic.php?f=146&t=23059">Transmission</a><br />
2. <a href="http://wiki.qnap.com/wiki/Running_Your_Own_Application_at_Startup">wiki: Running Your Own Application at Startup</a><br />
3. <a href="http://www.speedguide.net/read_articles.php?id=121">Network speed optimizations</a>Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com1tag:blogger.com,1999:blog-3237432459343235122.post-33017112152406219592010-12-02T17:29:00.002+02:002010-12-02T17:29:00.380+02:00x86 64 vs 32, still messyJust when I thought that the mess between 32 bit and 64 bit was over (I am talking about Linux, of course) I got bumped into it again. Problem this time was the lightning plug-in or add-on for Thunderbird. Here was the solution:<br />
<br />
<a href="http://releases.mozilla.org/pub/mozilla.org/calendar/lightning/releases/1.0b2rc3/contrib/linux-x86_64/">http://releases.mozilla.org/pub/mozilla.org/calendar/lightning/releases/1.0b2rc3/contrib/linux-x86_64/</a><br />
<br />
Me so sad...Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-13484925268859192312010-03-28T17:05:00.004+03:002010-06-07T13:18:24.402+03:00The N900 boost: getting the turn-based navigator in...It has been a while since I was excited about the new (back then) <a target="_blank" href="http://www.amazon.com/Nokia-N900-Unlocked-Computer-Touchscreen/dp/B002OB49SW?ie=UTF8&tag=exglaciegaudi-20&link_code=btl&camp=213689&creative=392969">N900</a><img src="http://www.assoc-amazon.com/e/ir?t=exglaciegaudi-20&l=btl&camp=213689&creative=392969&o=1&a=B002OB49SW" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important; padding: 0px !important" />. Little did I know that the device will go in couple of months through the war of the MeeGo announcement and several delays in some basic applications. One of those being the basic navigator. Yes, it comes with Ovi Maps 1.0, but that cannot help but tell you where you are (and even that with some aid from the online connection). Having this long introduction, I am here to actually write about the new comer on my device: <a href="http://www.sygic.com/maemo">The Sygic Mobile Maps</a><br />
<br />
The new application comes in a zip file, you un-zip it on the root of the Internal Nokia <a target="_blank" href="http://www.amazon.com/Nokia-N900-Unlocked-Computer-Touchscreen/dp/B002OB49SW?ie=UTF8&tag=exglaciegaudi-20&link_code=btl&camp=213689&creative=392969">N900</a><img src="http://www.assoc-amazon.com/e/ir?t=exglaciegaudi-20&l=btl&camp=213689&creative=392969&o=1&a=B002OB49SW" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important; padding: 0px !important" /> drive and then install the .deb file. It probably would have been easier via the Ovi.com portal, but since Nokia delayed their acceptance, the Sygic guys decided to go by themselves. After all, the N900 users should know their ways around to install a local file.<br />
<br />
Now, let's get to the business of running the application. Firs, it has a wide range of maps (all of Europe, at the price of ~60€). Then, it has many voices available. I would have liked a female voice for English, but the britt there is quite entertaining.<br />
<br />
Then, the routing. It starts fast, it remembers the last destination (although, the settings get lost if you don't exit the application the right way... bad programming) and it is easy to use. Also, I like that I can change the things that I want to see (it has quite a nice personalization ideas). The a-gps might come handy, but here, in Finland, I don't make use of it. Another thing was that it had some routing that was not quite the best way to go around, but again, that is hard to please everyone. After all, it gets you from point A to B in the best way a computer can get you.<br />
<br />
So, conclusion? I love even more the N900<iframe src="http://rcm.amazon.com/e/cm?t=exglaciegaudi-20&o=1&p=8&l=bpl&asins=B002OB49SW&fc1=000000&IS2=1<1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>. It has everything that a Linux freak can want (well the most anyway). I hope that Nokia will keep this thing up and with Intel we will see better devices, with better UI and having the best of Free Software running so that more developers will join the fun. Yes, it is a lot of fun to have the <a target="_blank" href="http://www.amazon.com/Breach-of-Trust-ebook/dp/B001SK4JXK?ie=UTF8&tag=exglaciegaudi-20&link_code=btl&camp=213689&creative=392969">N900</a><img src="http://www.assoc-amazon.com/e/ir?t=exglaciegaudi-20&l=btl&camp=213689&creative=392969&o=1&a=B001SK4JXK" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important; padding: 0px !important" />...Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-7771200618629276152010-01-07T23:59:00.011+02:002010-05-14T14:43:57.843+03:00UPDATE4: Kubuntu/Ubuntu: OCZ SSD, swap, memory, 64 bit, or how to pimp your life with a Panasonic CF-R8...Here is some overview on how to get a new <a href="https://wiki.ubuntu.com/LaptopTestingTeam/PanasonicCFR8">Panasonic CF-R8</a> to work with Ubuntu and an <a href="http://www.ocztechnology.com/products/solid_state_drives/sata_2_5_solid_state_drives">OCZ-Vertex</a> SSD...<br />
<br />
First, you need to open up your laptop in order to change the drive. I will come back on this pictures in another article later...<br />
<br />
Then, you need to make sure that the OCZ partitions are aligned properly (that is before you install the Ubuntu/Kubuntu). Before you start, make sure that you have backed up all the partition (i.e., use rsync -ax / /mnt/USB) and then, in a console/shell with fdisk:<br />
<pre class="brush: bash">fdisk -H 32 -S 32 /dev/sda</pre><br />
And of course, the creation of the partition (use :<br />
<pre class="brush: bash">Command (m for help): o
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-15711, default 1): 2
</pre>Be sure to start from cylinder 2 (to have it aligned) as discussed also in some <a href="http://www.ocztechnologyforum.com/forum/showthread.php?s=297391dd581f02720373e94c4d80ed99&p=373226#post373226">forums</a>.<br />
<br />
Another good tip is to create the filesystem with the extended options for the RAID strip of 64k. Here is the command for it (assuming that you have the sda1 as the partiotion):<br />
<pre class="brush: bash">mkfs.ext4 -E stripe-width=128 /dev/sda1</pre><br />
Since the SSD is fast enough, you can also tweak the /etc/fstab for better through output and make the logs go to memory (volatile):<br />
<pre class="brush: bash">/dev/sda1 / ext4 noload,noatime,nodiratime,data=writeback,nobh,commit=100,barrier=0 0 1
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
none /var/tmp aufs noatime,br:/tmp=rw:/var/tmp=ro 0 0
none /var/log aufs noatime,br:/tmp=rw:/var/log=ro 0 0
none /var/cache aufs noatime,br:/tmp=rw:/var/cache=ro 0 0
</pre>Though, make sure that every now and then, you rebuild the cache...<br />
<br />
Other optimizations for boot time can be committed via /etc/default/grub (to run update-grub after) to speed up also the kernel loading, with some nice tweaks:<br />
<pre class="brush: bash">GRUB_CMDLINE_LINUX_DEFAULT="quiet splash=silent resume=/dev/sda2 fastboot elevator=deadline raid=noautodetect rootflags=noload,data=writeback,nobh,commit=100,barrier=0"</pre>You will need to update the grub via update-grub command...<br />
<br />
Add swappiness to fix some default behavior, and switch back now from noop to deadline that is more cpu/write friendly-with fifo_batch option for io scheduller:<br />
<pre class="brush: bash">cat << EOF| sudo tee -a /etc/sysctl.conf
# Peter added swapiness...
vm.swappiness = 0
vm.laptop_mode = 5
vm.dirty_writeback_centisecs = 1500
vm.vfs_cache_pressure = 50
EOF
</pre><br />
And last, we need some optimizations after booting:<br />
<pre class="brush: bash">cat << EOF| sudo tee /etc/init/ssd-optimizations.conf
# ssd-optimizations - Set the parameters
description "Set required ssd parameters"
start on starting dm
script
# echo deadline > /sys/block/sda/queue/scheduler
echo 1 > /sys/block/sda/queue/iosched/fifo_batch
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
end script
EOF
</pre><br />
Well, believe it or not, but with these settings, I got X starting at sec. 2, so, it is pretty fast (no initrd!)... <br />
<br />
Some good links:<br />
<ol><li><a href="http://www.ocztechnologyforum.com/forum/showthread.php?t=63499">OCZ Firmware update</a></li>
<li><a href="http://thunk.org/tytso/blog/2009/02/20/aligning-filesystems-to-an-ssds-erase-block-size/">Ted Tso guide to partitioning...</a></li>
<li><a href="http://www.ocztechnologyforum.com/forum/showthread.php?t=54379&page=17">http://www.ocztechnologyforum.com/forum/showthread.php?t=54379&page=17</a></li>
<li><a href="http://www.ocztechnologyforum.com/forum/showpost.php?p=373226&postcount=98">http://www.ocztechnologyforum.com/forum/showpost.php?p=373226&postcount=98</a></li>
<li><a href="http://ata.wiki.kernel.org/index.php/ATA_Secure_Erase">http://ata.wiki.kernel.org/index.php/ATA_Secure_Erase</a></li>
</ol>Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-68347376776153364402009-11-26T14:34:00.000+02:002009-11-26T14:34:00.430+02:00My Linux life is completed by the N900 mobile phone...Well, the <a href="http://nokia.com/N900">N900</a> is not quite a mobile phone. Saying that is an understatement. It is more like a mini laptop with a phone added as feature. Anyway, as of last weekend, I am using the <a href="http://maemo.org/">Maemo</a> Linux based Internet Tablet... Costs around 600€ but is worthy for those working and demanding a mobile development platform. Highly recommended...and here are the reasons:<br />
<ul><li>WiFi</li>
<li>3G</li>
<li>SIP</li>
<li>Full browser (Fennec)</li>
<li>GTK/Open source/Debian</li>
</ul>Well, you do the math... meanwhile, I enjoy it...Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-55575551785123420762009-09-24T20:00:00.001+03:002009-09-24T20:00:01.359+03:00Found my router, and bought it in Europe...Remember my old post about SOHO router with low power and available in European shops (<a href="http://blog.antoniac.name/2009/05/low-power-soho-integration-where-is-my.html">2009/05/where-is-my-router)</a>? Guess what, I found one. It is not from Billion and it does not have that much as 4 GigaEthernet ports, but still it is full of features, and based on some reviews, it is even more stable (although I will soon give feedback if that is not true). So, to remind you, my requirements where:<br />
<ol><li>ADSL2+</li>
<li>Firewall with VPN<br />
</li>
<li>VoIP (SIP)</li>
<li>WLan (802.11N draft a bonus)</li>
<li>Giga Ethernet</li>
<li>3G/UMTS/EDGE backup a (another bonus)</li>
</ol>This new pick it has even more:<br />
<ol><li>Torrent client for the USB disk that you can attach</li>
<li>SSH/Telnet</li>
<li>Multiple SIP accounts</li>
<li>Second WAN port (meaning 3 possible routings, with ballance)</li>
<li>VPN with 32 (Billions has only 16)</li>
<li>Printer support (not seen in Billions version)<br />
</li>
</ol>Interesting, is it not? Even better than the previous hit! And, another extra bonus: you can buy it Europe? Me so happy. Not to mention that it has a quite decent price, somehow lower than what was estimated for Billions. I found it from British <a href="http://www.broadbandbuyer.co.uk/">BroadbandBuyer</a> and it is a <a href="https://www.broadbandbuyer.co.uk/Shop/ShopDetail.asp?ProductID=5269">DrayTek Vigor 2820Vn</a>. It took 7 days to get it and the shipping was quite inexpensive. So, I am a happy low power router with lots of features owner now...Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-73617251832113733042009-08-04T10:05:00.004+03:002009-08-04T10:46:47.477+03:00Back to work: need a new laptop...but in Europe...(update)There you go: I am back at work and thinking and reviewing the laptops available. Best found so far was the: <a href="http://kakaku.com/item/K0000044556/">Panasonic CF-R8</a>. Brilliant design, light, SSD, 802.11n, gigaEthernet, and light, I mean 910 grams. Beat that... Only problem is to order it in Europe. What is it with Europe that we cannot get cool things here?<br />Update 1: Found even the link from <a href="http://club.panasonic.jp/mall/mylets/open/hikaku/r.html">Panasonic webpages</a> thanks to a friend from Japan.Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-2416703952548690372009-07-04T23:30:00.002+03:002009-07-04T23:34:00.957+03:00Holiday spree: killing spam and phishing...Yes, summer holidays are coming, and I've been quite busy before this week. Cleaning up my "virtual desk". Meanwhile, I also managed to find some minutes and test some new tools for fighting spam as well as fixing some old postfix issue (the domain alias vs. user alias issues).<br /><br />Well, as I said, holidays are coming, now they are here. So, I will stop and continue when I get back from Bella Italia!!! I will share some of the mysql configs for the postfix to allow better domain aliasing.<br /><br />Enjoy the summer...while it last...Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-77743731470096186862009-06-02T21:36:00.004+03:002009-06-02T22:12:26.989+03:00Linux games: where are they?Hmm...today, just after I was giving a speech about how linux is lacking the game industry attention, I stumble on this: <a href="http://savage2.com/en/download.php">Savage 2</a>. Conclussion: there are actually games that are build for linux, and quite good games. It is just me that does not know where to look (possible excuse is that I am more into PlayStation 3/Wii games than PC games). Well, yet another reason to stick to the Linux world...Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-52154884033055792892009-05-25T10:03:00.004+03:002009-05-25T10:08:41.183+03:00Low power, SOHO, integration: where is my router in Europe...I've been searching for a long time to find a router that is for the year 2009. My requirements are simple:<br /><ol><li>ADSL2+</li><li>Firewall with VPN<br /></li><li>VoIP (SIP)</li><li>WLan (802.11N draft a bonus)</li><li>Giga Ethernet</li><li>3G/UMTS/EDGE backup a (another bonus)</li></ol>Well, believe it or not, there is such a product. It does not come from Linksys (as I am a big fun) nor from D-Link, Marvel, etc. I could not find it anywhere but <a href="http://billion.com/product/voip/BiPAC-7404VNOX-3G-VoIP-11n-ADSL2-VPN-Firewall-Router-PSTN.html">here</a>. Yep, Billion has it. They got it right. They have all the features and in one device. What is my problem then? Well, digg that: I cannot find a place to buy it in Europe.Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com2tag:blogger.com,1999:blog-3237432459343235122.post-53293718936941703002009-05-18T15:34:00.004+03:002009-05-20T11:13:35.540+03:00<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_BBX5zVmZvZs/ShFWINEaIaI/AAAAAAAAAFA/x254gfc1iuo/s1600-h/7660.png"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 88px; height: 31px;" src="http://2.bp.blogspot.com/_BBX5zVmZvZs/ShFWINEaIaI/AAAAAAAAAFA/x254gfc1iuo/s320/7660.png" alt="" id="BLOGGER_PHOTO_ID_5337141732357841314" border="0" /></a><br />Today I became <a href="http://www.fsf.org/register_form?referrer=7660">associate member</a> for the FSF...Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.comtag:blogger.com,1999:blog-3237432459343235122.post-13675006791118655772009-05-06T14:26:00.008+03:002009-05-06T17:15:52.373+03:00SourceForge.net: Migrating from SVN to GIT...Ok, so after posting last week about how to move from CVS to GIT in sourceforge.net, I got this task of moving the <a href="http://sourceforge.net/projects/libdc1394">libdc1394</a> svn project to GIT and here are some of the things that I did to get the job done.<br /><ol><li>I went to find out where the repository is for the project (i.e. <a href="http://sourceforge.net/scm/?type=svn&group_id=8157">http://sourceforge.net/scm/?type=svn&group_id=8157</a>.<br /></li><li>Then, since I already had the svn2git, I just did:<blockquote>/var/lib/gems/1.8/bin/svn2git https://PROJECTNAME.svn.sourceforge.net/svnroot/PROJECTNAME</blockquote></li><li>And then push the master:<br /><blockquote>git remote add origin ssh://USERNAME@PROJECTNAME.git.sourceforge.net/gitroot/PROJECTNAME<br />git config branch.master.remote origin<br />git config branch.master.merge refs/heads/master<br />git push origin master # etc...<br />git push --tags # not to forget the tags...</blockquote></li><li>That's all folks... You can see the results for <a href="http://libdc1394.git.sourceforge.net/git/gitweb.cgi?p=libdc1394">git:libdc1394</a>...<br /></li></ol>Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-75964273076354768142009-04-20T18:56:00.001+03:002009-04-28T23:24:05.775+03:00SourceForge.net: Migrating from CVS to GIT...<span style="font-family:arial;">As I have been planning for a long time to do this move, I will post here my experiences with one of my projects at sourceforge.net to migrate it from CVS to GIT... Here are the steps, and believe me, those seem to be the safe one (the logical ones didn't work as well as those):<br /></span><ol style="font-family: arial;"><li>Backup your project:</li><blockquote>rsync -av rsync://jlibdc1394.cvs.sourceforge.net/cvsroot/jlibdc1394/* .</blockquote><li>Transfer one module to a svn repo:<blockquote>cvs2svn -s MODULE ../PLACE_YOU_DID_RSYNC/MODULE<br /></blockquote></li><li>Install the svn2git:<blockquote><pre class="syntax-highlight:sh">git clone git://github.com/jcoglan/svn2git.git<br />rake gem<br />sudo gem install pkg/svn2git-1.0.0.gem<br /># On ubuntu you run it with /var/lib/gems/1.8/bin/svn2git file:///...<br /></pre></blockquote></li><li>For each module, you will create an empty directory and inside that directory run:<blockquote><pre class="syntax-highlight:sh"> /var/lib/gems/1.8/bin/svn2git file:///PATH_TO_MODULE</pre></blockquote></li><li>Well, this gives you a bunch of modules, with their branches, if you had them. So, from here, your hell begins... Myself, I had 3 modules, that I checkout in branches. I did it in empty branches for each module:<blockquote><pre class="syntax-highlight:sh">git symbolic-ref HEAD refs/heads/MODULE_NAME<br />#removed everything from the old branch switch...<br />rm .git/index<br />git clean -fdx<br />git pull PATH_TO_GIT_SVN_MODULE<br />git push --all</pre></blockquote></li><li>You can also move some remote branches, or move:<blockquote><pre class="syntax-highlight:sh">git push origin origin/OLD:refs/heads/NEW<br /># delete the old branch<br />git push origin :OLD</pre></blockquote></li><li><span style="font-family:arial;">This should give you enough flexibility and people can still use those branches. Idealy, you should have super-project and sub-projects. But git is not that great on that yet... and the tools are also failing on this topic.</span></li><li><span style="font-family:arial;">You can see the results from here: <a href="http://jlibdc1394.git.sourceforge.net/git/gitweb.cgi?p=jlibdc1394">http://jlibdc1394.git.sourceforge.net/git/gitweb.cgi?p=jlibdc1394</a><br /></span></li></ol>Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com0tag:blogger.com,1999:blog-3237432459343235122.post-64209231659974017462009-04-15T19:18:00.000+03:002009-04-15T19:27:23.144+03:00Launchpad: Now it is for real...it is going to be OSS<span style="font-family:arial;">Just read some email from launchpad users ML, and there was a real nice pointer to this website: </span><a style="font-family: arial;" href="https://dev.launchpad.net/OpenSourcing">https://dev.launchpad.net/OpenSourcing</a><span style="font-family:arial;">. So, it is for real! Launchpad is going </span><span style="font-style: italic;font-family:arial;" >Open Source</span><span style="font-family:arial;"> as of July! That is going to help the development on such platform...</span>Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.comtag:blogger.com,1999:blog-3237432459343235122.post-65975122545928161492009-04-14T10:00:00.000+03:002009-04-14T14:53:36.176+03:00SourceForge.net: a git experience...<span style="font-family: arial;">Ok, first, this is my initial entry to blogging... I hated the idea, I still do, but I need to save and share some of the things that I do in a faster way. I wish that sourceforge will have better interface...</span><br /><br /><span style="font-family: arial;">Anyway, here are some of the steps that I did to use the git with sourceforge.</span><br /><br /><ol style="font-family: arial;"><li>You need the git-svn installed</li><li>git-svn clone:<blockquote>git-svn clone https://libdc1394.svn.sourceforge.net/svnroot/libdc1394/trunk/libdc1394/</blockquote></li><li>Do your work, like you do in git, git add, git commit...</li><li>And, at the end: <blockquote>git-svn dcommit --username SF_USER</blockquote><br /></li></ol>Anonymoushttp://www.blogger.com/profile/15242526210548964751noreply@blogger.com