<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Zugschlusbeobachtungen (Entries tagged as lvm)</title>
    <link>http://blog.zugschlus.de/</link>
    <description>Das persönliche Blog von Marc Haber</description>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:mh+blog-zugschlus-de@zugschlus.de" />
    <generator>Serendipity 1.5.5 - http://www.s9y.org/</generator>
    <pubDate>Thu, 06 Aug 2009 08:44:32 GMT</pubDate>

    <image>
        <url>http://blog.zugschlus.de/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Zugschlusbeobachtungen - Das persönliche Blog von Marc Haber</title>
        <link>http://blog.zugschlus.de/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Unified Kernel for etch, lenny and sid</title>
    <link>http://blog.zugschlus.de/archives/844-Unified-Kernel-for-etch,-lenny-and-sid.html</link>
            <category>Debian</category>
    
    <comments>http://blog.zugschlus.de/archives/844-Unified-Kernel-for-etch,-lenny-and-sid.html#comments</comments>
    <wfw:comment>http://blog.zugschlus.de/wfwcomment.php?cid=844</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://blog.zugschlus.de/rss.php?version=2.0&amp;type=comments&amp;cid=844</wfw:commentRss>
    

    <author>mh+blog-zugschlus-de@zugschlus.de (Marc 'Zugschlus' Haber)</author>
    <content:encoded>
    &lt;p&gt;
Traditionally, the Linux kernel is software that I compile myself from pristine upstream sources for various reasons. I
have three major kernel flavours that get built (server, desktop and notebook), and I am pretty current in running a
bleeding edge kernel. This is not really necessary any more nowadays, but it&amp;#8217;s a tradition that works pretty
well.
&lt;/p&gt;
&lt;p&gt;
My kernels get built on sid and are packaged up with kernel-package, and equivs builds a dependency helper package which
pulls in the kernel&amp;#8217;s dependencies such as initramfs-tools and takes care of cross-version updates like going from
2.6.29 to 2.6.30. Up to now, I was always able to run a kernel built this way on all my systems which can range from
oldstable to unstable.
&lt;/p&gt;
 &lt;p&gt;
This has recently become a bit harder when unstable&amp;#8217;s udev started to complain that the sysfs layout was
deprecated and that I should unset CONFIG_DEPRECATED_SYSFS in my kernel configuration or lose some of udev&amp;#8217;s
functionality, since a kernel compiled without CONFIG_DEPRECATED_SYSFS doesn&amp;#8217;t properly boot on etch.
&lt;/p&gt;
&lt;p&gt;
Since I wanted to avoid building even more kernel flavours, I decided to investigate which package I need to backport to
etch to get kernels without CONFIG_DEPRECATED_SYSFS to work on etch. To my surprise, the cause for not booting on etch
was not udev, but lvm2. With lvm2 2.02.39 (and the corresponding libdevmapper, 1.02.27-4) ported back from lenny to
etch, my etch systems boot fine with CONFIG_DEPRECATED_SYSFS unset. udev can happily stay at etch&amp;#8217;s version,
0.105-4etch1.
&lt;/p&gt;
&lt;p&gt;
From etch to lenny to squeeze, the lvm2 package has evolved quite a bit. Since there is only one LVM flavour left, the
lvm-common package vanished in the transition from etch to lenny, and libdevmapper still has its own source package in
lenny, but is built from lvm2&amp;#8217;s source package itself in squeeze. So, as a heads-up, there needs to be special
handling for lvm-common when installing the backport on etch.
&lt;/p&gt;
&lt;p&gt;
I decided to backport lvm2 from lenny to etch to allow this particular derivation from the distributions&amp;#8217;s
versions to vanish in reasonably short time when my last etch boxes get finally updated to lenny. And my dependency
helper has been extended to now pull in the backported version of lvm2 to avoid nasty reboot surprises.
&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Thu, 06 Aug 2009 10:44:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.zugschlus.de/archives/844-guid.html</guid>
    <category>debian</category>
<category>debian-english</category>
<category>kernel</category>
<category>lvm</category>
<category>udev</category>

</item>
<item>
    <title>partition table gone, data still present</title>
    <link>http://blog.zugschlus.de/archives/819-partition-table-gone,-data-still-present.html</link>
            <category>Admintipp des Tages</category>
    
    <comments>http://blog.zugschlus.de/archives/819-partition-table-gone,-data-still-present.html#comments</comments>
    <wfw:comment>http://blog.zugschlus.de/wfwcomment.php?cid=819</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://blog.zugschlus.de/rss.php?version=2.0&amp;type=comments&amp;cid=819</wfw:commentRss>
    

    <author>mh+blog-zugschlus-de@zugschlus.de (Marc 'Zugschlus' Haber)</author>
    <content:encoded>
    &lt;p&gt;
I just wanted to make an USB stick bootable and wondered why mkdiskimage -4 /dev/sda 0 32 64 complained about the disk
having too many cylinders. After a few moments, it ocurred to me that since libata, the system hard disk has become sda
and that the stick was sdb or sdc. One ctrl-C later, fdisk confirmed both counts: That I accidentally started
mkdiskimaging my main system hard disk and that the partition table was already gone.
&lt;/p&gt;
&lt;p&gt;
A few hours later, the notebook is back in business without too much data loss. Lucky me.
&lt;/p&gt;
 &lt;p&gt;
