Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 289055 - sys-fs/cryptsetup: /etc/init.d/dmcrypt should check partition type before mkswap
Summary: sys-fs/cryptsetup: /etc/init.d/dmcrypt should check partition type before mkswap
Status: RESOLVED DUPLICATE of bug 248495
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 289058 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-14 14:53 UTC by Daniel Bahrdt
Modified: 2011-11-13 04:20 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***