<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>From Zero To One &#187; OS</title>
	<atom:link href="http://www.cromis.net/blog/category/os/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cromis.net/blog</link>
	<description>A blog about Delphi programming and all things technical</description>
	<lastBuildDate>Mon, 25 Jul 2011 19:27:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Yahoo messenger and Windows VirtualStore</title>
		<link>http://www.cromis.net/blog/2010/02/yahoo-messenger-and-windows-virtualstore/</link>
		<comments>http://www.cromis.net/blog/2010/02/yahoo-messenger-and-windows-virtualstore/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 18:08:22 +0000</pubDate>
		<dc:creator>Iztok Kacin</dc:creator>
				<category><![CDATA[OS]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Symbolic Link]]></category>
		<category><![CDATA[VirtualStore]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Yahoo Messenger]]></category>

		<guid isPermaLink="false">http://www.cromis.net/blog/?p=631</guid>
		<description><![CDATA[Today I had an interesting challenge in front of me. As I already wrote about in a couple of posts I have a NAS set up for backing up my personal data, as well as my important VMWare machines. I switched my Windows backup client to Cobian last week, because GFI has serious issues with [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Today I had an interesting challenge in front of me. As I already wrote about in a couple of posts I have a NAS set up for backing up my personal data, as well as my important VMWare machines. I switched my Windows backup client to <a title="Cobian Backup" href="http://www.educ.umu.se/~cobian/cobianbackup.htm">Cobian</a> last week, because GFI has serious issues with task scheduling. Now I am trying Cobian to see how it will do. So I added the folders, than need to be backup-ed, to the backup plan in Cobian. One of the folders is a <a title="Yahoo Messenger" href="http://messenger.yahoo.com/">Yahoo messenger</a> archive folder for my profile. I use YM for day to day work, because I work from home and it is my link with my coworkers through the day. I store every conversation to the archive, so I have a complete history in case I need some info about app design or anything else, that was decided a while ago and it is not in the mail.</p>
<p style="text-align: justify;">Ok so what did I find out? YM tries to store the profile and archives into the <span style="color: #0000ff;">&#8220;Program Files (x86)\Yahoo!\Messenger\profiles&#8221;</span> folder (I have 64 bit Windows 7). <span style="color: #000000;">Well </span>Windows VirtualStore kicks in at that moment, redirecting all the data to the <span style="color: #0000ff;">&#8220;Users\UserName\AppData\Local\VirtualStore\Program Files (x86)\Yahoo!\Messenger\Profile&#8221;</span>. I know why MS implemented VirtualStore. User apps have no business writing data to the &#8220;Program Files&#8221;. But guess what, they do. And a lot of them, even popular apps like YM. And because MS wanted better security and on the same side wanted old apps to continue running, they made the decision about VirtualStore. But I don&#8217;t think it was a smart one. Redirecting data to some obscure path, deep into the user profile is not a good idea. Redirecting to a path that has hidden folders in it is even worse idea. People then don&#8217;t know what happened with their data and that can lead to data loss or some irrational decision made in panic that also lead to data loss.</p>
<p style="text-align: justify;">Lets take my case for example. Under Windows XP, my archive was written to &#8220;Program Files&#8221;. After installing Windows 7, I restored to the previous state ,installing YM again. I could see my archived data when I checked if it was there in YM. But from then on all the data was written to the VirtualStore, without me being aware of it. When I restored my backup plan I was missing all the new data recorded after the transition to Windows 7. And I am a developer, so I quickly found that out, when restoring the backup plan. But what about the common user, that has no way of knowing that and resolving such issues. I think a better approach would be:</p>
<ol>
<li>Let the application crash if it tries to write to &#8220;Program Files&#8221;</li>
<li>Explicitly tell the application to work in &#8220;Windows XP&#8221; compatibility</li>
<li>VirtualStore is disabled when applications are run in compatibility mode</li>
</ol>
<p style="text-align: justify;">Yes, it would be harder for the user in the beginning, but they would quickly learn how to handle legacy apps and application developers would have to fix their applications. And because the message would be clear: &#8220;Your app is not working correctly&#8221;, a user would be aware of the error instead of having the illusion that all is well.</p>
<p>So how did I solve the problem. I made a <a href="http://en.wikipedia.org/wiki/NTFS_junction_point">NTFS Junction Point</a>. The procedure is simple:</p>
<ol>
<li>I moved the complete archive from &#8220;Program Files&#8221; and VirtualStore to my actual profile folder: &#8220;<span style="color: #0000ff;">Users\UserName\AppData\Local\Yahoo\Profiles</span>&#8220;</li>
<li>I deleted the old archive locations and I also deleted the profile folder in YM &#8220;Program Files&#8221; directory</li>
<li>I opened CMD and typed: <span style="color: #0000ff;">mklink /D /J &#8220;C:\Program Files (x86)\Yahoo!\Messenger\profiles&#8221; &#8220;c:\Users\UserName\AppData\Local\Yahoo\Profiles&#8221;</span></li>
</ol>
<p style="text-align: justify;">That is it. Now YM thinks it is writing and reading data from &#8220;Program Files&#8221; but instead it is doing it from my user profile folder. I made YM do what it should in the first place and worked around VirtualStore. It is an interesting solution that could come handy in many other cases. And for those of you out there wondering: &#8220;Did he use the latest YM?&#8221; Yes I installed the latest YM before doing anything else. Version 10 still writes to the &#8220;Program Files&#8221; and I can&#8217;t understand why haven&#8217;t they fixed that.</p>
<p>I know many will disagree with my view on this topic, but as I see it, this is how things stand right now <img src='http://www.cromis.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.cromis.net/blog/2010/02/yahoo-messenger-and-windows-virtualstore/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>What do you do when your VMware server dies?</title>
		<link>http://www.cromis.net/blog/2010/01/what-do-you-do-when-your-vmware-server-dies/</link>
		<comments>http://www.cromis.net/blog/2010/01/what-do-you-do-when-your-vmware-server-dies/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 11:26:40 +0000</pubDate>
		<dc:creator>Iztok Kacin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Crash]]></category>
		<category><![CDATA[Failure]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Virtual disk failure]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://www.cromis.net/blog/?p=539</guid>
		<description><![CDATA[You start panicking of course Ok seriously now. You try to fix the problem first. If that doesn&#8217;t work then you bring the server back from the backups you are so regularly making. You are aren&#8217;t you? And you always make sure that your backup plan is actually working. Don&#8217;t you? About a week ago [...]]]></description>
			<content:encoded><![CDATA[<p>You start panicking of course <img src='http://www.cromis.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: center;"><img class=" aligncenter" title="Panic" src="http://charlesgoyette.com/uploaded_images/panic-705224.png" alt="Panic Button" width="332" height="400" /></p>
<p align="justify">Ok seriously now. You try to fix the problem first. If that doesn&#8217;t work then you bring the server back from the backups you are so regularly making. You are aren&#8217;t you? And you always make sure that your backup plan is actually working. Don&#8217;t you?</p>
<p align="justify">About a week ago my virtual Debian server on which this blog is hosted stopped running. The VMware console reported a virtual disk error. I had to shutdown the machine and when I tried to boot it up again it wouldn&#8217;t start. There was an error on one of the virtual disks.  Hm so what to do? I had a fresh, few days old backup, so I went for that. But first, let me tell you how my virtual machines are set up. I have a Debian host OS (stable Lenny currently) and on top of that I have v VMware server 2.0.1. Then inside I have a virtual Debian server where this blog is hosted alongside my whole code repository. I have a couple of other virtual machines for development and testing (Windows and Linux). All important virtual machines are backup-ed regularly to the NAS machine. I have written about that a while ago <a title="Backup VM machine" href="http://www.cromis.net/blog/2009/09/backup-your-linux-debian-virtual-machines-vmware/">here </a>and <a title="FreeNAS" href="http://www.cromis.net/blog/2009/07/do-you-need-a-free-nas-network-attached-storage/">here</a>.</p>
<p align="justify">Ok so I took my last backup which is a tar that is further compressed with 7-zip for reducing size. At first I only had a tar archive. I tested that and it worked just fine. Then at some point I used 7-zip over the tar and because I lacked time I did not test the archives. No errors were reported so I assumed all is well. What a mistake. All 7-zip archives were partially corrupted. But thanks to Sheree dumb luck I could get the VMDK file that was corrupted from the archive. I replaced that file on the virtual machine (the size was the same) and the server booted again. Hooray! Well not quite. Everything was working but SVN was reporting errors. It could not open the database. After investigating the Apache logs (I use DAV SVN and https) it seemed that &#8220;db/current&#8221;  file was corrupted. This file holds the info about the last (current) revision in the SVN. I tried &#8220;svnadmin recover&#8221; to no avail. I tried removing the file and repeating the recover which then failed elsewhere.</p>
<p align="justify">After searching the web and finding nothing I almost gave up. But the I found a little gem on one of the forums. A little Python script that solved my problems. I am posting it here if anybody else will have the same misfortune. If the author finds this offensive I will remove the script.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> dec_to_36<span style="color: black;">&#40;</span>dec<span style="color: black;">&#41;</span>:
  key = <span style="color: #483d8b;">'0123456789abcdefghijklmnopqrstuvwxyz'</span>
  result = <span style="color: #483d8b;">''</span>
  <span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #ff4500;">1</span>:
    div = dec / <span style="color: #ff4500;">36</span>
    mod = dec <span style="color: #66cc66;">%</span> <span style="color: #ff4500;">36</span>
    dec = div
    result = key<span style="color: black;">&#91;</span>mod<span style="color: black;">&#93;</span> + result
    <span style="color: #ff7700;font-weight:bold;">if</span> dec == <span style="color: #ff4500;">0</span>:
      <span style="color: #ff7700;font-weight:bold;">break</span>
  <span style="color: #ff7700;font-weight:bold;">return</span> result
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>, <span style="color: #dc143c;">re</span>, <span style="color: #dc143c;">sys</span>
&nbsp;
repo_path = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
rev_path = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>repo_path, <span style="color: #483d8b;">'db'</span>, <span style="color: #483d8b;">'revs'</span><span style="color: black;">&#41;</span>
current_path = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>repo_path, <span style="color: #483d8b;">'db'</span>, <span style="color: #483d8b;">'current'</span><span style="color: black;">&#41;</span>
&nbsp;
id_re = <span style="color: #dc143c;">re</span>.<span style="color: #008000;">compile</span><span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^id:<span style="color: #000099; font-weight: bold;">\ </span>([a-z0-9]+)<span style="color: #000099; font-weight: bold;">\.</span>([a-z0-9]+)<span style="color: #000099; font-weight: bold;">\.</span>r([0-9]+).*'</span><span style="color: black;">&#41;</span>
&nbsp;
max_node_id = <span style="color: #ff4500;">0</span>
max_copy_id = <span style="color: #ff4500;">0</span>
max_rev_id = <span style="color: #ff4500;">0</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> rev <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">listdir</span><span style="color: black;">&#40;</span>rev_path<span style="color: black;">&#41;</span>:
  f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>rev_path, rev<span style="color: black;">&#41;</span>, <span style="color: #483d8b;">'r'</span><span style="color: black;">&#41;</span>
&nbsp;
  <span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> f:
    m = id_re.<span style="color: black;">match</span><span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> m:
      node_id = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>m.<span style="color: black;">group</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>, <span style="color: #ff4500;">36</span><span style="color: black;">&#41;</span>
      copy_id = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>m.<span style="color: black;">group</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>, <span style="color: #ff4500;">36</span><span style="color: black;">&#41;</span>
      rev_id = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>m.<span style="color: black;">group</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">3</span><span style="color: black;">&#41;</span>, <span style="color: #ff4500;">10</span><span style="color: black;">&#41;</span>
&nbsp;
      <span style="color: #ff7700;font-weight:bold;">if</span> copy_id <span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;</span> max_copy_id:
        max_copy_id = copy_id
&nbsp;
      <span style="color: #ff7700;font-weight:bold;">if</span> node_id <span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;</span> max_node_id:
        max_node_id = node_id
&nbsp;
      <span style="color: #ff7700;font-weight:bold;">if</span> rev_id <span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;</span> max_rev_id:
        max_rev_id = rev_id
&nbsp;
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>current_path, <span style="color: #483d8b;">'w+b'</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%d %s %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>max_rev_id, dec_to_36<span style="color: black;">&#40;</span>max_node_id+<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>,
                        dec_to_36<span style="color: black;">&#40;</span>max_copy_id+<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p align="justify">This script is a little gem. It goes through all your revisions and reconstructs the &#8220;db/current&#8221; file. It worked. I lost last 4 or 5 revisions, but that was easily solved as I had them on my computer naturally. So all was well, I made backup of the current state and I was happy. Well that was another false sense of security.</p>
<p align="justify">Last night the blog went down again. This time it could not access the database. It showed that the file system inside the virtual machine was corrupted. I ran &#8220;fsck&#8221; but frankly I was prepared for the worst. To my surprise all errors were corrected and the server is once again running happily. I am suspecting that the physical hard drive of the host is slowly dying so I will migrate to a new drive in the future. But for now I am truly impressed about how sturdy Debian is. The host and the virtual server both run for about 3 years now without a reinstall. Both were migrated from Etch to Lenny (two stable releases) in live mode (no shutdown) and have survived hardware change (CPU, motherboard and RAM) and file system corruptions. Now do that to your Windows if you dare <img src='http://www.cromis.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.cromis.net/blog/2010/01/what-do-you-do-when-your-vmware-server-dies/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Windows 7 first impressions</title>
		<link>http://www.cromis.net/blog/2009/11/windows-7-first-impressions/</link>
		<comments>http://www.cromis.net/blog/2009/11/windows-7-first-impressions/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 09:25:59 +0000</pubDate>
		<dc:creator>Iztok Kacin</dc:creator>
				<category><![CDATA[OS]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Boot]]></category>
		<category><![CDATA[Fast]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[XP]]></category>

		<guid isPermaLink="false">http://www.cromis.net/blog/?p=411</guid>
		<description><![CDATA[A week ago my old XP died on me for the last time. And it was the longest installation period i had with XP. Almost two years of heavy duty work and countless installations. Before they never lasted more than a year of torture. Now after almost two years I got a BSOD. Instead of [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">A week ago my old XP died on me for the last time. And it was the longest installation period i had with XP. Almost two years of heavy duty work and countless installations. Before they never lasted more than a year of torture. Now after almost two years I got a BSOD. Instead of trying to resurrect a dead working horse I decided to install the new Windows 7. Something I was planning for some time.</p>
<p align="justify">As a developer you have to be on constant guard as they bombard us with new technology and you have to move on, or you will be left behind. I did not trust Vista, as it was bloated and not as polished as I would like, so for my main development I stayed with the trusty XP. But it is hard to constantly test your work in virtual machines, so now it was time I jumped on the Windows 7 train. And I heard good things about this OS. So I installed Windows 7  in 64 bit flavour. The installation went smoothly, almost on autopilot. When this was done I started installing drivers and applications&#8230; and I was pleasantly surprised.</p>
<p align="justify">As I expected almost all drivers were found automatically, only the integrated sound card was not recognized (Asus M2N-e SLI AM2 motherboard). What surprised me, after installing my development tools (BDS 2006, RAD 2010) and all the supporting SW, is how responsive the system stayed. There is almost no noticeable slowdown (boot and common usage) when there is a lot of software and drivers installed. It seemed they made quite a few changes from XP on that front. And when I listened to the Mark Russinovich he confirmed that.</p>
<p><a title="Mark Russinovich on Windows 7" href="http://blogs.technet.com/markrussinovich/archive/2009/10/22/3288577.aspx">http://blogs.technet.com/markrussinovich/archive/2009/10/22/3288577.aspx</a></p>
<p align="justify">They implemented a boot optimizer that learns over multiple boots. Nice. There is a lot of other improvements that Mark talks about. I recommend that you watch the video as Mark is always a wealth of knowledge.</p>
<p align="justify">All in all, the new Windows 7 are running smoothly for now and I have a good feeling about the OS. Yes there are still problems but the OS is fresh and the drivers are not yet updated.  I had a lot of troubles to get the audio working. Asus provides no drivers for Windows 7 and the Vista drivers are not working (XP too, but that is expected). So I used my trusty old &#8220;Sound Blister Live&#8221;. That old sound card is still impressive after 7 or  8 years. It was not easy to get is working under Windows 7, but thanks to &#8220;Kx Project&#8221; I managed to bring some life to the old card:</p>
<p><a title="Kx Project" href="http://kxproject.lugosoft.com/">http://kxproject.lugosoft.com/</a></p>
<p align="justify">Now it works perfectly. And hats down to the makers of that drivers. I haven&#8217;t seen so many options and fine tunings in a driver for quite some time (if ever). Oh and if you are using the Tortoise SVN under 64 bit OS, just install both the 64 and 32 bit version, so you will have support for both types of applications.</p>
<p align="justify"><strong>Edit</strong>:</p>
<p align="justify">I saw a lot of search for BDS 2006 and Delphi 7 installation under Windows 7. Dr. Bob has a great article on that. It is for Vista, but it also applies for Windows 7. The only problem is that BDAS 2006 .NET debugger refuses to work under Windows 7. The link is:</p>
<p align="justify"><a title="Delphi and Windows 7" href="http://www.drbob42.com/examines/examin84.htm">http://www.drbob42.com/examines/examin84.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cromis.net/blog/2009/11/windows-7-first-impressions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Upgrading your stable Debian</title>
		<link>http://www.cromis.net/blog/2009/09/upgrading-your-stable-debian/</link>
		<comments>http://www.cromis.net/blog/2009/09/upgrading-your-stable-debian/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 19:30:29 +0000</pubDate>
		<dc:creator>Iztok Kacin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[apt-pining]]></category>
		<category><![CDATA[bigmem]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[sources]]></category>
		<category><![CDATA[stable]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.cromis.net/blog/?p=330</guid>
		<description><![CDATA[Do you know how to upgrade you stable Debian release? I am not talking about upgrading packages, but upgrading your Debian to a new stable release when that comes around. Typical Debian installation has &#8220;sources.list&#8221; like that deb http://ftp.si.debian.org/debian/ lenny main deb-src http://ftp.si.debian.org/debian/ lenny main &#160; deb http://security.debian.org/ lenny/updates main contrib deb-src http://security.debian.org/ lenny/updates main [...]]]></description>
			<content:encoded><![CDATA[<p>Do you know how to upgrade you stable Debian release? I am not talking about upgrading packages, but upgrading your Debian to a new stable release when that comes around. Typical Debian installation has &#8220;sources.list&#8221; like that</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">deb http:<span style="color: #000000; font-weight: bold;">//</span>ftp.si.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> lenny main
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>ftp.si.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> lenny main
&nbsp;
deb http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org<span style="color: #000000; font-weight: bold;">/</span> lenny<span style="color: #000000; font-weight: bold;">/</span>updates main contrib
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org<span style="color: #000000; font-weight: bold;">/</span> lenny<span style="color: #000000; font-weight: bold;">/</span>updates main contrib</pre></div></div>

<p>It has a distrubution name (lenny for instance) in it. This insures that we cannot accidentally update it with some other version packages. But if that is not a concern and if you want go to a new stable version as it comes out just change it like this</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">deb http:<span style="color: #000000; font-weight: bold;">//</span>ftp.si.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> stable main
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>ftp.si.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> stable main
&nbsp;
deb http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org<span style="color: #000000; font-weight: bold;">/</span> stable<span style="color: #000000; font-weight: bold;">/</span>updates main contrib
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org<span style="color: #000000; font-weight: bold;">/</span> stable<span style="color: #000000; font-weight: bold;">/</span>updates main contrib</pre></div></div>

<p>This tells the apt installer to use the stable packages (the latest) instead of specific version of stable packages. This means that when the stable release changes, the installer will automatically use the new packages.</p>
<p>There is another useful technique involved called apt-pinning. Do you get annoyed sometimes because the stable release becomes outdated so fast and some packages are not available in it? Well, apt pinning changes that. It enables you to also install packages from testing and release, but favors packages in the stable release if available. Your &#8220;sources.list&#8221; should look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#Stable</span>
deb http:<span style="color: #000000; font-weight: bold;">//</span>ftp.si.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> stable main
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>ftp.si.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> stable main
&nbsp;
deb http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org<span style="color: #000000; font-weight: bold;">/</span> stable<span style="color: #000000; font-weight: bold;">/</span>updates main contrib
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org<span style="color: #000000; font-weight: bold;">/</span> stable<span style="color: #000000; font-weight: bold;">/</span>updates main contrib
&nbsp;
<span style="color: #666666; font-style: italic;">#Testing</span>
deb http:<span style="color: #000000; font-weight: bold;">//</span>ftp.si.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> testing main
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>ftp.si.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> testing main
&nbsp;
<span style="color: #666666; font-style: italic;">#Unstable</span>
deb http:<span style="color: #000000; font-weight: bold;">//</span>ftp.si.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> unstable main
deb-src http:<span style="color: #000000; font-weight: bold;">//</span>ftp.si.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> unstable main
&nbsp;
deb http:<span style="color: #000000; font-weight: bold;">//</span>debian.supermind.nl<span style="color: #000000; font-weight: bold;">/</span> current main
deb http:<span style="color: #000000; font-weight: bold;">//</span>debian.supermind.nl<span style="color: #000000; font-weight: bold;">/</span> nightly main</pre></div></div>

<p>As you can see this enable apt installer to read the packages from all three branches (stable, testing, unstable). You will also need a &#8220;preferences&#8221; file in apt directory, which tells apt which packages have the priority. It should look something like this</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Package: <span style="color: #000000; font-weight: bold;">*</span>
Pin: release <span style="color: #007800;">a</span>=stable
Pin-Priority: <span style="color: #000000;">700</span>
&nbsp;
Package: <span style="color: #000000; font-weight: bold;">*</span>
Pin: release <span style="color: #007800;">a</span>=testing
Pin-Priority: <span style="color: #000000;">650</span>
&nbsp;
Package: <span style="color: #000000; font-weight: bold;">*</span>
Pin: release <span style="color: #007800;">a</span>=unstable
Pin-Priority: <span style="color: #000000;">600</span></pre></div></div>

<p>This is all you need. To get more information on the subject read this great article on apt-pinning:</p>
<p><a href="http://jaqque.sbih.org/kplug/apt-pinning.html">http://jaqque.sbih.org/kplug/apt-pinning.html</a></p>
<p>To upgrade just enter the following two commands in sequence.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> dist-upgrade</pre></div></div>

<p>You need to do &#8220;dist-upgrade&#8221; instead of just &#8220;upgrade&#8221; as this insures that also the new required packages are installed. This is all there is to it. For the end let me just show what to do if you need a kernel that can use more than 4GB of memory. The following commands check if bigmem is already installed and install it if not. The example is for 2.6 version of the kernel</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">--get-selections</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> bigmem
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> linux-image-<span style="color: #000000;">2.6</span>-<span style="color: #000000;">686</span>-bigmem</pre></div></div>

<p>Again more on the subject can be found here:</p>
<p><a href="http://knowledgelayer.softlayer.com/questions/294/Debian+isn%27t+showing+all+my+ram!">http://knowledgelayer.softlayer.com/questions/294/Debian+isn%27t+showing+all+my+ram!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cromis.net/blog/2009/09/upgrading-your-stable-debian/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Backup your linux (Debian) virtual machines (VMWare)</title>
		<link>http://www.cromis.net/blog/2009/09/backup-your-linux-debian-virtual-machines-vmware/</link>
		<comments>http://www.cromis.net/blog/2009/09/backup-your-linux-debian-virtual-machines-vmware/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 10:26:11 +0000</pubDate>
		<dc:creator>Iztok Kacin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[NAS]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[TAR]]></category>
		<category><![CDATA[Virtual]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://www.cromis.net/blog/?p=317</guid>
		<description><![CDATA[In the last post I wrote about a free NAS solution for you home (or office) backup strategy. I wrote about the ease of setting it up and how I searched for a free and simple way to backup my windows machines. I am stil using GFI Backup 2009. The only change is, that I [...]]]></description>
			<content:encoded><![CDATA[<p>In the last <a href="http://www.cromis.net/blog/2009/07/do-you-need-a-free-nas-network-attached-storage/">post</a> I wrote about a free NAS solution for you home (or office) backup strategy. I wrote about the ease of setting it up and how I searched for a free and simple way to backup my windows machines. I am stil using <a title="GFI Backup 2009" href="http://www.gfi.com/backup-hm">GFI Backup 2009</a>. The only change is, that I am storing my last 3 complete backups instead of incremental backups. The reason for that is, that I feel more secure this way. If the last backup is corrupted I still have two good backups and I do not have to worry how I will put the increments back together.</p>
<p>Now I would like to show, how I made the backups of my virtual machine. The host is Debian OS (Lenny) and on top of that I have a VMWare server 1.0.9 with several virtual machines running inside. The beauty of this is, that in order to backup the data, I just need to backup the whole virtual machine. No complicated plans and scripts to backup databases, SVN repositories etc. Just stop the virtual machine (you have to stop it first as it is the safest way and the data is not corrupted if you do this) and tar the whole directory to the NAS. In the beggining I had and idea of using rsync to do incremental backups, but I changed my mind. I just followed the windows phlosophy. Store the last three backups of every virtual machine and that is it. This is how I did it.</p>
<p>As I already have a Samba share configured on the NAS I just installed the Samba client</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> smbfs</pre></div></div>

<p>then i added the Samba client to modules</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'smbfs'</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>modules</pre></div></div>

<p>and to fstab, so it will be mounted on each boot</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">//</span>NASServer<span style="color: #000000; font-weight: bold;">/</span>backups  <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>backups  smbfs  defaults,user,<span style="color: #007800;">password</span>=  <span style="color: #000000;">0</span>  <span style="color: #000000;">0</span></pre></div></div>

<p>I did not need username and password because NAS in protected only by IP&#8217;s that can connect to it. Because I have it behind a router and  a firewall, inside LAN and I am the only one using it, there is no need for any other protection. Now all that is left, is the script to backup VM machines on a weekly basis. I tried using ZIP at first to compress them, but found out that it cannot handle files larger that 2GB, so I swithed to TAR. This is the script</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Backup the virtual machines of choic to a samba share</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #007800;">CurrentDate</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>y<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #000000; font-weight: bold;">`</span>
vmrun stop <span style="color: #ff0000;">&quot;/var/vm/Ubuntu 7.10 Server/Ubuntu.vmx&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-cvvf</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>backups<span style="color: #000000; font-weight: bold;">/</span>CROMIS<span style="color: #000000; font-weight: bold;">/</span>VM_Cromis_<span style="color: #007800;">$CurrentDate</span>.zip <span style="color: #ff0000;">&quot;/var/vm/Ubuntu 7.10 Server&quot;</span>
vmrun start <span style="color: #ff0000;">&quot;/var/vm/Ubuntu 7.10 Server/Ubuntu.vmx&quot;</span></pre></div></div>

<p>This is the sample of a single VM being archive. What is missing is the rotation of the last 3 backups, but that I still have to implement. No a big deal though. So in short this is it. Simple and efficient. But I would like to point out two problem I encountered on the way to this solution and are both related to the new Lenny Debian distribution.</p>
<p>The first problem is that they changed the default ehternet interface from eth0 to eth1. I don&#8217;t know who has this &#8220;brilliant&#8221; idea, but it took me a lot of time to figure out why I can&#8217;t connect to my server anymore. I will show the way to upgrade between stable releases in the next post, bust let me just say that changes like that are not very smart. And the other problem was that VMWare server was not working anymore with the new 2.6.24 kernel. I tried everything, but could not make it work. I managed to rebuild the VMWare core modules with the <a title="WMVare-any-any patches" href="http://communities.vmware.com/message/76957">WMVare-any-to-any-update patches</a>, but the VM machines wouldn&#8217;t start anymore. So I was forced to go back to 2.6.18 version of the kernel. There all is fine. Why don&#8217;t I upgrade to WMVare server 2.x you wonder. Because the removed the console and left us with java bloated web interface that uses Tomcat. I read a lot of negative reviews and I am not prepared to change my smooth working 1.0.9 version.</p>
<p>Edit: I now use 7zip on top of  the tar archives as this greatly reduces the size of the archived files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cromis.net/blog/2009/09/backup-your-linux-debian-virtual-machines-vmware/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
