{"id":5,"date":"2011-01-31T16:43:23","date_gmt":"2011-01-31T16:43:23","guid":{"rendered":"http:\/\/www.salsaunited.net\/blog\/?p=5"},"modified":"2011-01-31T16:43:23","modified_gmt":"2011-01-31T16:43:23","slug":"create-luks-lvm-partition","status":"publish","type":"post","link":"https:\/\/blog.domb.net\/?p=5","title":{"rendered":"create luks lvm partition"},"content":{"rendered":"<div>\n<ol>\n<li>\n<div><code>lvcreate -L 500M -n crypto cryptovg<\/code><\/div>\n<\/li>\n<li>\n<div>Fill your partition with random data: <code>dd if=\/dev\/urandom of=\/dev\/<\/code><code>cryptovg<\/code><code>\/crypto <\/code><\/div>\n<\/li>\n<li>\n<div>initialize your partition: <code>cryptsetup --verbose --verify-passphrase luksFormat \/dev\/<\/code><code>cryptovg<\/code><code>\/<\/code><code>crypto<br \/>\n<\/code><\/div>\n<\/li>\n<li>\n<div>open the newly encrypted device: <code>cryptsetup luksOpen \/dev\/<\/code><code>cryptovg<\/code><code>\/<\/code><code>crypto cryptosec<\/code><\/div>\n<\/li>\n<li>\n<div>check it&#8217;s there: <code>ls -l \/dev\/mapper | grep cryptosec<\/code><\/div>\n<\/li>\n<li>\n<div>create a filesystem: <code>mkfs.ext4 \/dev\/mapper\/cryptosec<\/code><\/div>\n<\/li>\n<li>\n<div>mount it: <code>mount \/dev\/mapper\/cryptosec \/media\/cryptosec<\/code><\/div>\n<\/li>\n<li>\n<div>check it&#8217;s visible: <code>df -h | grep <\/code><code>cryptosec<\/code><\/div>\n<\/li>\n<li>\n<div>add the following to \/etc\/crypttab: <code>cryptosec <\/code><code>\/dev\/<\/code><code>cryptovg<\/code><code>\/<\/code><code>crypto <\/code><code> none<\/code><\/div>\n<\/li>\n<li>\n<div>edit your \/etc\/fstab, removing the old entry for \/dev\/cryptovg\/crypto and adding <code>\/dev\/mapper\/<\/code><code>cryptosec <\/code><code>\/media\/<\/code><code>cryptosec <\/code><code>ext4 defaults 1 2<\/code><\/div>\n<\/li>\n<li>\n<div>restore default SELinux security contexts: <code>\/sbin\/restorecon -v -R \/media\/<\/code><code>cryptosec<\/code><\/div>\n<\/li>\n<li>\n<div>reboot: <code>shutdown -r now<\/code><\/div>\n<\/li>\n<li>\n<div>The entry in \/etc\/crypttab makes your computer ask your <code>luks<\/code> passphrase on boot<\/div>\n<\/li>\n<li>\n<div>Login as root and restore your backup<\/div>\n<\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>lvcreate -L 500M -n crypto cryptovg Fill your partition with random data: dd if=\/dev\/urandom of=\/dev\/cryptovg\/crypto initialize your partition: cryptsetup &#8211;verbose &#8211;verify-passphrase luksFormat \/dev\/cryptovg\/crypto open the newly encrypted device: cryptsetup luksOpen \/dev\/cryptovg\/crypto cryptosec check it&#8217;s there: ls -l \/dev\/mapper | grep cryptosec create a filesystem: mkfs.ext4 \/dev\/mapper\/cryptosec mount it: mount \/dev\/mapper\/cryptosec \/media\/cryptosec check it&#8217;s visible: df&#8230;<\/p>\n","protected":false},"author":2,"featured_media":162,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-5","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/5","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5"}],"version-history":[{"count":1,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/5\/revisions"}],"predecessor-version":[{"id":163,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/posts\/5\/revisions\/163"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=\/wp\/v2\/media\/162"}],"wp:attachment":[{"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.domb.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}