slashbeast / better-initramfs

Small and reliable initramfs solution supporting (remote) rescue shell, lvm, dmcrypt luks, software raid, tuxonice, uswsusp and more.
BSD 3-Clause "New" or "Revised" License
318 stars 54 forks source link

TuxOnIce and swapfile #37

Closed demonking closed 7 years ago

demonking commented 7 years ago

Hello,

is it somehow possible to use better-initramfs with a swapfile and tuxonice? The line of resume looks liks this :
tuxonice resume=file:UUID=xxx-xxx-xx:offsetxxx The file is in /root/swapfile, but i get the information, that is not there with the following error:

resume: could not stat the resume device file

also tried

resume=file:/root/swapfile

Could i be, that i make some kind of error? root is fully encrypted, i use the following grub line:

linux /kernel-4.4.8 enc_root=/dev/gnr/root lvm luks root=/dev/mapper/enc_root rootfstype=ext4 toi_initramfs_resume_only=1 tuxonice resume=file:UUID=xxx-xxx:offsetxxx

xxx =for short ;)

When i don't use tuxonice and everything else, it works like a charm.

It seems, that it's trying to encrypt the partition after everything else was parsed?

slashbeast commented 7 years ago

Hi,

I have not tested tuxonice in years, but I think you sould add there something like resume=file:/dev/sda2:0xdc008. I think you cannot use UUID there, as tuxonice reads the kernel params on itself, so I think covering it within better-initramfs would not change enything.

demonking commented 7 years ago

Hello,

the reason for this is, that i want to save the resume file in an encrypted partition. With `resume=file:/dev/sda2:0xdc008 wouldn't work ;)

Swap partition is in /dev/mapper/gn-swap (LVM) and also encrypted. The Key for this is in /root/xxxxx.

Do you have any suggestions?

slashbeast commented 7 years ago

Try with the full path, /dev/mapper/gn-swap. The resume code is executed after dmcrypt and lvm are settled so it could work. I am 100% sure I was using TuxOnIce on luks-encrypted lvm lv before, tho not sure if it was a file or the whole swap.