My notebook has an &amp;#8220;alibi&amp;#8221; installation of Windows XP in its first primary partition sized 4 GB. Since I
aborted the mkdiskimage process early enough, I hoped that only the windows installation was hosed. The Linux system is
entirely in LVM (with crypted LVs), and LVM hadn&amp;#8217;t noticed yet that its PV was gone. I reckoned that I still had a
chance to rescue my data if I didn&amp;#8217;t reboot.
&lt;/p&gt;
&lt;p&gt;
So I hastily commandeered an USB hard disk (thanks, $CUSTOMER, for quickly supplying one), fdisked, pvcreated and
vgextended it and started the pvmove. While this was happening, I theoretically was able to continue working, which I
didn&amp;#8217;t because I was afraid of losing. About half an hour into the copy process, the USB disk chose to deregister
itself and the pvmove aborted. Rebooting the disk made it reappear as sde (it was sdd before), and miraculously, a new
pvmove call just worked. However, a good fraction of actions on the shell resulted in a lot of input/output errors on
the screen. I guessed that this was the first sign of my data finally dying, but I let the pvmove continue.
&lt;/p&gt;
&lt;p&gt;
After the pvmove was finished (which was rather fast since the move of the &amp;#8220;crypted LV&amp;#8221; means that the
crypted data is moved and not de- and recrypted), I had to recreate a /dev/sda2 partition with type 8e before the LVM
tools allowed me to vgreduce the VG.
&lt;/p&gt;
&lt;p&gt;
I then zeroed out the first 10 GB of the internal disk and spent a few hours reinstalling and patching XP from scratch
before I finally went through the pvcreate, vgextend, pvmove routine in the other direction. Then the big moment
arrived: fsck of all LVs.
&lt;/p&gt;
&lt;p&gt;
I guess that the reason for the input/output errors was that /usr was completely hosed (no single file outside
lost+found), but /home and all other file systems holding data where the way back to the (a week old) backup would have
been quite painful were ok. I pulled /, /usr and /var from the backup to be consistent again, updated to current sid
(avoiding KDE 4 for the time being) and could start working again.
&lt;/p&gt;
&lt;p&gt;
The only real loss was a few hours of work that were stored in /usr/local which died along with /usr, so the result of
my stupidity was not very catastrophic but still a good lesson. And I have learned that LVM is a robust and resilient
beast. Good work. Now I&amp;#8217;d like to know what happened to my /usr - I always had the impression that pvmove should
not break data even when the target disk suddenly goes away...
&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Wed, 08 Apr 2009 22:58:32 +0200</pubDate>
    <guid isPermaLink="false">http://blog.zugschlus.de/archives/819-guid.html</guid>
    <category>dataloss</category>
<category>debian</category>
<category>debian-english</category>
<category>lvm</category>

</item>
<item>
    <title>LV naming, UUIDs, file systems labels</title>
    <link>http://blog.zugschlus.de/archives/818-LV-naming,-UUIDs,-file-systems-labels.html</link>
            <category>Debian</category>
    
    <comments>http://blog.zugschlus.de/archives/818-LV-naming,-UUIDs,-file-systems-labels.html#comments</comments>
    <wfw:comment>http://blog.zugschlus.de/wfwcomment.php?cid=818</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://blog.zugschlus.de/rss.php?version=2.0&amp;type=comments&amp;cid=818</wfw:commentRss>
    

    <author>mh+blog-zugschlus-de@zugschlus.de (Marc 'Zugschlus' Haber)</author>
    <content:encoded>
    &lt;p&gt;
In the last few weeks, I spent quite some time wondering about how to arrange the hard disk layout of my productive
systems in the future. This article outlines my thoughts and would like to ask the lazyweb for comments.
&lt;/p&gt;
&lt;p&gt;
I try to keep my Debian servers as identically as possible, making it possible to talk non-linux persons remotely
through the system without having to worry about this particular box&amp;#8217; configuration.
&lt;/p&gt;
 &lt;p&gt;
