{"id":729,"date":"2023-06-04T16:38:28","date_gmt":"2023-06-04T14:38:28","guid":{"rendered":"https:\/\/pcmacb.de\/?page_id=729"},"modified":"2025-09-16T11:19:46","modified_gmt":"2025-09-16T09:19:46","slug":"verschluesselte-usb-platte-mit-luks-erstellen","status":"publish","type":"page","link":"https:\/\/pcmacb.de\/?page_id=729","title":{"rendered":"USB Platte mit LUKS verschl\u00fcsseln"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>fdisk \/dev\/sdxxx<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-style-plain has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-7a2321544d0458b5de70059263d0f1cb is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"has-white-color has-text-color has-link-color wp-elements-78c135703c65602cdd432719a34b7ee0\">GPT<br>M enter protective\/hybrid MBR<\/p>\n\n\n\n<p class=\"has-white-color has-text-color has-link-color wp-elements-1da7303fd409220061b1259645e235db\">Generic<br>d delete a partition<br>F list free unpartitioned space<br>l list known partition types<br>n add a new partition<br>p print the partition table<br>t change a partition type<br>v verify the partition table<br>i print information about a partition<\/p>\n\n\n\n<p class=\"has-white-color has-text-color has-link-color wp-elements-1e3e14d1407791e844ec40b652326a65\">Misc<br>m print this menu<br>x extra functionality (experts only)<\/p>\n\n\n\n<p class=\"has-white-color has-text-color has-link-color wp-elements-e4f9c8ab97c301071247d4cd69d937a3\">Script<br>I load disk layout from sfdisk script file<br>O dump disk layout to sfdisk script file<\/p>\n\n\n\n<p class=\"has-white-color has-text-color has-link-color wp-elements-88a59afc279936a650db8e6b816fd3e3\">Save &amp; Exit<br>w write table to disk and exit<br>q quit without saving changes<\/p>\n\n\n\n<p class=\"has-white-color has-text-color has-link-color wp-elements-15380e8ea73221db0d19ca12aa245365\">Create a new label<br>g create a new empty GPT partition table<br>G create a new empty SGI (IRIX) partition table<br>o create a new empty MBR (DOS) partition table<br>s create a new empty Sun partition table<\/p>\n<\/blockquote>\n\n\n\n<p>neue Partitionstabelle erstellen mit<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>g\nw<\/code><\/pre>\n\n\n\n<p>sollt eine (zus\u00e4tzliche) NTFS Partition eingerichtet werden, vorzugsweise unter Windows mit der Datentr\u00e4gerverwaltung erstellen, Der Einfachheit halber die zu verschl\u00fcsselnde EXT4 Partition mit Gparted\/parted.<br><br>LUKS Modul in Linux laden und die zweite EXT4 Partition verschl\u00fcsseln,<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>modprobe dm-crypt\ncryptsetup luksFormat \/dev\/sdc2\n<\/code><\/pre>\n\n\n\n<p>\u00f6ffnen und einbinden mit<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>cryptsetup luksOpen \/dev\/sdc2 USBCRYPT\nmkdir \/home\/username\/USBCRYPT\nmount \/dev\/mapper\/USBCRYPT \/home\/username\/USBCRYPT<\/code><\/pre>\n\n\n\n<p>zum aush\u00e4ngen<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>umount \/home\/username\/USBCRYPT\ncryptsetup luksClose USBCRYPT<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">LVS erstellen mit LUKS<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">PV &#8222;Physical Volume&#8220;<\/h3>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>pvcreate \/dev\/sdc\npvs \/dev\/sdc\n&nbsp;PV &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VG Fmt &nbsp;Attr PSize &nbsp;&nbsp;PFree &nbsp;&nbsp;\n&nbsp;\/dev\/sdc &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lvm2 --- &nbsp;120.00g 120.00g<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>pvdisplay \/dev\/sdc\n&nbsp;\"\/dev\/sdc\" is a new physical volume of \"120.00 GiB\"\n&nbsp;--- NEW Physical volume ---\n&nbsp;PV Name &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/dev\/sdc\n&nbsp;VG Name &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;PV Size &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;120.00 GiB\n&nbsp;Allocatable &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NO\n&nbsp;PE Size &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 &nbsp;&nbsp;&nbsp;\n&nbsp;Total PE &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0\n&nbsp;Free PE &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0\n&nbsp;Allocated PE &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0\n&nbsp;PV UUID &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xxxx-xxxxi-xxxxxxx-xxxx-xxxx-xxxxM<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">VG &#8222;Volume Group&#8220;<\/h3>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>vgcreate vg00 \/dev\/sdc\nvgdisplay vg00\n  --- Volume group ---\n  VG Name               vg00\n  System ID             \n  Format                lvm2\n  Metadata Areas        1\n  Metadata Sequence No  1\n  VG Access             read\/write\n  VG Status             resizable\n  MAX LV                0\n  Cur LV                0\n  Open LV               0\n  Max PV                0\n  Cur PV                1\n  Act PV                1\n  VG Size               &lt;120.00 GiB\n  PE Size               4.00 MiB\n  Total PE              30719\n  Alloc PE \/ Size       0 \/ 0   \n  Free  PE \/ Size       30719 \/ &lt;120.00 GiB\n  VG UUID               xxx-xxx-x-x-xxx--xxx<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">LV &#8222;Logical Volume&#8220;<\/h3>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>lvcreate -L 30G -n lv00 vg00<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Format LVM Partition<\/h3>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>mkfs.ext4 \/dev\/vg00\/lv00<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>mke2fs 1.47.0 (5-Feb-2023)\nCreating filesystem with 7864320 4k blocks and 1966080 inodes\nFilesystem UUID: 3fad8a83-9051-4dd8-8dd7-9a7c65669b20\nSuperblock backups stored on blocks: &nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, &nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4096000\n\nAllocating group tables: done &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nWriting inode tables: done &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nCreating journal (32768 blocks): done\nWriting superblocks and filesystem accounting information: done<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">LVM verschl\u00fcsseln<\/h3>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>cryptsetup luksFormat \/dev\/mapper\/vg00-lv00<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">LVM Crypt \u00f6ffnen und mounten<\/h3>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>cryptsetup luksOpen \/dev\/mapper\/vg00-lv00 lvmcrypt<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GPTM enter protective\/hybrid MBR Genericd delete a partitionF list free unpartitioned spacel list known partition typesn add a new partitionp print the partition tablet change a partition typev verify the partition tablei print information about a partition Miscm print this <a class=\"more-link\" href=\"https:\/\/pcmacb.de\/?page_id=729\">weiterlesen&#8230;<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"class_list":["post-729","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages\/729","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/pcmacb.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=729"}],"version-history":[{"count":16,"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages\/729\/revisions"}],"predecessor-version":[{"id":1305,"href":"https:\/\/pcmacb.de\/index.php?rest_route=\/wp\/v2\/pages\/729\/revisions\/1305"}],"wp:attachment":[{"href":"https:\/\/pcmacb.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}