How to disable cryptswap?

1,447

Solution 1

I followed this explanation (currently down, see its google cache), and it worked without any problems.

Solution 2

To remove crypt mapping use something like this:

cryptsetup remove cryptswap1

Or just reboot the computer. If you remove/comment lines from /etc/crypttab and /etc/fstab, encrypted swap will not created on the next boot.

Solution 3

If you used cryptsetup to create your encrypted swap, you can easily reverse the process:

Currently your /dev/hda? will be mapped to cryptswap (something like cryptsetup luksOpen /dev/hda4 cryptswap)

so first disable the line in /etc/crypttab that mentions cryptswap and remove the cryptswap line from /etc/fstab

Then use cryptsetup to remove the crypt mapping.

At this point you can remove the swap partition and recreate it as an ordinary partition

Share:
1,447
Patrick
Author by

Patrick

Updated on September 18, 2022

Comments

  • Patrick
    Patrick 8 months

    I've been having trouble pasting an image from my application into PowerPoint, while preserving transparency. I have an image stored as a System.Drawing.Graphics type which I then convert to a System.Drawing.Bitmap type and copy to the clipboard. During this process I also use Bitmap.MakeTransparent(Color.Black) so that everything in the original document which was black will be transparent when the image is pasted.

    if (GraphicsInterface.getGraphics() != null)
    {
        Image image = GraphicsInterface.getGraphics();
        Bitmap bitmap = new Bitmap(image);
        bitmap.MakeTransparent(Color.Black);
        Clipboard.SetImage(bitmap);
    }
    

    However, when I try to paste the image into an application like PowerPoint, instead of being transparent, everything that was black is now a very light gray.

    Is my approach correct? Is there a way to reconcile the transparent values in .net and PowerPoint? Or will the transparency have to be done manually once the image is inserted to PowerPoint?

    • John Saunders
      John Saunders almost 13 years
      The fact that you are using "C# and .NET" is largely irrelevant to your question. The important thing is that you are using Windows Forms.
    • Patrick
      Patrick almost 13 years
      @John: I understand why C# is irrelevant, but why is Windows Forms more relevant than .NET? I am pretty new to Windows development and I'm curious as to why that is
    • John Saunders
      John Saunders almost 13 years
      Windows Forms it the subset of .NET that you are using if you are using System.Drawing. It's a tiny subset compared to the entirety of .NET.
  • AMissico
    AMissico almost 13 years
    Note that the "PNG" format is only supported by Microsoft Office.
  • kbrimington
    kbrimington almost 13 years
    Thanks, @AMissico. Do you mean by this that other office-like products, such as OOo.org, will not accept an image added to the clipboard in this way? (I'll not be able to confirm this at the office.)
  • AMissico
    AMissico almost 13 years
    @kbrmington: (See stackoverflow.com/questions/2799442/… for reference.) From my experimentation, I believe the "PNG" clipboard format is a custom format implemented by Microsoft Office. I thought this was a solution to my problem but found it only works with Microsoft Office applications. I was able to test with Office 2003 and Office 2007. I also tested with all graphics applications on my computer and none of them understood the format. I used the "Clipboard Viewer" to monitor the clipboard while testing.
  • kbrimington
    kbrimington almost 13 years
    @AMissico: Thanks. I'm going to put some thought into this. What are you pasting into?
  • AMissico
    AMissico almost 13 years
    @kbrimington: I normally use Paint Shop Pro 9. Yet, I was trying to get the image to paste into anything. I think a good application to test with would be Paint.NET since it is free.
  • Patrick
    Patrick almost 13 years
    Thanks, this works well. To make the image transparent I just created a bitmap, made the necessary color transparent, and cast it back to an image.
  • kbrimington
    kbrimington almost 13 years
    @Patrick: I'm glad it helped. Do keep an eye on @AMissico's question (referenced in the comments) in case a more-portable solution surfaces.
  • Hilton Shumway
    Hilton Shumway over 8 years
    The mapping in /dev/mapper wasn't there for me, so I skipped that part of the disable instructions
  • Nyerguds
    Nyerguds over 5 years
    @AMissico Gimp supports the PNG type too, and I suspect increasingly more apps are supporting it nowadays. For those that don't, you'll have to get into the giant mess that is the bitfields-type DIB format; a 32-bit RGB format that keeps getting abused as being ARGB.