Recent versions of dracut only add resume support for systems with a swap device when building host only initramfss. I have a swap device, but it still doesn't add resume support. I'm guessing it's something to do with detection of the volume. Other than it's on LVM, mine's nothing unusual I don't think. I can provide plenty of further details if I know what's useful :) Maybe this as a starter: akira ~ # udevadm info /dev/dm-8 P: /devices/virtual/block/dm-8 N: dm-8 S: disk/by-id/dm-name-spindle-swap S: disk/by-id/dm-uuid-LVM-5c3wH5hNMrgw6oOT6gvNqLAaJ1YM33FyT5o6DLRC6DBfbAaJPiq0LD0BU84lmKqe S: disk/by-label/swap S: disk/by-uuid/3c4aa72c-67e8-4cf3-a9d4-759c6d1f0951 S: mapper/spindle-swap S: spindle/swap E: DEVLINKS=/dev/disk/by-id/dm-name-spindle-swap /dev/disk/by-id/dm-uuid-LVM-5c3wH5hNMrgw6oOT6gvNqLAaJ1YM33FyT5o6DLRC6DBfbAaJPiq0LD0BU84lmKqe /dev/disk/by-label/swap /dev/disk/by-uuid/3c4aa72c-67e8-4cf3-a9d4-759c6d1f0951 /dev/mapper/spindle-swap /dev/spindle/swap E: DEVNAME=/dev/dm-8 E: DEVPATH=/devices/virtual/block/dm-8 E: DEVTYPE=disk E: DM_ACTIVATION=1 E: DM_LV_NAME=swap E: DM_NAME=spindle-swap E: DM_SUSPENDED=0 E: DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 E: DM_UDEV_PRIMARY_SOURCE_FLAG=1 E: DM_UDEV_RULES_VSN=2 E: DM_UUID=LVM-5c3wH5hNMrgw6oOT6gvNqLAaJ1YM33FyT5o6DLRC6DBfbAaJPiq0LD0BU84lmKqe E: DM_VG_NAME=spindle E: ID_FS_LABEL=swap E: ID_FS_LABEL_ENC=swap E: ID_FS_TYPE=swsuspend E: ID_FS_USAGE=other E: ID_FS_UUID=3c4aa72c-67e8-4cf3-a9d4-759c6d1f0951 E: ID_FS_UUID_ENC=3c4aa72c-67e8-4cf3-a9d4-759c6d1f0951 E: ID_FS_VERSION=tuxonice E: MAJOR=253 E: MINOR=8 E: SUBSYSTEM=block E: UDISKS_PRESENTATION_NOPOLICY=1 E: USEC_INITIALIZED=89328
Works for me with dracut-033-r1. Could you attach or post the content of your fstab?
Assuming you don't need the whole thing... /dev/spindle/swap none swap defaults 0 0
(In reply to Dan Goodliffe from comment #2) > Assuming you don't need the whole thing... > > /dev/spindle/swap none swap defaults 0 0 Shouldn't it be: dev, none, swap, sw, 0, 0?
Can't see a mention of sw in man fstab or man swapon... but either way, changed it, no difference.
Found it, I think... host_fs_types lists the device as "swsuspend"... but /usr/lib/dracut/modules.d/95resume/module-setup.sh is looking for "swap" else bailing out. I've changed that and it's built resume support in (although I haven't yet tried a hibernate cycle, not a good time)
If I'm following my debugging properly... I get here... akira ~ # blkid -u filesystem -o export /dev/spindle/swap DEVNAME=/dev/spindle/swap LABEL=swap UUID=3c4aa72c-67e8-4cf3-a9d4-759c6d1f0951 TYPE=swsuspend akira ~ # qfile $(which blkid) sys-apps/util-linux (/sbin/blkid) akira ~ # emerge -qpv util-linux [ebuild R ] sys-apps/util-linux-2.23.2-r2 USE="bash-completion caps cramfs ncurses nls pam suid udev unicode -cytune -fdformat -old-linux (-selinux) -slang -static-libs {-test} -tty-helpers" Don't know if I'm barking up the right tree or not... can't think why my blkid would report anything different to anyone else's.
(In reply to Dan Goodliffe from comment #5) > Found it, I think... > > host_fs_types lists the device as "swsuspend" How is this possible? From dracut script: for line in "${fstab_lines[@]}"; do set -- $line #dev mp fs fsopts push host_devs "$1" host_fs_types["$1"]="$3" done
strace suggests it's calling blkid (as per previous comment) I can only assume right now that it's from get_fs_env from _get_fs_type. Maybe /usr/bin/dracut line ~955
(In reply to Dan Goodliffe from comment #8) > strace suggests it's calling blkid (as per previous comment) > I can only assume right now that it's from get_fs_env from _get_fs_type. > > Maybe /usr/bin/dracut line ~955 Please add --debug to the command you are using to generate initramfs and attach the output.
Created attachment 359998 [details] Debug output dracut -H -f --lzma /boot/initramfs-3.8.13-tuxonice.img.new --debug 2> debug
Try 033 :) http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=546d5dacf5d680526e3b2ddea757487c938a64c9
akira ~ # dracut --version getopt: unrecognized option '--version' Usage: /usr/bin/dracut [OPTION]... [<initramfs> [<kernel-version>]] Version: 033-r1 ..... Specifically 033, not -r1? What I have is... while read _d _m _t _o _r; do [[ "$_d" == \#* ]] && continue [[ $_d ]] || continue [[ $_t != "swap" ]] && continue [[ $_m != "swap" ]] && [[ $_m != "none" ]] && continue [[ "$_o" == *noauto* ]] && continue _d=$(expand_persistent_dev "$_d") [[ "$_d" -ef "$dev" ]] || continue
Seems you run modified version of dracut ( [[ $fs = swap ]] -> [[ $fs = swsuspend ]] ), but this makes no sense. host_fs_types is modified by _get_fs_types(), so this is where swsuspend comes from. I suspect that this problem exist only on tuxonice kernels. Relevant part of the debug output: /usr/bin/dracut@940(_get_fs_type): ID_FS_TYPE=swsuspend /usr/bin/dracut@941(_get_fs_type): host_fs_types["$(readlink -f "/dev/block/$1")"]=swsuspend [...] /usr/lib/dracut/dracut-functions.sh@1065(module_check): check -h /usr/lib/dracut/modules.d/95resume/module-setup.sh@7(check): [[ -n -h ]] /usr/lib/dracut/modules.d/95resume/module-setup.sh@8(check): for fs in ' "${host_fs_types[@]}"' /usr/lib/dracut/modules.d/95resume/module-setup.sh@9(check): echo ext4 /usr/lib/dracut/modules.d/95resume/module-setup.sh@10(check): [[ ext4 = swsuspend ]] /usr/lib/dracut/modules.d/95resume/module-setup.sh@8(check): for fs in ' "${host_fs_types[@]}"' /usr/lib/dracut/modules.d/95resume/module-setup.sh@9(check): echo swsuspend /usr/lib/dracut/modules.d/95resume/module-setup.sh@10(check): [[ swsuspend = swsuspend ]] /usr/lib/dracut/modules.d/95resume/module-setup.sh@10(check): return 0 /usr/lib/dracut/dracut-functions.sh@1066(module_check): _ret=0
Fix is trivial. - [[ $fs = swap ]] && return 0 + [[ $fs = swap ]] || [[ $fs = swsuspend ]] && return 0
Ah, yes... I had previously put some debug in there and tried that to see if that's why I wasn't getting resume support. Thought I'd put it back before running with --debug. Agreed on the kernel front. 2 boxes here with tuxonice, both "swsuspend"... 2 hardened, both "swap". I suspect a lot of people wanting resume support run tuxonice on ice, thankfully as you say, the fix is trivial.
Created attachment 360236 [details, diff] resume-fix-swap-detection-in-hostonly-mode.patch This is probably an overkill, but 95resume/resume-genrules.sh still support all of this fs types. Does it work?
That seems to fix resume support a treat :) I can't boot normally with that initramfs though (black screen and no network connectivity) but that's definitely something else entirely.
Fixed upstream: http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=cfdec163f9dfd5e083f2c8a728c476381faa8baa
Thank you, Alexander! +*dracut-034-r1 (16 Oct 2013) + + 16 Oct 2013; Amadeusz Żołnowski <aidecoe@gentoo.org> +dracut-034-r1.ebuild, + +files/034-0006-resume-fix-swap-detection-in-hostonly.patch: + Fixed bug #487322 (resume support in hostonly mode) and bug #486516 + (redundant + inclusion of libs from lib32 directory). + + Thanks to Alexander Tsoy <alexander@tsoy.me> for patch for bug #486516. + :
Seems to work a treat, as you'd expect. Thanks.