On Thu, 4 Jan 2007, J. Milgram wrote:

what I'm trying to do: I have an init script that sets up encrypted swap using dm_crypt. The script has the device name (/dev/hda1, whatever) hardwired into it. Should be obvious how dangerous this is - if the script migrates to a machine where /dev/hda1 is /home, then disaster (I once did mkswap on the wrong partition, and boy is it painful). So I want to add a test. Maybe I need to look at the swapon source...

Swapon checks that mkswap has already left the right magic numbers at the start of the partition before blowing anything away. I can't seem to find the man page for dm_crypt on the web, is it more like mkswap or more like swapon? It seems hard to believe that you'd need to run the equivalent of mkswap on every boot...

                        Alexey

Reply via email to