Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 289055

Summary: sys-fs/cryptsetup: /etc/init.d/dmcrypt should check partition type before mkswap
Product: Gentoo Linux Reporter: Daniel Bahrdt <daniel.bugs.gentoo.org>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Daniel Bahrdt 2009-10-14 14:53:10 UTC
If you repartition your device and forget to change the settings in conf.d/dmcrypt you might loose a lot of data. I have tried this on a 200GB ext4 partition. Fortunately fsck.ext4 could recover the data (I haven't activated the swap partition).
What I'm asking for is a check like fdisk -l /dev/sda | grep /dev/sda10 | grep swap as I can't think of another usage of random keys except with swap-partitions.
Comment 1 Rafał Mużyło 2009-10-14 15:31:51 UTC
*** Bug 289058 has been marked as a duplicate of this bug. ***
Comment 2 Daniel Bahrdt 2010-02-08 21:38:06 UTC
I just want to share some kind of workaround until this gets fixed:

swap=crypt-swap
source="$(fdisk -l /dev/sda | grep 'sda9' | grep -wq 'swap' && echo '/dev/sda9')"
Comment 3 SpanKY gentoo-dev 2011-01-08 00:58:13 UTC
fdisk only works on partitioned disks.  it fails on files, loop setups, ...
Comment 4 SpanKY gentoo-dev 2011-11-13 04:20:17 UTC

*** This bug has been marked as a duplicate of bug 248495 ***