How to cancel swap mounting at boot in Debian initrd?


Results 1 to 10 of 10

Thread: How to cancel swap mounting at boot in Debian initrd?

  1. #1
    Join Date
    Jul 2003
    Location
    Spokane, Washington
    Posts
    580

    How to cancel swap mounting at boot in Debian initrd?

    When I installed Debian stable on a headless machine of mine, I configured a partition with LUKS encryption (intended for swap), but told the installer not to use it. After installation, I configured that encrypted partition as swap and mounted it. I wanted my headless machine to boot all the way without manual intervention, so I can log in via ssh and mount my encrypted partitions.
    However, since the kernel was updated (and the initrd regenerated), the machine now waits during boot for me to enter the swap encryption password, but no others, only the swap.
    I have been unable to find in my searchings how the initrd is generated with that setting or how I can change it, preferably permanently so future regenerated initrd's don't try activating my encrypted swap on boot. Does anyone know how to configure a Debian style initrd generator to generate an initrd that will not try to activate swap?

  2. #2
    Join Date
    Jun 2006
    Location
    Haarlem, Holland
    Posts
    129
    I believe you just have to comment out a line in /etc/fstab

  3. #3
    Join Date
    Jul 2003
    Location
    Spokane, Washington
    Posts
    580
    Commenting out the swap line in fstab didn't work, nor deleting it. Neither did deleting the 'swap' keyword for my encrypted swap in /etc/crypttab.

    "dpkg-reconfigure linux-image-(version)" should regenerate a new initrd, right?

  4. #4
    Join Date
    Sep 2003
    Location
    Rochester, MN
    Posts
    3,607
    Not sure how to do it through initrd, but the noswap boot parameter should tell the kernel not to use swap. I'm not sure whether that allows you to turn it back on after boot though.

  5. #5
    Join Date
    Jul 2003
    Location
    Spokane, Washington
    Posts
    580
    Some Googling and manpage reading shows that the "noswap" boot option will have no effect. All the option does is disable the automatic mounting of swap devices listed in /etc/fstab that don't have the noauto option. (Not having "noswap" lets "swapon -a" be ran, which ignored my /etc/fstab line with the 'noauto' option.) My encrypted swap was not being automatically mounted, only automatically "cryptdisk-start"-ed. Despite the 'noauto' option in my /etc/crypttab, and now it isn't even labeled as a swap device there either.

  6. #6
    Join Date
    Jul 2003
    Location
    Spokane, Washington
    Posts
    580
    Quote Originally Posted by Pafnoutios View Post
    My encrypted swap was not being automatically mounted, only automatically "cryptdisk-start"-ed.
    I guess I mistitled the thread.

  7. #7
    Join Date
    Sep 2003
    Location
    Rochester, MN
    Posts
    3,607
    Hmm, yeah and I'm afraid I can't help much with that because I've never used encryption.

  8. #8
    Join Date
    Jul 2003
    Location
    Spokane, Washington
    Posts
    580
    Ah haaaa!

    It has to do with software suspend and resume! I found "resume device = /dev/mapper/swap_crypt" in my /etc/uswsusp.conf.

    This is a server machine that should never suspend. So I ran "apt-get purge uswsusp", and now it boots to a login prompt with no manual intervention.

    Will this have any unintended consequences?

  9. #9
    Join Date
    Sep 2003
    Location
    Rochester, MN
    Posts
    3,607
    Ah, interesting. I suppose that would do it since it has to check the swap partition for resume information each boot. As long as you're not using swsusp I don't see a problem with your solution.

  10. #10
    Join Date
    Oct 2002
    Location
    Baton Rouge, Louisiana, USA
    Posts
    799
    For reasons I have long ago forgotten, I commented out the resume device line for my file server and most of my workstations. Something about making it easier to clone drives to make new systems while removing/moving around partitions in the new systems.

    I never suffered any ill consequences from this. I didn't remove uswsusp, I just commented out the resume device line. As far as I know, this leaves uswsusp as nothing more than dead weight in my systems; I can't imagine it has any useful functionality without any device to "do stuff" with.
    Isaac Kuo, ICQ 29055726 or Yahoo mechdan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •