On Thu, 26 Sep 2013, Giacomo Mulas escribió: > I think I found why uswsusp is unable to resume when the swap partition is > on a lvm device, but I suspect that the problem lies with lvm2 > and will have to be fixed either there or in initramfs-tools. > > Essentially, when in the boot sequence scripts/local-top/lvm2 gets executed > in the ramdisk, it does not activate all available lvm devices, but rather > tries to individually activate the root device and the resume device, > calling the function activate_vg which is defined in the same script. > Now, what happens is that when activate_vg is called with a > /dev/mapper/something device as argument it works correctly; instead, when > it is given an argument "UUID=whateversensibleuuid" it fails to activate the > matching lvm partition, even if it exists in the system. > > Now, since ROOT is defined by the argument provided in the kernel boot > command line, and since the grub scripts set it up to > /dev/mapper/rootvg-rootlvm, this works ok to activate the root partition. > > Instead, the RESUME variable is set up in the conf/conf.d/resume > configuration file, which is magically set up by mkinitramfs to always be in > the form UUID=someuuid EVEN IF this was explicitly set in > /etc/initramfs-tools/conf/conf.d/resume as > RESUME=/dev/mapper/somecorrectlvmdevice > This happens in /usr/share/initramfs-tools/hooks/resume, which calls blkid > to translate _any_ candidate resume device found to UUID form. This is then > passed to activate_vg which fails to activate it. > > > Possible solutions I see: > > 1) The Right Thing: fix the function activate_vg in > /usr/share/initramfs-tools/scripts/local-top/lvm2 so that it activates an > lvm partition which is given in the form UUID=somecorrectlvmuuid > > 2) not too bad kludge: add a special case in > /usr/share/initramfs-tools/hooks/resume so that if a resume device is given > as /dev/mapper/something it is left alone and not forcibly translated to > UUID=correspondinguuid; this would make previously working configurations > (e.g. in which one had specified a correct RESUME line in > /etc/initramfs-tools/conf/conf.d/resume) happy again > > 3) atomic bomb approach: instead of going to great lengths to determine and > activate in the initramdisk only the root and resume lvm devices, just put > an unconditional lvm vgchange -aly --ignorelockingfailure > line in /usr/share/initramfs-tools/scripts/local-top/lvm2, which will always > activate all lvm devices and be done with it. > > I suggest that the uswsusp maintainer should relay this email (and/or his > own better analysis) to the maintainers of the lvm2 and initramfs-tools > packages, so that a common agreement can be found for a solution accepted by > all, which can hopefully be expected to work for some time and not be broken > time and again by some apparently unrelated change. > > > Bye > Giacomo
Hi Giacomo, thanks a lot for your report. I will forward it to the maintainers, but can you try first this new uswsusp version? http://www.kix.es/Philipp/ This version only change the variable name in the uswsusp scripts from RES_DEV to RESUME and adds the offset argument to the resume file. This change could help in other bug and Ben (initramfs-tools maintainer) suggest me the change. Thanks! kix -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org