I have been especially worrying about:
&lt;ul&gt;
&lt;li&gt;(h1) root FS location (/etc/fstab, grub/menu.lst)&lt;/li&gt;
&lt;li&gt;(h2) LVM volume naming (/etc/fstab)&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
On my current systems, I usually have the root file system on /dev/hda1, with /dev/hda2 being a PV which is the only PV
of a VG vg0, which in turn has LVs named home, var and usr.
&lt;/p&gt;
&lt;p&gt;
This setup has a bunch of disadvantages.
&lt;ul&gt;
&lt;li&gt;It is necessary to derive from the standard setup, when RAID or crypto is used. In these cases, the root fs needs to
be in LVM as well, and hda1 is /boot.&lt;/li&gt;
&lt;li&gt;LVM setup breaks in recovery and/or migration scenarios, when the disks from one server are connected to another one
due to two VGs named vg0 being present. These situations are solveable via lvrename per UUID though.&lt;/li&gt;
&lt;li&gt;Migration to libata is painful since the dreaded &amp;#8220;hda&amp;#8221; string lurks in half a dozen places, and Debian
grub does not really cleanly support having different kernels that need different root= clauses on their command
line.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
Thankfully, there is a number of possible solutions:
&lt;ul&gt;
&lt;li&gt;(l1) Mount the root fs with UUID
&lt;ul&gt;
&lt;li&gt;- UUID needs to be adapted in /etc/fstab and grub/menu.lst if file system is rebuilt.&lt;/li&gt;
&lt;li&gt;- mount-per-UUID is a function of the Debian initrd, mechanism nonportable, initrd needed&lt;/li&gt;
&lt;li&gt;+ no conflicts when a server can access disks of another system, as UUID are unique.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;(l2) Mount root fs with label (all root fsses have the same label)
&lt;ul&gt;
&lt;li&gt;- Conflicts when disks are moved between servers, making it possible to boot the wrong system.&lt;/li&gt;
&lt;/ul&gt;&lt;Z/li&gt;
&lt;li&gt;(l3) Mount root fs with a host-specific label
&lt;ul&gt;
&lt;li&gt;- When the system (and the root fs) is renamed, /etc/fstab and grub/menu.lst need to be adapted.&lt;/li&gt;
&lt;li&gt;+ no conflicts when disks of more than one server are plugged in.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;(l4) VG is named identically on all servers
&lt;ul&gt;
&lt;li&gt;- Manual intervention is necessary (see above) if another server&amp;#8217;s disks are placed into one server.&lt;/li&gt;
&lt;li&gt;+ Backup and other disk related scripts can be configured identically in all systems.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;(l5) VG is called like the server
&lt;ul&gt;
&lt;li&gt;- Attention needed when renaming a system (/etc/fstab needs to be adjusted).&lt;/li&gt;
&lt;li&gt;- Backup and other disk related scripts need to be configured differently on each system, no standard config
possible.&lt;/li&gt;
&lt;li&gt;+ no conflicts in the &amp;#8220;more than one set of disks in a server&amp;#8221; case.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
I am pondering about a solution, but suspect that this is totally overengineered.
&lt;ul&gt;
&lt;li&gt;(l1) Root fs is mounted via label, so that /boot/grub/menu.lst only needs to be edited once during syste
installation. After migration to grub 2, a hook script (if grub2&amp;#8217;s update-grub finally supports hooks), the root
FS label can be automatically generated. molly-guard refuses to boot the system when the root FS label from the boot
manager configuration is not identical to the currently mounted root fs&amp;#8217; label, thus forcing to boot with the
current root fs or not to boot at all. Do I need to call blkid -g in that case?
&lt;/li&gt;
&lt;li&gt;(l2) /etc/fstab is identical on all systems and has entries like
&lt;ul&gt;&lt;li&gt;/dev/disk/localhost/usr /usr ext3 defaults&lt;/li&gt;&lt;/ul&gt;
The symlinks in /dev/disk/localhost are generated by a run level S (27) init script (or can this be accomplished by
udev?) from /dev/mapper/$(uname -n)--usr, so that the VG is always named like the host. Renaming the VG needs a rescue
system anyway, so that&amp;#8217;s not a real loss.&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
Did I miss something? Is this a realistic solution? How do you handle this issue? Comments to this article will be open
for quite a while.
&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Thu, 02 Apr 2009 11:04:12 +0200</pubDate>
    <guid isPermaLink="false">http://blog.zugschlus.de/archives/818-guid.html</guid>
    <category>debian</category>
<category>debian-english</category>
<category>lazyweb</category>
<category>linux</category>
<category>lvm</category>
<category>sysadmin</category>

</item>
<item>
    <title>LVM regelt verschärft</title>
    <link>http://blog.zugschlus.de/archives/698-LVM-regelt-verschaerft.html</link>
            <category>Freie Software</category>
    
    <comments>http://blog.zugschlus.de/archives/698-LVM-regelt-verschaerft.html#comments</comments>
    <wfw:comment>http://blog.zugschlus.de/wfwcomment.php?cid=698</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://blog.zugschlus.de/rss.php?version=2.0&amp;type=comments&amp;cid=698</wfw:commentRss>
    

    <author>mh+blog-zugschlus-de@zugschlus.de (Marc 'Zugschlus' Haber)</author>
    <content:encoded>
    &lt;p&gt;
Ich glaube, ich erwähnte es schon, aber LVM ist einfach cool. Ich bereue keinen Meter, schon seit 2002 LVM
grundsätzlich auf jedem Linux-System das ich installiere einzusetzen. Damals war ich hauptsächlich scharf darauf,
Festplattenpartitionen mit &amp;#8220;sprechenden&amp;#8221; Namen zu haben, die obendrein auch noch unabhängig davon sind, mit
welcher Schnittstelle eine Platte an das System angebunden ist.
&lt;/p&gt;
&lt;p&gt;
Aber auch Snapshots und die Möglichkeit zum Resize haben mir inzwischen schon öfter &lt;strike&gt;den Arsch
gerettet&lt;/strike&gt;die Arbeit erleichtert.
&lt;/p&gt;
 &lt;p&gt;
Im Zuge meiner &lt;a href=&quot;http://blog.zugschlus.de/exit.php?url_id=2313&amp;amp;entry_id=698&quot;  onmouseover=&quot;window.status=&#039;http://blog.zugschlus.de/archives/697-Fernsehen-im-Arbeitszimmer.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;interner Link zu
einem anderen Artikel in diesem Blog&quot;&gt;aktuellen Hardwarebasteleien&lt;/a&gt; hatte ich die Aufgabe, ein System von einer
SATA-Platte auf eine PATA-Platte umziehen zu lassen. Das hätte man zwar natürlich auch mit einer tar | tar-Pipe oder
rsync machen können, aber mit LVM ist es doch viel cooler (und man kann kein --numeric-owner und/oder --numeric-ids
vergessen, was mein Lieblingsfehler ist).
&lt;/p&gt;
&lt;p&gt;
Man fahre das System herunter, um die Zielplatte dazuzuhängen. Dann partitioniere man die Zielplatte, lege eine PV an
und erweitere die VG des existierenden Systems um die neue PV (vgextend vg0 /dev/hdc1, zum Beispiel). Als nächstes
weise man das System an, alle Daten von der &amp;#8220;alten&amp;#8221; PV herunterzuschieben (im Falle, dass die alte PV
/dev/sda1 ist, zum Beispiel mit pvmove /dev/sda1). Das dauert eine Weile, also möchte man den pvmove-Aufruf eventuell
mit --interval 30 garnieren, um alle 30 Sekunden darüber informiert zu werden, wie weit der Plattenshredder inzwischen
fortgeschritten ist. 
&lt;/p&gt;
&lt;p&gt;
Während der gesamten Aktion kann das System, dessen Installation oder dessen Daten da gerade verschoben werden, im
vollständigen Produktivbetrieb laufen, was natürlich für einen Server mit wichtigen Aufgaben sehr, sehr praktisch
ist. Hat man Hardware, mit der Hotplugging von Festplatten möglich ist, geht die Migration auf eine neue Platte
komplett ohne Betriebsunterbrechung. Natürlich bleiben Dateiattribute und sogar die Inode-Nummern unverändert, was bei
einer hostbasierten intrusion detection die Menge der nach der Migration erzeugten Fehlalarme deutlich übersichtlicher
macht.
&lt;/p&gt;
&lt;p&gt;
Ist das pvmove abgeschlossen, entfernt man die &amp;#8220;gehende&amp;#8221; PV aus der Volume Group (vgreduce vg0 /dev/sda1,
das ist wichtig. Unvollständige VGs mag der LVM auch dann nicht, wenn dort keine Daten mehr drauf liegen) und kann dann
die alte Platte aus dem System entfernen.
&lt;/p&gt;
&lt;p&gt;
Wo so viel Licht ist, ist natürlich auch Schatten: pvmove heißt pvmove und nicht pvcopy. Das bedeutet insbesondere,
dass man die Daten wieder zurückverschieben muss, wenn sich herausstellt, dass man die neue Platte verkehrt
partitioniert hat. Beim konventionellen Arbeiten würde man einfach die Kopieraktion wiederholen und hätte die Daten
nur zweimal und nicht dreimal über die Schnittstelle geschlenzt.
&lt;/p&gt;
&lt;p&gt;
Außerdem tun sich Linuxe etwas schwer mit dem Booten von LVM-basierten Systemen. Ich hatte jahrelang eine ausgeprägte
initrd-Phobie, was mich dazu zwingt, das root-Filesystem mit typischerweise 200 MB Größe außerhalb des LVM liegen zu
haben. Damit ist der Traum, auf hotplug-fähiger Hardware zum Plattenwechsel komplett ohne Downtime auszukommen,
ausgeträumt, denn mindestens zum klassischen Umkopieren des Root-FS muss gebootet werden, außerdem macht man diese
Kopieraktion am besten aus einem Rettungssystem. Aber da ich zeitlebens noch kein System mit hotplugfähigen Platten
(außer USB, aber da hab ich das auch noch nie probiert) in den Fingern hatte kann ich damit auch leben.
&lt;/p&gt;
&lt;p&gt;
Wenn man mutig ist und mit einer initrd booten kann, braucht man nur /boot außerhalb des LVM. Dann geht die Migration
komplett ohne Downtime, denn /boot aushängen und kopieren kann man auch im laufenden Produktivsystem. Allerdings will
man vermutlich dann auch mal booten, um zu gucken, ob man auch alles richtig gemacht hat - im Zweifelsfall ist sonst der
nächste Boot in einer Streßsituation und man darf dann auch noch mit den Fehlern kämpfen, die man beim Umkopieren
gemacht hat.
&lt;/p&gt;
&lt;p&gt;
Grub2 kann dem Vernehmen nach auch aus einem LVM booten; sollte Grub2 wider erwarten in diesem Leben nochmal benutzbar
werden, kann man sich auch das außerhalb des LVM liegende /boot sparen. Aber ich fürchte, bis dahin wird noch eine
Menge Wasser durch die Neckarschleusen fließen.
&lt;/p&gt;
&lt;p&gt;
Noch zwei Worte zum Thema initrd-Phobie: Die war weitgehend unbegründet. Debians initrd-Tools sind in Form von
initramfs-tools inzwischen so flexibel und ausgereift, dass der Spaß erstaunlich schmerzarm abläuft und man im
Normalbetrieb keine Fußangeln vorfindet. Das funktioniert einfach. Aber bis ich meine Standard-Server-Installation auf
initrd umstelle, muss noch etwas Zeit vergehen.
&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Tue, 27 May 2008 15:00:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.zugschlus.de/archives/698-guid.html</guid>
    <category>linux</category>
