<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;">Another post asked if I have a wiki account.&nbsp; The answer is "no".&nbsp; I think that at this point it would be better if i did for this article.<br><br>In response to some of the points by Tru:<br><br>&gt; to be verified: you need to make a GUI install, the text mode installation<br>&gt; method does not have the lvm creation feature.<br><br>Very true, Tru.&nbsp; This detail is actually a hold-over from one of the documents that I used as a source.&nbsp; I have not actually tried a text-mode install but it should definitely be verified.<br><br>&gt;imho, should be emphasized -&gt; and some figures hinted for the minimal size of sda3 (swap+/)<br><br>Emphasis is not a problem.&nbsp; As for the size of sda3, I can try to clarify the sizes.&nbsp; The document states that sda3 should be smaller than what will become sda2 so that there is room for the encryption overhead, but as for the sizes of things such as swap and other partitions, the best I know to do is refer to CentOS/RedHat documentation.&nbsp; I am open to other suggestions.<br><br>&gt; make patch file available a the command to apply it:<br>&gt; wget http://../mkinitrd.patch -O /tmp/mkintrd.patch<br>&gt; cd / &amp;&amp; patch -p1 &lt; /tmp/mkinitd.patch<br><br>Is there a good place to make it available?&nbsp; Would something such as sourceforge be best?<br></div><br>&gt; non dd version?<br>&gt; vgextend + pvmove + vgreduce ?<br><br>A quick google search found that this would be possible, but there is a trade-off.&nbsp; Section 4.1 of the page http://www.planamente.ch/emidio/docs/linux/dm-crypt/dm-crypt-4.html explains the trade-off.&nbsp; It's basically a single dm-crypt device with a single passphrase for the entire disk vs multiple dm-crypt devices each with it's own passphrase.&nbsp; If this type of option were to be added to the document, I think that it should probably go into the "Optional Configurations" section so that the main document can be a cookie-cutter step by step for people to follow.<br><br>&gt; &gt;  # pvresize –-setphysicalvolumesize [size of disk - /boot] /dev/mapper/lvm<br>&gt; why not just pvresize /dev/mapper/lvm ?<br>&gt; should it detect the size by itself?<br><br>I believe that it will.&nbsp; I think I listed the command that way so that it would allude to the fact that you don't have to use the entire disk if you didn't want.&nbsp; You can increase the size of /dev/sda2 and still have some space on the disk for additional volumes, encrypted devices, etc.&nbsp; That's what the "Optional Configurations" area tries to detail a little more.<br><br>&gt; &gt; NOTE: To make the encrypted system the default system, make the above lines the first block listed in grub.conf<br>&gt; or set the default value <br><br>True.&nbsp; I phrased that section with the intent that the original grub entries would be removed along with the unencrypted install in which case the entry for the encrypted system would end up with the at the default value of 0. <br><br>&gt; &gt;  # lvextend -L +[size to increase the volume] /dev/VolGroup00/LogVol00<br>&gt; &gt; <br>&gt; same question, here (autodetection) if you only want to extend a single logical volume.<br>&gt; lvextend /dev/VolGroup00/LogVol00<br><br>This was in case LVM was built with multiple logical volumes.&nbsp; You would want to specify the size of each volume that you want to increase so the first one doesn't take all space and leave no room for the others to grow.&nbsp; I&nbsp; probably need to clarify that point.<br><br>Chris<br> <br><br><hr id="stopSpelling">&gt; Date: Fri, 17 Oct 2008 09:35:00 +0200<br>&gt; From: tru@centos.org<br>&gt; To: centos-docs@centos.org<br>&gt; Subject: Re: [CentOS-docs] Encrypting tmp swap and home<br>&gt; <br>&gt; On Thu, Oct 16, 2008 at 09:41:12PM -0400, Chris * wrote:<br>&gt; &gt; <br>&gt; &gt; I had submitted a document to this list a few weeks back that gave<br>&gt; ...<br>&gt; nice write-up, minor typo/corrections in the text added below.<br>&gt; <br>&gt; Cheers,<br>&gt; <br>&gt; Tru<br>&gt; &gt; Summary<br>&gt; ...<br>&gt; &gt; <br>&gt; &gt; Step One: Prepare the disk<br>&gt; &gt; The first step is to prepare the disk. The installer partitioning software<br>&gt; &gt; doesn't have the flexibility to be able to do this, so you will need to<br>&gt; &gt; switch to the shell and perform the setup manually.<br>&gt; <br>&gt; to be verified: you need to make a GUI install, the text mode installation<br>&gt; method does not have the lvm creation feature.<br>&gt; <br>&gt; &gt; Once the installer has moved into the GUI, press Ctrl-Alt-F2 to get a command prompt.<br>&gt; ...<br>&gt; &gt; <br>&gt; &gt; Use fdisk to create the partitions for install. You will need to create a<br>&gt; &gt; /boot partition and an LVM partition at the end of the disk. The gap in<br>&gt; &gt; between the two partitions will become your encrypted file-system. This<br>&gt; &gt; document will refer to the boot partition as /dev/sda1 and the install<br>&gt; &gt; partition at the end of the disk as /dev/sda3. The encrypted partition will<br>&gt; &gt; become /dev/sda2.<br>&gt; <br>&gt; imho, should be emphasized -&gt; and some figures hinted for the minimal size of sda3 (swap+/)<br>&gt; <br>&gt; &gt; The partition at the end of the disk should be smaller than the empty space<br>&gt; &gt; between /boot and your LVM partition so that there is room for the meta-data<br>&gt; &gt; associated with the encryption. The LVM partition really only needs to be<br>&gt; &gt; large enough to install the system. You will be able to expand the system<br>&gt; &gt; volumes if you like after you have a working, encrypted system.<br>&gt; &gt; <br>&gt; ...<br>&gt; &gt; <br>&gt; &gt; Step Two: Installing the OS<br>&gt; &gt; The installation must be done using the graphical installer because the text installer doesn't allow a custom installation to use LVM.<br>&gt; should be placed above, since the installer has already started.<br>&gt; <br>&gt; ...<br>&gt; &gt; <br>&gt; &gt; Step Three: Create the encrypted partition<br>&gt; &gt; <br>&gt; &gt; Step Four: Configure mkinitrd for encrypted system<br>&gt; &gt;<br>&gt; &gt; Make a backup copy of /sbin/mkinitrd. Future updates of the mkinitrd package<br>&gt; &gt; will overwrite it, but the changes will allow future kernel updates to<br>&gt; &gt; properly build an initrd. Modify /sbin/mkinitrd per the patch below. The<br>&gt; &gt; patch modifies the MODULES line so that initrd has the proper modules for<br>&gt; &gt; encryption, adds cryptsetup to initrd, and configures initrd to open the<br>&gt; &gt; encrypted file-system.<br>&gt; &gt; <br>&gt; make patch file available a the command to apply it:<br>&gt; wget http://../mkinitrd.patch -O /tmp/mkintrd.patch<br>&gt; cd / &amp;&amp; patch -p1 &lt; /tmp/mkinitd.patch<br>&gt; <br>&gt; &gt; Enter the pass-phrase. Now you can copy the contents of sda3 to the encrypted sda2.<br>&gt; &gt; <br>&gt; &gt;  # dd if=/dev/sda3 of=/dev/mapper/lvm<br>&gt; non dd version?<br>&gt; vgextend + pvmove + vgreduce ?<br>&gt; <br>&gt; &gt; NOTE: To make the encrypted system the default system, make the above lines the first block listed in grub.conf<br>&gt; or set the default value <br>&gt; <br>&gt; &gt; Once the encrypted system is confirmed to be working correctly, remove the<br>&gt; &gt; unencrypted system. Randomize /dev/hda3 by using either shred or dd. Once<br>&gt;                                      ^ sda3<br>&gt; &gt; Use the fdisk command to resize sda2 to fill the entire disk.<br>&gt; &gt; <br>&gt; ...<br>&gt; &gt; <br>&gt; &gt;  # pvresize –-setphysicalvolumesize [size of disk - /boot] /dev/mapper/lvm<br>&gt; why not just pvresize /dev/mapper/lvm ?<br>&gt; should it detect the size by itself?<br>&gt; &gt; Extend the logical volumes of the system with lvextend. man lvextend for more information on the command.<br>&gt; &gt; <br>&gt; &gt;  # lvextend -L +[size to increase the volume] /dev/VolGroup00/LogVol00<br>&gt; &gt; <br>&gt; same question, here (autodetection) if you only want to extend a single logical volume.<br>&gt; lvextend /dev/VolGroup00/LogVol00<br>&gt; <br>&gt; <br>&gt; -- <br>&gt; Tru Huynh (mirrors, CentOS-3 i386/x86_64 Package Maintenance)<br>&gt; http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0xBEFA581B<br><br /><hr />Stay organized with simple drag and drop from Windows Live Hotmail. <a href='http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_102008' target='_new'>Try it</a></body>
</html>