<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.bwt.com.de/index.php?action=history&amp;feed=atom&amp;title=Encrypting_An_Existing_Partition</id>
	<title>Encrypting An Existing Partition - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bwt.com.de/index.php?action=history&amp;feed=atom&amp;title=Encrypting_An_Existing_Partition"/>
	<link rel="alternate" type="text/html" href="https://wiki.bwt.com.de/index.php?title=Encrypting_An_Existing_Partition&amp;action=history"/>
	<updated>2026-05-13T20:46:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.bwt.com.de/index.php?title=Encrypting_An_Existing_Partition&amp;diff=7&amp;oldid=prev</id>
		<title>BrainwreckedTech: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwt.com.de/index.php?title=Encrypting_An_Existing_Partition&amp;diff=7&amp;oldid=prev"/>
		<updated>2014-01-06T01:52:15Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Prep=&lt;br /&gt;
&lt;br /&gt;
While sing dd to blank the partition using /dev/zero is usually quick, using dd to fill a drive with random data using the cryptographically-secure /dev/urandom can take a long time.  To wit, a Via 1.2GHz C7 7-watt single-core CPU would have taken 6&amp;amp;frac12; days to fill a 500GB drive using /dev/urandom.  An AMD 2.8GHz Anthlon II quad-core CPU took 4&amp;amp;frac12; hours.  You may wish to move the drive to a faster computer.&lt;br /&gt;
&lt;br /&gt;
#Comment-out appropriate entries in /etc/fstab&lt;br /&gt;
#Shut down the computer the drive originated from.&lt;br /&gt;
#Remove the drive.&lt;br /&gt;
#Restart the computer the drive came from if you need it.&lt;br /&gt;
#Power off the target computer the drive will be temporarily installed to.&lt;br /&gt;
#Install the drive in the faster computer.&lt;br /&gt;
#Boot into Linux on the faster computer.&lt;br /&gt;
#Run &amp;lt;code&amp;gt;sudo fdisk -l&amp;lt;/code&amp;gt; to list the partition of all drives.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can just leave the drive where it&amp;#039;s at and unmount the device.&lt;br /&gt;
&lt;br /&gt;
 sudo umount [mount-point]&lt;br /&gt;
&lt;br /&gt;
=Wipe=&lt;br /&gt;
&lt;br /&gt;
Protect against data recovery by blanking the partition.&amp;lt;br&amp;gt;&lt;br /&gt;
The extra ampersand at the end will allow the process to run in the background and spit out a process ID number.&lt;br /&gt;
&lt;br /&gt;
 sudo dd if=/dev/zero of=/dev/sd[a-z][0-9] bs=1M &amp;amp;&lt;br /&gt;
&lt;br /&gt;
The bigger the partition, the longer dd takes.&amp;lt;br&amp;gt;&lt;br /&gt;
If you want to check the progress of the process at any time, issue this command&lt;br /&gt;
&lt;br /&gt;
 sudo kill -USR1 [process-id]&lt;br /&gt;
&lt;br /&gt;
Protect agains physical hackery by filling the partition with random data.&amp;lt;br&amp;gt;&lt;br /&gt;
This makes it tougher to tell which parts contain encrypted data and which do not.&lt;br /&gt;
&lt;br /&gt;
 dd if=/dev/urandom of=/dev/sd[a-z][0-9] bs=1M &amp;amp;&lt;br /&gt;
&lt;br /&gt;
=Crypt &amp;amp; Format=&lt;br /&gt;
&lt;br /&gt;
Run this command to set up the encrypted partition:&lt;br /&gt;
&lt;br /&gt;
 cryptsetup -y -c aes-cbc-essiv:sha256 luksFormat /dev/sd[a-z][0-9]&lt;br /&gt;
&lt;br /&gt;
Re-mount the encrypted partition:&lt;br /&gt;
&lt;br /&gt;
 cryptsetup luksOpen /dev/sd[a-z][0-9] [name]&lt;br /&gt;
&lt;br /&gt;
Format the partition:&lt;br /&gt;
&lt;br /&gt;
 mkfs -t [filesystem] /dev/mapper/[name]&lt;br /&gt;
&lt;br /&gt;
=Configuation=&lt;br /&gt;
&lt;br /&gt;
Edit /etc/crypttab and add an entry&lt;br /&gt;
&lt;br /&gt;
 [name] UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx none luks&lt;br /&gt;
&lt;br /&gt;
Edit /etc/fstab and add an entry&lt;br /&gt;
&lt;br /&gt;
 /dev/mapper/[name] [mount-point] defaults 0 2&lt;br /&gt;
&lt;br /&gt;
Update the initrd image.&lt;br /&gt;
&lt;br /&gt;
 sudo update-initramfs -u&lt;/div&gt;</summary>
		<author><name>BrainwreckedTech</name></author>
	</entry>
</feed>