<category>lvm</category>

</item>
<item>
    <title>Mietserver-Recovery mit veraltetem Rescuesystem</title>
    <link>http://blog.zugschlus.de/archives/649-Mietserver-Recovery-mit-veraltetem-Rescuesystem.html</link>
            <category>Computer und Netze</category>
    
    <comments>http://blog.zugschlus.de/archives/649-Mietserver-Recovery-mit-veraltetem-Rescuesystem.html#comments</comments>
    <wfw:comment>http://blog.zugschlus.de/wfwcomment.php?cid=649</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://blog.zugschlus.de/rss.php?version=2.0&amp;type=comments&amp;cid=649</wfw:commentRss>
    

    <author>mh+blog-zugschlus-de@zugschlus.de (Marc 'Zugschlus' Haber)</author>
    <content:encoded>
    &lt;p&gt;
Den &lt;a href=&quot;http://blog.zugschlus.de/exit.php?url_id=2291&amp;amp;entry_id=649&quot;  onmouseover=&quot;window.status=&#039;http://blog.zugschlus.de/archives/525-First-Dedicated-Power-Server-S-Limited-Edition.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;Link zum
Blogartikel&quot;&gt;First Dedicated Power Server S Limited Edition&lt;/a&gt; benutze ich seit ziemlich genau einem Jahr als
Entwicklungssystem. Da die Kiste ausschließlich verschlüsselt mit der Außenwelt spricht, sind die Schwächen im
Netzwerksetup des Hosters für meine Anwendung irrelevant. Als nicht irrelevant zeigten sich vor einigen Wochen die
Macken im Rescuesystem, als ein Umstieg auf neue Hardware anstand.
&lt;/p&gt;

 &lt;p&gt;
