[{"data":1,"prerenderedAt":475},["ShallowReactive",2],{"Categories":3,"NavIndexCategoriesCountFooter":203,"content-\u002F2005\u002F09\u002F17\u002Fsetting-up-encrypted-partitions-using-dm-crypt\u002F":204},[4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,70,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202],{"category":5},"System Administration",{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},"Software Development",{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":27},{"category":27},{"category":67},"Drones & RC",{"category":69},"DIY Projects",{"category":67},{"category":72},"Photography",{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":67},{"category":67},{"category":72},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":5},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":67},{"category":67},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":72},{"category":67},{"category":138},"3D Printing - Laser Cutting - CNC",{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":5},{"category":138},{"category":27},{"category":27},{"category":138},{"category":138},{"category":72},{"category":158},"Photography,3D Printing - Laser Cutting - CNC",{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":67},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":181},"Home Assistant",{"category":181},{"category":72},{"category":27},{"category":27},{"category":72},{"category":138},{"category":5},{"category":72},{"category":72},{"category":138},{"category":27},{"category":181},{"category":181},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},191,{"id":205,"title":206,"body":207,"category":5,"date":459,"description":460,"embedImage":461,"extension":462,"image":461,"intro":461,"meta":463,"navigation":464,"path":465,"seo":466,"series":461,"sitemap":467,"stem":468,"tags":469,"__hash__":474},"content\u002F2005\u002F09\u002F17\u002Fsetting-up-encrypted-partitions-using-dm-crypt.md","Setting up encrypted partitions using dm-crypt",{"type":208,"value":209,"toc":457},"minimark",[210,223,229,248,251,344,347,353,424,429,453],[211,212,213,214],"p",{},"All you need to know is found here ",[215,216,217],"a",{"href":217,"rel":218,"target":222},"http:\u002F\u002Fdeb.riseup.net\u002Fstorage\u002Fencryption\u002Fdmcrypt\u002F",[219,220,221],"nofollow","noopener","noreferer","_blank",[211,224,225],{},[226,227,228],"strong",{},"Comments",[230,231,232,236,239,242,245],"ul",{},[233,234,235],"li",{},"Stock debian 2.6 kernel works just fine",[233,237,238],{},"Stock debian kernel is modular - so looking in \u002Fproc\u002Fcrypto before you start won't show aes, and dmsetup targets won't show crypto",[233,240,241],{},"Here - I'm adding an lvm2 partition for this (the comments at the end of the above link about lvm are about putting lvm pv's onto a crypt partition - here I have a crypt partition on top of lvm - so the comments do not apply)",[233,243,244],{},"On a different machine I've used a partition on an USB external harddisk which works too (you will need to remount if you unplug the USB and replug while mounted)",[233,246,247],{},"The above link has details of using loopback too",[211,249,250],{},"Code executed:",[252,253,258],"pre",{"className":254,"code":255,"language":256,"meta":257,"style":257},"language-shell shiki shiki-themes github-dark","aptitude install dmsetup cryptsetup\nlvcreate -L 1G -n crypt vg\ncryptsetup -y create private \u002Fdev\u002Fmapper\u002Fvg0-crypt\nmkfs -t xfs \u002Fdev\u002Fmapper\u002Fprivate\nmkdir \u002Fmnt\u002Fprivate\n","shell","",[259,260,261,280,302,320,335],"code",{"__ignoreMap":257},[262,263,266,270,274,277],"span",{"class":264,"line":265},"line",1,[262,267,269],{"class":268},"svObZ","aptitude",[262,271,273],{"class":272},"sU2Wk"," install",[262,275,276],{"class":272}," dmsetup",[262,278,279],{"class":272}," cryptsetup\n",[262,281,283,286,290,293,296,299],{"class":264,"line":282},2,[262,284,285],{"class":268},"lvcreate",[262,287,289],{"class":288},"sDLfK"," -L",[262,291,292],{"class":272}," 1G",[262,294,295],{"class":288}," -n",[262,297,298],{"class":272}," crypt",[262,300,301],{"class":272}," vg\n",[262,303,305,308,311,314,317],{"class":264,"line":304},3,[262,306,307],{"class":268},"cryptsetup",[262,309,310],{"class":288}," -y",[262,312,313],{"class":272}," create",[262,315,316],{"class":272}," private",[262,318,319],{"class":272}," \u002Fdev\u002Fmapper\u002Fvg0-crypt\n",[262,321,323,326,329,332],{"class":264,"line":322},4,[262,324,325],{"class":268},"mkfs",[262,327,328],{"class":288}," -t",[262,330,331],{"class":272}," xfs",[262,333,334],{"class":272}," \u002Fdev\u002Fmapper\u002Fprivate\n",[262,336,338,341],{"class":264,"line":337},5,[262,339,340],{"class":268},"mkdir",[262,342,343],{"class":272}," \u002Fmnt\u002Fprivate\n",[211,345,346],{},"Two new scripts (I do not want the partition automounted):",[211,348,349],{},[350,351,352],"em",{},"mount_private:",[252,354,356],{"className":254,"code":355,"language":256,"meta":257,"style":257},"#!\u002Fbin\u002Fbash\nif [ -b \u002Fdev\u002Fmapper\u002Fprivate ]; then\n    cryptsetup remove private\nfi\ncryptsetup create private \u002Fdev\u002Fmapper\u002Fvg0-crypt\nmount -t xfs \u002Fdev\u002Fmapper\u002Fprivate \u002Fmnt\u002Fprivate\n",[259,357,358,364,383,394,399,409],{"__ignoreMap":257},[262,359,360],{"class":264,"line":265},[262,361,363],{"class":362},"sAwPA","#!\u002Fbin\u002Fbash\n",[262,365,366,370,374,377,380],{"class":264,"line":282},[262,367,369],{"class":368},"snl16","if",[262,371,373],{"class":372},"s95oV"," [ ",[262,375,376],{"class":368},"-b",[262,378,379],{"class":372}," \u002Fdev\u002Fmapper\u002Fprivate ]; ",[262,381,382],{"class":368},"then\n",[262,384,385,388,391],{"class":264,"line":304},[262,386,387],{"class":268},"    cryptsetup",[262,389,390],{"class":272}," remove",[262,392,393],{"class":272}," private\n",[262,395,396],{"class":264,"line":322},[262,397,398],{"class":368},"fi\n",[262,400,401,403,405,407],{"class":264,"line":337},[262,402,307],{"class":268},[262,404,313],{"class":272},[262,406,316],{"class":272},[262,408,319],{"class":272},[262,410,412,415,417,419,422],{"class":264,"line":411},6,[262,413,414],{"class":268},"mount",[262,416,328],{"class":288},[262,418,331],{"class":272},[262,420,421],{"class":272}," \u002Fdev\u002Fmapper\u002Fprivate",[262,423,343],{"class":272},[211,425,426],{},[350,427,428],{},"umount_private:",[252,430,432],{"className":254,"code":431,"language":256,"meta":257,"style":257},"#!\u002Fbin\u002Fbash\numount \u002Fmnt\u002Fprivate\ncryptsetup remove private\n",[259,433,434,438,445],{"__ignoreMap":257},[262,435,436],{"class":264,"line":265},[262,437,363],{"class":362},[262,439,440,443],{"class":264,"line":282},[262,441,442],{"class":268},"umount",[262,444,343],{"class":272},[262,446,447,449,451],{"class":264,"line":304},[262,448,307],{"class":268},[262,450,390],{"class":272},[262,452,393],{"class":272},[454,455,456],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}",{"title":257,"searchDepth":282,"depth":282,"links":458},[],"2005-09-17 10:16:47 +0200","All you need to know is found here http:\u002F\u002Fdeb.riseup.net\u002Fstorage\u002Fencryption\u002Fdmcrypt\u002F",null,"md",{},true,"\u002F2005\u002F09\u002F17\u002Fsetting-up-encrypted-partitions-using-dm-crypt",{"title":206,"description":460},{"loc":465},"2005\u002F09\u002F17\u002Fsetting-up-encrypted-partitions-using-dm-crypt",[470,471,472,473],"debian","lvm2","encryption","tutorial","IMctfuoFP1PW8Ms1zeOg_jnWHYtk1m2bCYTcMaSqx-8",1775293016835]