{"id":830,"date":"2011-04-02T14:26:52","date_gmt":"2011-04-02T18:26:52","guid":{"rendered":"http:\/\/www.braindeadprojects.com\/blog\/?p=830"},"modified":"2011-04-02T14:54:50","modified_gmt":"2011-04-02T18:54:50","slug":"back-in-the-dark-ages","status":"publish","type":"post","link":"http:\/\/www.braindeadprojects.com\/blog\/what\/back-in-the-dark-ages\/","title":{"rendered":"Back in the dark ages"},"content":{"rendered":"<p>Recently (don&#8217;t ask me why, seriously) I had to migrate a physical <a title=\"Redhat 9\" href=\"http:\/\/www.redhat.com\/about\/presscenter\/2003\/press_rhl9.html\">Redhat 9 <\/a>server to a virtualized platform (<a title=\"KVM\" href=\"http:\/\/www.linux-kvm.org\/page\/Main_Page\">KVM<\/a>).<\/p>\n<p>Yes, ideally one rebuilds the deprecated server anew, but due to time-constraints and a number of other issues that wasn&#8217;t a possibility. Unfortunately, sometimes you just have no choice but to kick the can down the street.<\/p>\n<p>The migration from physical to virtual is simple &#8211; create the virtual guest, create an <a title=\"LVM\" href=\"http:\/\/en.wikipedia.org\/wiki\/Logical_Volume_Manager_%28Linux%29\">LVM<\/a> logical volume for the disk,\u00a0 format it and rsync the contents from the physical to the virtual drive. After that, install grub on the guest and voila &#8211; you&#8217;re done.<\/p>\n<p>Keeping some consistency (although unnecessary), I went with an <a title=\"The EXT3 filesystem\" href=\"http:\/\/en.wikipedia.org\/wiki\/Ext3\" target=\"_blank\">EXT3 filesystem<\/a> on the &#8220;new&#8221; guest. Unfortunately, I came across the following snags:<\/p>\n<ul>\n<li>The inode size used in Redhat 9 is 128 bytes, but modern systems (ie: the host I formatted the partitions from ) use 256 bytes.<\/li>\n<li>There&#8217;s a number of attributes that weren&#8217;t present in Redhat 9.<\/li>\n<\/ul>\n<p>Here&#8217;s the output of tune2fs on a Redhat 9 EXT3 partition:<\/p>\n<blockquote><p># tune2fs -l \/dev\/hda1<br \/>\ntune2fs 1.32 (09-Nov-2002)<br \/>\nFilesystem volume name:\u00a0\u00a0 \/boot<br \/>\nLast mounted on:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;not available&gt;<br \/>\nFilesystem UUID:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9e6fa853-18bc-4c08-bb7c-51c74e0c11ae<br \/>\nFilesystem magic number:\u00a0 0xEF53<br \/>\nFilesystem revision #:\u00a0\u00a0\u00a0 1 (dynamic)<br \/>\nFilesystem features:\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>has_journal filetype \ufeffneeds_recovery \ufeff sparse_super<\/strong><br \/>\nDefault mount options:\u00a0\u00a0\u00a0 (none)<br \/>\nFilesystem state:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 clean<br \/>\nErrors behavior:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Continue<br \/>\nFilesystem OS type:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Linux<br \/>\nInode count:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8032<br \/>\nBlock count:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 32096<br \/>\nReserved block count:\u00a0\u00a0\u00a0\u00a0 1604<br \/>\nFree blocks:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 17451<br \/>\nFree inodes:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 7982<br \/>\nFirst block:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1<br \/>\nBlock size:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1024<br \/>\nFragment size:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1024<br \/>\nBlocks per group:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8192<br \/>\nFragments per group:\u00a0\u00a0\u00a0\u00a0\u00a0 8192<br \/>\nInodes per group:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2008<br \/>\nInode blocks per group:\u00a0\u00a0 251<br \/>\nFilesystem created:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Tue Oct 26 12:48:49 2010<br \/>\nLast mount time:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Thu Oct 28 15:58:10 2010<br \/>\nLast write time:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Thu Oct 28 15:58:10 2010<br \/>\nMount count:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 11<br \/>\nMaximum mount count:\u00a0\u00a0\u00a0\u00a0\u00a0 28<br \/>\nLast checked:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Tue Oct 26 12:48:49 2010<br \/>\nCheck interval:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 15552000 (6 months)<br \/>\nNext check after:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Sun Apr 24 12:48:49 2011<br \/>\nReserved blocks uid:\u00a0\u00a0\u00a0\u00a0\u00a0 0 (user root)<br \/>\nReserved blocks gid:\u00a0\u00a0\u00a0\u00a0\u00a0 0 (group root)<br \/>\nFirst inode:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 11<br \/>\nInode size:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>128<\/strong><br \/>\nJournal UUID:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;none&gt;<br \/>\nJournal inode:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8<br \/>\nJournal device:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0x0000<br \/>\nFirst orphan inode:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<\/p><\/blockquote>\n<p>The following is output from a Centos 5.5 formatted EXT3 filesystem:<\/p>\n<blockquote><p># tune2fs -l \/dev\/mapper\/VolGroup00-LogVol00<br \/>\ntune2fs 1.39 (29-May-2006)<br \/>\nFilesystem volume name:\u00a0\u00a0 &lt;none&gt;<br \/>\nLast mounted on:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;not available&gt;<br \/>\nFilesystem UUID:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 7384cac8-b098-4c85-be6d-643443ae3d3d<br \/>\nFilesystem magic number:\u00a0 0xEF53<br \/>\nFilesystem revision #:\u00a0\u00a0\u00a0 1 (dynamic)<br \/>\nFilesystem features:\u00a0\u00a0\u00a0\u00a0\u00a0<strong> has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file<\/strong><br \/>\nDefault mount options:\u00a0\u00a0\u00a0 user_xattr acl<br \/>\nFilesystem state:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 clean<br \/>\nErrors behavior:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Continue<br \/>\nFilesystem OS type:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Linux<br \/>\nInode count:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6809088<br \/>\nBlock count:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6807552<br \/>\nReserved block count:\u00a0\u00a0\u00a0\u00a0 340377<br \/>\nFree blocks:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6204875<br \/>\nFree inodes:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6752521<br \/>\nFirst block:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<br \/>\nBlock size:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4096<br \/>\nFragment size:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4096<br \/>\nReserved GDT blocks:\u00a0\u00a0\u00a0\u00a0\u00a0 1022<br \/>\nBlocks per group:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 32768<br \/>\nFragments per group:\u00a0\u00a0\u00a0\u00a0\u00a0 32768<br \/>\nInodes per group:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 32736<br \/>\nInode blocks per group:\u00a0\u00a0 1023<br \/>\nFilesystem created:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Thu Oct 28 13:31:34 2010<br \/>\nLast mount time:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Thu Oct 28 17:43:57 2010<br \/>\nLast write time:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Thu Oct 28 17:43:57 2010<br \/>\nMount count:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2<br \/>\nMaximum mount count:\u00a0\u00a0\u00a0\u00a0\u00a0 -1<br \/>\nLast checked:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Thu Oct 28 13:31:34 2010<br \/>\nCheck interval:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0 (&lt;none&gt;)<br \/>\nReserved blocks uid:\u00a0\u00a0\u00a0\u00a0\u00a0 0 (user root)<br \/>\nReserved blocks gid:\u00a0\u00a0\u00a0\u00a0\u00a0 0 (group root)<br \/>\nFirst inode:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 11<br \/>\nInode size:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<strong> 128<\/strong><br \/>\nJournal inode:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8<br \/>\nDefault directory hash:\u00a0\u00a0 tea<br \/>\nDirectory Hash Seed:\u00a0\u00a0\u00a0\u00a0\u00a0 42eb54b3-8f66-4aef-8578-388c9863423c<br \/>\nJournal backup:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inode blocks<\/p><\/blockquote>\n<p>As you can see, some basic features and the inode size has changed in 10+ years. The solution:\u00a0 format the &#8220;new&#8221; guest\u00a0 to match the specs of the old:<\/p>\n<blockquote><p>#mke2fs -O has_journal,filetype,sparse_super,^ext_attr,^resize_inode,^dir_index \\<br \/>\n-I 128 -j \/dev\/sda$disk<\/p><\/blockquote>\n<p>And that&#8217;s it- rysnc the files over to the guest VM, install grub, verify your fstab is good, and voila &#8211; you&#8217;ve transferred a physical server to a virtual one.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently (don&#8217;t ask me why, seriously) I had to migrate a physical Redhat 9 server to a virtualized platform (KVM). Yes, ideally one rebuilds the deprecated server anew, but due to time-constraints and a number of other issues that wasn&#8217;t a possibility. Unfortunately, sometimes you just have no choice but to kick the can down &hellip; <a href=\"http:\/\/www.braindeadprojects.com\/blog\/what\/back-in-the-dark-ages\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Back in the dark ages<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,29,28,1],"tags":[],"class_list":["post-830","post","type-post","status-publish","format-standard","hentry","category-braindeadtip","category-linux","category-virtualization","category-what"],"_links":{"self":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts\/830"}],"collection":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/comments?post=830"}],"version-history":[{"count":29,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts\/830\/revisions"}],"predecessor-version":[{"id":1104,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/posts\/830\/revisions\/1104"}],"wp:attachment":[{"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/media?parent=830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/categories?post=830"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.braindeadprojects.com\/blog\/wp-json\/wp\/v2\/tags?post=830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}