tag:blogger.com,1999:blog-68990585665636528372024-03-13T17:07:48.613+05:30Jot Down: UNIX/Linux RecipesAnother blog from a UNIX/Linux junkie ;)Anonymoushttp://www.blogger.com/profile/05938185766315436689noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-6899058566563652837.post-5512015378815402182014-12-23T01:58:00.003+05:302016-01-28T00:28:38.598+05:30I am moving to Wordpress.com (http://jotdownux.wordpress.com)<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: center;">
<span style="background-color: red; font-family: "times" , "times new roman" , serif; font-size: x-large;">NOTICE</span></div>
<div style="text-align: center;">
<span style="font-family: "times" , "times new roman" , serif;"><br /></span></div>
<div style="text-align: center;">
<span style="font-family: "times" , "times new roman" , serif; font-size: large;"><br /></span></div>
<div style="text-align: center;">
<span style="font-family: "times" , "times new roman" , serif; font-size: large;">Dear Reader,</span></div>
<div style="text-align: center;">
<span style="font-family: "times" , "times new roman" , serif; font-size: large;"><br /></span></div>
<div style="text-align: center;">
<span style="font-family: "times" , "times new roman" , serif; font-size: large;">I have moved to my new updated <a href="http://jotdownux.wordpress.com/" target="_blank">wordpress.com blog</a>. </span></div>
<div style="text-align: center;">
<span style="font-family: "times" , "times new roman" , serif; font-size: large;">Please visit the new page, that also contains the old posts you may be looking for.</span></div>
<div style="text-align: center;">
<span style="font-family: "times" , "times new roman" , serif; font-size: large;">I am not continuing with this blog anymore.</span><br />
<span style="font-family: "times" , "times new roman" , serif; font-size: large;">https://jotdownux.wordpress.com/</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/05938185766315436689noreply@blogger.com0tag:blogger.com,1999:blog-6899058566563652837.post-43092876159645535082012-02-19T22:59:00.000+05:302012-02-19T22:59:03.975+05:30Linux: RHEL: How to create LUKS encrypted file-system<div dir="ltr" style="text-align: left;" trbidi="on"><br />
<div class="MsoNormal"><span style="font-family: "Courier New";">LUKS encrypted filesystem can be created over any of the block devices like a bare hard disk, logical volume, or a raid array.<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";">To create a LUKS encrypted file-system, we first need to write the block device with random data.<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";"><br />
</span></div><div class="MsoNormal"><span style="font-family: "Courier New";">dd if=/dev/urandom of=/dev/sdb bs=1K<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";"><br />
</span></div><div class="MsoNormal"><span style="font-family: "Courier New";">This may take a little while depending on the size of the disk.<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";">After that, disk has to be formatted as LUKS:<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";"><br />
</span></div><div class="MsoNormal"><span style="font-family: "Courier New";">cryptsetup –verbose luksFormat --verify-passphrase /dev/sdb<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";"><br />
</span></div><div class="MsoNormal"><span style="font-family: "Courier New";">Now, open the encrypted disk:<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";"><br />
</span></div><div class="MsoNormal"><span style="font-family: "Courier New";">cryptsetup –verbose luksOpen /dev/sdb enc_data<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";"><br />
</span></div><div class="MsoNormal"><span style="font-family: "Courier New";">Enc_data will be created under /dev/mapper.<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";">Now, proceed with formatting the encrypted disk with ext4:<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";"><br />
</span></div><div class="MsoNormal"><span style="font-family: "Courier New";">mkfs –t ext4 /dev/mapper/enc_data<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";"><br />
</span></div><div class="MsoNormal"><span style="font-family: "Courier New";">And, lastly mount the file-system to a mount point.<o:p></o:p></span></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New";">To close the encrypted disk, unmount the disk first. Then issue the following command:<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";"><br />
</span></div><div class="MsoNormal"><span style="font-family: "Courier New";">cryptsetup –verbose luksClose enc_data<o:p></o:p></span></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New";">To check the status of the encrypted disk:<o:p></o:p></span></div><div class="MsoNormal"><span style="font-family: "Courier New";"><br />
</span></div><div class="MsoNormal"><span style="font-family: "Courier New";">cryptsetup status enc_data<o:p></o:p></span></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><span style="font-family: "Courier New";">To open the encrypted disk while booting, put a line with the encrypted disk name and the underlying block device in the </span></div><div class="MsoNormal"><span style="font-family: 'Courier New';">/etc/crypttab file:</span></div><div class="MsoNormal"><span style="font-family: "Courier New";"><br />
</span></div><div class="MsoNormal"><span style="font-family: "Courier New";">Enc_data /dev/sdb<o:p></o:p></span></div></div>Anonymoushttp://www.blogger.com/profile/05938185766315436689noreply@blogger.com0