My whole HDD and home dir are encrypted (so it seems to encrypt the swap partition too by default) I accidentaly shutdown the PC by with the power button. The result was that Ubuntu was starting only in recovery mode and I had to reinstall it. Even the debian in virtualbox, which was running at the time of the shutdown, was messed up. It started in read only mode, fsck fixed it partly but there are still problems.

So, how come this encrypted swap causes so much trouble and is this going to happen every time there is hard shutdown?

I installed 17.04 which SUPPOSEDLY comes with swap file instead of partition, but I don't see a swap file and there is still swap partition. I installed fresh, so it did not keep anything from the previous install.

  • I'm not sure how the swap partition is connected to anything in your question. You don't mention it in the description of your set-up and the recovery (attempt). I can't imagine how its mere existence or (accidental mis-)use, encrypted or not, can cause havoc. The kernel never tries to swap to areas that aren't mounted as swap areas and you can't mount swap areas that aren't formatted as such. I'd vote to close as unclear if that were possible for questions with an open bounty. – David Foerster May 3 '17 at 15:15
  • It seems to be known issue from my research. And related to swap. However if you have other ideas, I'm open. – user240891 May 4 '17 at 10:22
  • 1
    I don't, actually, because there is so little description of your (previous) system set-up. Could you please edit your question to provide more detail? E. g., did you use LUKS for the encryption and/or LVM? What was the partition/and or logical volume layout? What exactly did you do to restore the system state after the forced shut-down and what were the results? Post-mortems are difficult if not impossible if there's nothing to see of the original situation. Thanks. – David Foerster May 4 '17 at 10:32
  • I'm not familiar with 17.04 since I run the LTS version. This is just a thought: Since it's inception, *NIX has not looked favorably on disorderly shutdowns such as having the power removed. This has gotten a lot better over the decades and now fsck can often times recover files that were corrupted when they were in use at the time of the power off. I've never heard or experienced a problem such as you described with the swap file. However, if an ENCRYPTED file system gets corrupted it's very iffy whether fsck will be able to fix it. This is true of MS OS as well. – jones0610 May 6 '17 at 3:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.