Mein Server hat im Herbst letzten Jahres angefangen, SMART-Fehlermeldungen zu werfen, und Anfang Februar wurde es mir
dann zu bunt, so dass ich ein Ticket beim Hoster aufgemacht habe. Der Hoster findet bei einer oberflächlichen Prüfung
des Systems, die mit einem knappen halben Tag Downtime verbunden war, keine Fehler und tauscht mir kulanterweise das
PATA-Kabel. Leider hilft das nicht, die SMART- und CRC-Fehler im Syslog tauchen schnell wieder auf.
&lt;/p&gt;
&lt;p&gt;
Als nächstes versucht der Hoster, die Schuld auf mein System zu schieben (&amp;#8220;Fehlerhaftes Dateisystem oder Bugs im
verwendeten Kernel&amp;#8221;) und möchte, dass ich den Server neu aufsetze. Ich versuche das erstmal zu vermeiden und
versuche das Problem mit dem Rescue-System zu reproduzieren. Das erweist sich aber als leichter gesagt als getan, denn
das Rescuesystem ist - ich berichtete - so alt, dass ich damit meine Filesysteme nicht eingehängt bekomme. Und durch
irgendwelche dd-Übungen ist das System nicht zum Werfen von CRC-Fehlern zu bringen.
&lt;/p&gt;
&lt;p&gt;
Also rsynce ich die Daten zähneknirschend auf einen anderen Server (um mir das Restore vom Wohnungs-Backup über mein
dünnes ADSL zu ersparen), mache eine Neuinstallation auf das Uralt-Standardimage des Anbieters, update auf aktuelles
Debian etch mit security-Updates und beginne meine Daten draufzukopieren. Keine fünf Minuten später beginnen wieder
die CRC-Fehler.
&lt;/p&gt;
&lt;p&gt;
Nun ist der Hoster auch überzeugt und bietet mir den Tausch gegen eine komplett neue Maschine an, die dann auch eine
neue IP bekommt. Das stört mich nicht, da ich das System ja nur inten verwende, also stimme ich zu. Leider ist es nicht
möglich, Zugang auf beide Maschinen gleichzeitig zu bekommen; zuerst wird die alte abgeschaltet und dann für die neue
Zugangsdaten generiert. Am Abend desselben Tages kommen die Zugangsdaten für die neue Kiste; ab dem ersten Kontakt bis
hier sind sechs Tage vergangen.
&lt;/p&gt;
&lt;p&gt;
Die Zugangsdaten für den neuen Server teilen mir mit, dass ich mich in das Rescuessystem mit grml@ip-adresse einloggen
soll. Das funktioniert allerdings nicht, und das auf Port 22 sichtbare Banner mit dem String &amp;#8220;Debian woody&amp;#8221;
lässt vermuten, dass ich es hier auch nicht mit einem grml zu tun habe, sondern mit dem &amp;#8220;alten&amp;#8221;
Rescuesystem. Nach einer Stunde sind dann  auch die Zugangsdaten in das System konfiguriert und ich kann mich endlich -
als root - anmelden.
&lt;/p&gt;
&lt;p&gt;
Wie schon im Servertest erwähnt, ist das Rescesystem von First Dedicated uralt. Es basiert irgendwo auf Debian woody,
hat weder LVM-Support im Kernel noch die Userspace-Tools installiert und läuft noch mit Linux 2.4. Damit direkt mein
LVM- und Linux-2.6-basierendes System wieder draufzuklatschen ist illusorisch. Also anders.
&lt;/p&gt;
&lt;p&gt;
Ich entschliesse mich, wie schon bei einem anderen Hoster &lt;a
href=&quot;http://blog.zugschlus.de/exit.php?url_id=2292&amp;amp;entry_id=649&quot;  onmouseover=&quot;window.status=&#039;http://blog.zugschlus.de/archives/530-using-grml-to-prepare-LVM-surgery.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot; title=&quot;link zum Artikel &amp;quot;using
grml to prepare LVM surgery&amp;quot;&quot;&gt;neulich durchgespielt,&lt;/a&gt; ein grml-small in die swap-Partition zu installieren. Aber
dann kommt mir die Idee, dass das gar nicht not tut: Ich habe doch ein nicht im LVM liegendes ext2-Filesystem, nämlich
das System, das im Produktivbetrieb als root eingehängt ist. Spricht eigentlich nichts dagegen, das grml dort abzulegen
- dann steht es schneller zur Verfügung, wenn im Notfall das Root-Filesystem noch da ist. Wenn es nicht mehr da ist,
kann man dann immer noch den Stunt mit dem swap-Filesystem machen.
&lt;/p&gt;
&lt;p&gt;
Also wird schwupps die Platte partitioniert, das root-Filesystem auf hda1 angelegt und dessen Inhalt aus dem Backup
zurückgeschoben. Nach /boot/grml kommt der Inhalt einer grml-small-CD. grml-medium hatte ich zu dem Zeitpunkt noch
nicht ausprobiert; der Trick hätte aber nach den einschlägigen Erfahrungen aus &lt;a
href=&quot;http://blog.zugschlus.de/exit.php?url=aHR0cDovL2Jsb2cuenVnc2NobHVzLmRlL2FyY2hpdmVzLzY0OC1Vbml2ZXJzYWwtYm9vdC1zdGljay1mb3ItRGViaWFuLC1ncm1sLWFuZC10aGUtRGViaWFuLWluc3RhbGxlci5odG1s&amp;amp;entry_id=649&quot;  onmouseover=&quot;window.status=&#039;http://blog.zugschlus.de/archives/648-Universal-boot-stick-for-Debian,-grml-and-the-Debian-installer.html&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;
title=&quot;Link zu &amp;quot;Universal boot stick for Debian, grml and the Debian installer&amp;quot;&quot;&gt;der Erstellung meines
Universal-Boot-Sticks&lt;/a&gt; auch mit grml-medium funktioniert.
&lt;/p&gt;
&lt;p&gt;
Die für grml-small gültige Boot-Eintragung lautet:
&lt;blockquote&gt;
&lt;pre&gt;
title           grml
root            (hd0,0)
kernel          /boot/grml/linux26 toram grml_dir=/boot/grml/GRML/ grml_name=GRML toram ramdisk_size=100000
init=/etc/init lang=us BOOT_IMAGE=grml ssh=M9flN0A1
initrd          /boot/grml/minirt26.gz
&lt;/pre&gt;
&lt;/blockquote&gt;
und ich schätze, dass die für grml-medium irgendetwas rund um
&lt;blockquote&gt;
&lt;pre&gt;
title           grml-medium
root            (hd0,0)
kernel          /boot/grml/boot/grmlmedium/linux26 live-media-path=/grml-medium/live/ toram=grml-medium.squashfs lang=us
boot=live noeject noprompt keyboard=de
initrd          /boot/grml/boot/grmlmedium/initrd.gz
&lt;/pre&gt;
&lt;/blockquote&gt;
heißen müsste. Das hab nich aber nicht ausprobiert.
&lt;/p&gt;
&lt;p&gt;
Nun nur noch grub auf der Platte installieren. Unter Debian liegt das grub-Binary in /usr und steht somit im
vorliegenden Zustand des Systems nicht zur Verfügung; das Rescuesystem hat kein grub. Also schwupps die binäre
grub-Package aus Debian stable gezogen, mit dpkg-deb ausgepackt und... festgestellt, dass die Libraries des
Rescuesystems zu alt sind um das dynamisch gelinkte grub-Binary auszuführen. Ich spare mir den Bugreport &amp;#8220;please
build a new package with statically linked grub&amp;#8221;, weil grub in Debian nicht mehr wirklich gepflegt wird - die
Maintainer sind der Meinung, dass man die Arbeit besser in grub 2 stecken sollte, und ich bin der Meinung, dass bis zur
rudimentären Benutzbarkeit von grub 2 noch ein wenig Wasser den Neckar wird herunter fliessen müssen.
&lt;/p&gt;
&lt;p&gt;
Statt dessen wird /boot/grub in /boot/grub-backup umbenannt, ein historisches grub aus woody ausgepackt, die stages nach
/boot/grub geschoben, menu.lst kopiert und auf der grub-shell installiert. Da der Server keine serielle Konsole hat,
muss mit dem default-Keyword gearbeitet werden (die Einträge zählen ab Null, #451709), und schwupps läuft das grml.
&lt;/p&gt;
&lt;p&gt;
Der Rest ist schnell erzählt: LVM bauen, Filesysteme anlegen, Daten zurück-rsyncen, chroot ins frisch restorete
System, IP-Adresse anpassen, /boot/grub nach /boot/woody-grub umbenennen, /boot/grub-backup zurückschieben,
&amp;#8220;aktuellen&amp;#8221; grub neu installieren, booten und Produktivbetrieb aufnehmen. Das grml bleibt da für
zukünftige Aktionen liegen, mit dem aktuellen Grub lässt es sich ja auch nach Anpassung des Default-Wertes in der
menu.lst kurzfristig booten.
&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Mon, 24 Mar 2008 23:07:00 +0100</pubDate>
    <guid isPermaLink="false">http://blog.zugschlus.de/archives/649-guid.html</guid>
    <category>boot</category>
<category>firstdedicated</category>
<category>grml</category>
<category>grub</category>
<category>hosting</category>
<category>lvm</category>
<category>rescue</category>
<category>rootserver</category>

</item>
<item>
    <title>using grml to prepare LVM surgery</title>
    <link>http://blog.zugschlus.de/archives/530-using-grml-to-prepare-LVM-surgery.html</link>
            <category>Freie Software</category>
    
    <comments>http://blog.zugschlus.de/archives/530-using-grml-to-prepare-LVM-surgery.html#comments</comments>
    <wfw:comment>http://blog.zugschlus.de/wfwcomment.php?cid=530</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://blog.zugschlus.de/rss.php?version=2.0&amp;type=comments&amp;cid=530</wfw:commentRss>
    

    <author>mh+blog-zugschlus-de@zugschlus.de (Marc 'Zugschlus' Haber)</author>
    <content:encoded>
    &lt;p&gt;
One of my dedicated servers was in bad need of major LVM surgery today. Since the rescue system delivered with the
server by the housing provider suffers from lack of LVM support, I needed to pull a creative stunt with grub and &lt;a
href=&quot;http://blog.zugschlus.de/exit.php?url_id=2236&amp;amp;entry_id=530&quot;  onmouseover=&quot;window.status=&#039;http://www.grml.org/&#039;;return true;&quot; onmouseout=&quot;window.status=&#039;&#039;;return true;&quot;  title=&quot;external link to grml&quot;&gt;grml&lt;/a&gt; to accomplish this.
&lt;/p&gt;
 &lt;p&gt;
The dedicated server rented from strato is the Box I tested in a different article. Installing the LVM-based Debian
system via the LVM-less rescue system involved first installing without LVM in the partition which was originally
supposed to be swap, booting the just installed system and using this temporary system to finally bootstrap the target.
&lt;/p&gt;
&lt;p&gt;
I had originally planned to go this way again in case rescue should become necessary. Today, I checked first whether the
provider supplied rescue system had improved in the mean time (which it hadn&amp;#8217;t), and I didn&amp;#8217;t feel like
installing a new temporary system. Instead, I decided to go through a different route, using grml.
&lt;/p&gt;
&lt;p&gt;
grml is extremely versatile regarding boot. All you need is to get the grml kernel to boot and point it towards the grml
initrd, and the initrd automatically searches the available drives for the compressed file system image, mounts it and
continues the boot process. This was the point where I hooked myself into grml. I put an ext3fs on the swap partition
and copied the contents of a grml CD to that partition. After thinking a while about how to get ISOLINUX to boot this
grml, I remembered that the disk already has grub installed, and decided to use grub to boot grml.
&lt;/p&gt;
&lt;p&gt;
This was possible because the provider offers a serial console for the machine. If no serial console had been available,
things would have been a lot harder since there would be no feedback and one would have to talk to grub via offline
editing of menu.lst. Thanks to the serial console, things were a lot faster.
&lt;/p&gt;
&lt;p&gt;
Booting grml via grub is actually easy. After finding out which partition grml is on (find /linux26) and setting this
partition as root, all you need is &amp;#8220;kernel /linux26 ramdisk_size=100000 init=/etc/init lang=us BOOT_IMAGE=grml
console=ttyS0,57600n8&amp;#8221;, &amp;#8220;initrd /minirt26.gz&amp;#8221; and finally &amp;#8220;boot&amp;#8221;.
&lt;/p&gt;
&lt;p&gt;
The &amp;#8220;57600&amp;#8221; given on the kernel command line was actually the hardest part: Strato operates the serial
console at unusual 57600 bps, and grml&amp;#8217;s serial console feature starts mgetty with hard-coded 9600 bps. The rather
frustrating symptom was that you can watch grml booting, with &amp;#8220;Finished execution of main grml startup&amp;#8221; as
the last sign of life. Knowing that there is a login prompt waiting for you at the wrong baud rate.
&lt;/p&gt;
&lt;p&gt;
After talking to Mika from the grml team for some minutes, we decided to take two &amp;#8220;roads&amp;#8221; to solve the
issue. Mika hacked grml&amp;#8217;s startup process to parse the baud rate to be used for mgetty from the kernel command
line. Since I couldn&amp;#8217;t wait for Mika&amp;#8217;s fix, I used a grml.sh script to put a fixed mgetty.config over the
file contained in grml. After fixing some stupid mistakes on my part, I finally received my grml login prompt and could
start with the LVM surgery.
&lt;/p&gt;
&lt;p&gt;
Grml is a perfect tool for such tasks since it is extremely flexible and not selective in which medium and partition
types it can boot from. It has saved me a lot of grief today and has helped me in solving a difficult problem.
&lt;/p&gt;
&lt;p&gt;
Oh, btw, pvmove --alloc anywhere can move a logical volume inside a pysical volume without the need of a temporary
physical volume, and it is thus possible to &amp;#8220;manually&amp;#8221; defragment a physical volume in order to allow more
clean resizing of logical values. While it is debateable whether this does really make sense, it satisfies my sense of
order to have an LVM setup unfragmented.
&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Thu, 29 Mar 2007 00:00:52 +0200</pubDate>
    <guid isPermaLink="false">http://blog.zugschlus.de/archives/530-guid.html</guid>
    <category>debian</category>
<category>debian-english</category>
<category>grml</category>
<category>lvm</category>
<category>rescue</category>
<category>rootserver</category>

</item>
<item>
    <title>LVM unter Linux</title>
    <link>http://blog.zugschlus.de/archives/65-LVM-unter-Linux.html</link>
            <category>Freie Software</category>
    
    <comments>http://blog.zugschlus.de/archives/65-LVM-unter-Linux.html#comments</comments>
    <wfw:comment>http://blog.zugschlus.de/wfwcomment.php?cid=65</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://blog.zugschlus.de/rss.php?version=2.0&amp;type=comments&amp;cid=65</wfw:commentRss>
    

    <author>mh+blog-zugschlus-de@zugschlus.de (Marc 'Zugschlus' Haber)</author>
    <content:encoded>
    &lt;p&gt;
LVM rockt. Gerade mal wieder gemerkt, als in dem von mir betreuten Newsserver die (einzige) Platte ihr Ableben
angekündigt hat. 40 GB Daten im laufenden Betrieb von einer alten auf eine neue Platte schieben ist einfach sexy. Die
einzige Downtime hatte ich mir dadurch eingehandelt, dass die Overviews durch die kaputte Platte beschädigt waren, und
deswegen ein &lt;tt&gt;makeh*story&lt;/tt&gt; fällig war.
&lt;/p&gt;

&lt;p&gt;Diese Gelegenheit nutze ich, einen alten Artikel zum Thema LVM für mein Blog zu recyceln.&lt;/p&gt;

 &lt;h3&gt;Was ist LVM&lt;/h3&gt;

&lt;p&gt;Der Logical Volume Manager ist seit späteren 2.4-Versionen Bestandteil des Linux-Kernels. Zusätzlich zum Kernelcode
sind Userspace-Tools notwendig, mit denen die Verwaltung durchgeführt wird.&lt;/p&gt;

&lt;p&gt;LVM führt zwischen der Plattenpartition (z.B. &lt;tt&gt;/dev/hda1&lt;/tt&gt;) und dem Filesystem (z.B. &lt;tt&gt;/usr&lt;/tt&gt;) zwei
weitere Indirektionsebenen ein, die für beeindruckende Flexibilität sorgen.&lt;/p&gt;

&lt;p&gt;Beim klassischen Filesystemlayout liegen die Ebenen wie folgt übereinander:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mountpoint (z.B. &lt;tt&gt;/usr&lt;/tt&gt;)&lt;/li&gt;
&lt;li&gt;Filesystem (z.B. ext3fs)&lt;/li&gt;
&lt;li&gt;Raw Device (z.B. &lt;tt&gt;/dev/hda1&lt;/tt&gt;)&lt;/li&gt;
&lt;li&gt;Plattenpartition&lt;/li&gt;
&lt;li&gt;Platte&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Eine Veränderung des Filesytems schlägt sofort bis auf die Physik der Platte durch.&lt;/p&gt;

&lt;p&gt;Bei einem LVM-System sieht der Stapel wie folgt aus:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mountpoint (z.B. &lt;tt&gt;/usr&lt;/tt&gt;)&lt;/li&gt;
&lt;li&gt;Filesystem (z.B. ext3fs)&lt;/li&gt;
&lt;li&gt;Logical Volume [LV] (z.B. &lt;tt&gt;/dev/vg0/usr&lt;/tt&gt;)&lt;/li&gt;
&lt;li&gt;Volume Group [VG] (z.B. &lt;tt&gt;/dev/vg0&lt;/tt&gt;)&lt;/li&gt;
&lt;li&gt;Physical Volume [PV] (z.B. &lt;tt&gt;/dev/hda1&lt;/tt&gt;)&lt;/li&gt;
&lt;li&gt;Raw Device (z.B. &lt;tt&gt;/dev/hda1&lt;/tt&gt;)&lt;/li&gt;
&lt;li&gt;Platte&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In Text gesprochen:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Auf einem Mountpoint ist ein Filesystem eingehängt.&lt;/li&gt;
&lt;li&gt;Ein Filesystem liegt auf einer Logical Volume.&lt;/li&gt;
&lt;li&gt;Auf einer Logical Volume liegt immer genau ein Filesystem!&lt;/li&gt;
&lt;li&gt;Eine Logical Volume ist Element einer Volume Group.&lt;/li&gt;
&lt;li&gt;Eine Volume Group hat ein oder mehrere logical Volumes.&lt;/li&gt;
&lt;li&gt;Eine Volume Group besteht aus einer oder mehreren Physical Volumes.&lt;/li&gt;
&lt;li&gt;Eine Physical Volume ist eine Festplattenpartition mit Partitionstyp 8e.&lt;/li&gt;
&lt;li&gt;Bei einheitlicher Aufteilung auf logical volumes sind die Namen der logical volumes überall gleich,
unabhängig vom Plattentyp und deren Organisation.&lt;/li&gt;
&lt;li&gt;Host-based intrusion detection einheitlich konfigurierbar&lt;/li&gt;
&lt;li&gt;Plattenplatzüberwachung einheitlich konfigurierbar.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Vorteile&lt;/h3&gt;

&lt;p&gt;LVM
&lt;ul&gt;
&lt;li&gt;Nimmt Verantwortung aus der Plattenpartitionierung&lt;/li&gt;
&lt;li&gt;Ermöglicht die Partitionierung von Software-RAID-Devices&lt;/li&gt;
&lt;li&gt;Symbolische Namen für filesystem tragende Volumes (&lt;tt&gt;/dev/vg0/usr&lt;/tt&gt;) sorgen für übersichtliche
&lt;tt&gt;/etc/fstab&lt;/tt&gt; und fließend interpretierbare &lt;tt&gt;/proc/mounts&lt;/tt&gt;&lt;/li&gt;
&lt;li&gt;nie wieder unpassende Namen, da Umbenennen möglich&lt;/li&gt;
&lt;li&gt;Vergrößern und verkleinern von Volumes ist möglich&lt;/li&gt;
&lt;li&gt;mit einem online resizebaren Filesystem ist Größenänderung von Dateisystemen im laufenden Betrieb möglich.&lt;/li&gt;
&lt;li&gt;Kopieren einer Volume (z.B. zum Plattenwechsel) ist im laufenden Betirieb möglich&lt;/li&gt;
&lt;li&gt;Bei Erweiterungen muss der Rechner nur zweimal kurz (zum Einbau der neuen und nach dem Kopieren zum Ausbau der alten
Platte) ausser Betrieb gehen, bei hotplug-tauglichen Systemen gar nicht.&lt;/li&gt;
&lt;li&gt;Während des Kopiervorgangs ist Lese- und Schreibzugriff auf die Platte möglich.&lt;/li&gt;
&lt;li&gt;Migration von unter Kernel 2.4 erzeugten Volumes auf Kernel 2.6 ist - inklusive eines schmerzfreien Rückwegs
möglich.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;

&lt;h3&gt;Nachteile&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Funktioniert nicht mit älteren Kernels&lt;/li&gt;
&lt;li&gt;Braucht die Userspace-Tools, die sich obendrein auch noch von der Kernelversion abhängig unterscheiden&lt;/li&gt;
&lt;li&gt;Root-File-System auf LVM funktioniert nur mit initrd. Deswegen lege ich das Root-File-System nicht auf eine
LVM-Volume. Das tut mir nicht weh, da das root-FS auf meinen Sstemen eh &amp;#8220;winzig  (200 MB)&amp;#8221; ist.&lt;/li&gt;
&lt;/ul&gt;
 
    </content:encoded>

    <pubDate>Thu, 16 Jun 2005 03:07:17 +0200</pubDate>
    <guid isPermaLink="false">http://blog.zugschlus.de/archives/65-guid.html</guid>
    <category>debian</category>
<category>linux</category>
<category>lvm</category>

</item>

</channel>
</rss>