Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

hibernate not working after cloning system to sdb

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
rayandrews
Posts: 108
Joined: 2014-01-31 21:32
Has thanked: 3 times
Been thanked: 1 time

hibernate not working after cloning system to sdb

#1 Post by rayandrews »

So I backed up my system to another disk (sdb) and made that disk bootable, and all's well except that hibernate does not work it just 'bounces back' to exactly where my system was at before the command. Cutting to the chase I tried 's2disk -r /dev/sdb1' (my swap partition) and it writes things out alright, but no luck on reboot, the image is not found. I use LILO and tried:

append = "resume=/dev/sdb1"

but still no luck. I suspect this will be simple enough once I know the file to edit. BTW I tried reinstalling 'hibernate' with no effect.

systemctl hibernate sorta works, but it kills one of my three monitors in xfce for some reason -- I resume back to xfce, but my primary monitor is black. logging out and restarting xfce restores everything fine but still.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: hibernate not working after cloning system to sdb

#2 Post by Head_on_a_Stick »

Edit /etc/initramfs-tools/conf.d/resume with the correct UUID for the new swap partition then regenerate the initramfs:

Code: Select all

# update-initramfs -u -k all
Off-topic: systemctl hibernate should work, might be worth looking into that. If you're using NVIDIA then it's probably the proprietary driver; if you're using Intel graphics try removing xserver-xorg-video-intel.
deadbang

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: hibernate not working after cloning system to sdb

#3 Post by p.H »

rayandrews wrote: 2022-09-21 04:15 I backed up my system to another disk (sdb)
How ? Did you clone the partition UUIDs ?
Do UUID, LABEL and so on displayed by blkid match the identifiers in /etc/fstab and /etc/initramfs-tools/conf.d/resume ?
rayandrews wrote: 2022-09-21 04:15 append = "resume=/dev/sdb1"
/dev/sd* names are not reliable and may change at every boot. Use persistent identifiers such as UUID=xxx or LABEL=xxx instead (yes swap devices can have a LABEL, see man swaplabel).
rayandrews wrote: 2022-09-21 04:15 I tried 's2disk -r /dev/sdb1'
Note that the command "s2disk" is provided by the package "uswsusp" which was removed from bullseye, the current stable (reason: Dead upstream, unmaintained).
Head_on_a_Stick wrote: 2022-09-21 05:08 Edit /etc/initramfs-tools/conf.d/resume with the correct UUID for the new swap partition
Or set "RESUME=auto" to select the biggest active swap area (at the time of initramfs update).
However IIRC the kernel command line parameter "resume=xxx" should override the initramfs setting. But I don't know what is used when uswsusp is installed. Maybe it has its own configuration files.

It is important that the same swap partition is used to hibernate and resume. Without uswsusp,
- the resume partition is set by initramfs RESUME= or kernel command line resume=
- the hibernation partition is the one in first position in /proc/swaps (and I haven't found if and how it can be changed)
Again, I don't know what is used when uswsusp is installed.

rayandrews
Posts: 108
Joined: 2014-01-31 21:32
Has thanked: 3 times
Been thanked: 1 time

Re: hibernate not working after cloning system to sdb

#4 Post by rayandrews »

Thanks for the replies gentlemen. I'm a bit overloaded, this is not coming clear just yet, but a few things:

4 /proc 0 $ cat swaps
Filename Type Size Used Priority
/dev/sdb1 partition 5242876 0 -1

in fstab I do everything with labels:


tmpfs /tmp tmpfs size=1G 0 0
LABEL=b1--5-swap none swap sw 0 0
LABEL=b2--0-boot /boot ext4 defaults,commit=300 0 2
LABEL=b3--0-aWorking /aWorking ext4 defaults,commit=300 0 2
LABEL=b5-12-Debian1 / ext4 defaults,commit=300 0 1
...

... So if possible I'd like to make all references that way.

/etc/initramfs-tools/conf.d is:

RESUME=/dev/sdb1

... should I use LABEL? if so what's the exact syntax, one keystroke wrong and of course it won't work.

> "uswsusp" which was removed from bullseye, the current stable (reason: Dead upstream, unmaintained).

Nuts. Since 'systemctl hibernate' kills one of my monitors I don't want to end up stuck with no way to hibernate. But I'm still on 'stretch' for the moment. (Thunderbird in 'bullseye' won't accept an attachment from a local file !!! Who are these people?)

/etc/lilo.conf shows:

boot = /dev/sdb
append = "resume=/dev/sdb1"
...

If I were to use LABEL there, what's the syntax? Maybe:

append = "resume=LABEL=b1--5-swap"

... hafta get it right. The chain of three equal signs is intimidating.

> # update-initramfs -u -k all

... not working so far.

And what's the rules with the '/etc/initramfs-tools/conf.d' "resume=" line vs. the "resume=" line in lilo.conf? Do I need both? Or just one or just the other?

So many things to try!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: hibernate not working after cloning system to sdb

#5 Post by Head_on_a_Stick »

Third time's the charm...
rayandrews wrote: 2022-09-21 13:37 /etc/initramfs-tools/conf.d is:

RESUME=/dev/sdb1

... should I use LABEL? if so what's the exact syntax, one keystroke wrong and of course it won't work.

Code: Select all

RESUME=LABEL=$label
Replace $label with the actual label.
rayandrews wrote: 2022-09-21 13:37I'm still on 'stretch' for the moment
That went EOL at the end of June. You should upgrade.
rayandrews wrote: 2022-09-21 13:37 If I were to use LABEL there, what's the syntax? Maybe:

append = "resume=LABEL=b1--5-swap"
Yes, that's right. But I don't understand why you didn't just try it and see if it works. You don't need permission from us and it would be quicker than waiting for a reply.
rayandrews wrote: 2022-09-21 13:37 > # update-initramfs -u -k all

... not working so far.
Updating the initramfs will only have an effect if you edit /etc/initramfs-tools/conf.d/resume. Did you do that?
rayandrews wrote: 2022-09-21 13:37And what's the rules with the '/etc/initramfs-tools/conf.d' "resume=" line vs. the "resume=" line in lilo.conf? Do I need both? Or just one or just the other?
Just one or the other.
p.H wrote: 2022-09-21 08:56 - the hibernation partition is the one in first position in /proc/swaps (and I haven't found if and how it can be changed)
Does the priority of the swap change which one is used or is it just the order?
deadbang

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: hibernate not working after cloning system to sdb

#6 Post by p.H »

Head_on_a_Stick wrote: 2022-09-21 14:51 Does the priority of the swap change which one is used or is it just the order?
According to my tests, only the order matters, not the priority. It is a bit annoying when you have multiple swaps because you cannot guarantee which one is activated first. But maybe I missed something and there is a way to force the use of a given swap when going to hibernation.

rayandrews
Posts: 108
Joined: 2014-01-31 21:32
Has thanked: 3 times
Been thanked: 1 time

Re: hibernate not working after cloning system to sdb

#7 Post by rayandrews »

"That went EOL at the end of June. You should upgrade."

I tried upgrading to bullseye and a hundred things went wrong. I'm still hacking away at it tho, I reboot to it when I want more pain. Tbird won't even let me attach a local file FGS. xfce4 no longer permits zaphod mode -- I like my three monitors to be completely independent. Tbird won't call Firefox automatically if there's a link in an email ... and on and on. xfce has some help package that conflicts with some other help package. Maybe I should have gone thru Debian 10 first, do things in stages?

"But I don't understand why you didn't just try it and see if it works."

Cuz I'm sick of things not working. Best to get a competent opinion.

"Updating the initramfs will only have an effect if you edit /etc/initramfs-tools/conf.d/resume. Did you do that?"

Yes, as above:

"RESUME=/dev/sdb1"

"It is a bit annoying when you have multiple swaps because you cannot guarantee which one is activated first."

I wonder if that's it? I still have a swap partition on the original disk: /dev/sda1, I wonder if ... you know, come to that, I don't really care which partition is used. I'll try the LABEL syntax as above and let you guys know.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: hibernate not working after cloning system to sdb

#8 Post by Head_on_a_Stick »

rayandrews wrote: 2022-09-21 17:45 Maybe I should have gone thru Debian 10 first, do things in stages?
Yes, that is the recommended technique. There is a comprehensive upgrade guide published in the official Release Notes for every new Debian stable version. Read it and follow it to the letter.

So restore the backup you made before attempting the upgrade and try again, properly this time.
rayandrews wrote: 2022-09-21 17:45 "RESUME=/dev/sdb1"
That will only work if the correct swap partition has been assigned to /dev/sdb1, which is not guaranteed.
deadbang

rayandrews
Posts: 108
Joined: 2014-01-31 21:32
Has thanked: 3 times
Been thanked: 1 time

Re: hibernate not working after cloning system to sdb

#9 Post by rayandrews »

"That will only work if the correct swap partition has been assigned to /dev/sdb1, which is not guaranteed."

Ok, noted for next time I'm trying to make that work again.

"There is a comprehensive upgrade guide published in the official Release Notes for every new Debian stable version. Read it and follow it to the letter.

So restore the backup you made before attempting the upgrade and try again, properly this time."

I'm the most backed up dude on the planet. Each of my disks has three complete bootable versions and each disk can boot to the other one. I sorta knew that going direct to bullseye was taking a chance but nothing said not to so ...

Oh ... but will my xorg.conf be honored? I might one day get used to having all my monitors as one logical surface but for now I like 'em as independent. Sorta like having three separate computers, only the mouse moves between them.

rayandrews
Posts: 108
Joined: 2014-01-31 21:32
Has thanked: 3 times
Been thanked: 1 time

Re: hibernate not working after cloning system to sdb

#10 Post by rayandrews »

So, I don't think Debian is really interesting in this kind of feedback but here it is anyway:

Decided to do a virgin install of bullseye to my /dev/sdb while keeping /dev/sda devoted to Stretch. Got the installer onto a USB stick, and proceeding normally. The 'normal' install (sorry, I forget the exact name) ... I get as far as partitioning and although the disk (sdb) is already partitioned and formatted and working fine, it seemed to be impossible to just leave things as they were and install to the existing partitions, it kept complaining that a necessary step was not completed. Erasing the partitions (overwrite with zeros) didn't help. I couldn't figure out how to make it work so backed up and selected 'use whole disk'.

Proceeding, the installer couldn't establish a connection to the web. I aborted the install since I couldn't go forward anyway. Boot to sda and ... the installer had trashed the MBR of *both* disks and the machine was unbootable. I attached another backup disk, booted to that, mounted my Stretch partitions on sda, reran LILO, and that was fine, I could boot Stretch. But the installer also trashed the swap partition on sda -- I had to run mkswap. But no permanent damage was done.

Trying again, I disconnected sda to keep it from getting mauled again and proceeded with the 'advanced' installer, again selecting 'use entire disk', this time the installer took the extra steps to get the network up and running and the install completed quite smoothly.

Shouldn't the 'normal' install do whatever is needed to get the network running? the advanced install had no problem there, I didn't have to intervene it just got it done.

Why would the installer trash the MBR on a disk that was not involved?

Why couldn't I use existing, functioning ext4 partitions?

If one does have to abort, wouldn't it be better if no changes at all were made to anything? Why have a trashed system even when one had to abort? In other words, why not check that the network is available *before* trashing the MBR of of both disks and the partition table of sdb?

... just in case anyone is interested.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: hibernate not working after cloning system to sdb

#11 Post by Head_on_a_Stick »

rayandrews wrote: 2022-09-24 13:27 So, I don't think Debian is really interesting in this kind of feedback but here it is anyway:

[noise]

... just in case anyone is interested.
Nobody who has answered this thread has anything to do with Debian (AFAIK). Developers do sometimes visit here but I don't think any of them have noticed this thread. This is not the place to report bugs, any such "reports" posted here will almost certainly not be read by any developers.
deadbang

rayandrews
Posts: 108
Joined: 2014-01-31 21:32
Has thanked: 3 times
Been thanked: 1 time

Re: hibernate not working after cloning system to sdb

#12 Post by rayandrews »

"This is not the place to report bugs, any such "reports" posted here will almost certainly not be read by any developers."

That's my understanding. Where might I post it for a slightly better chance that it's read?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: hibernate not working after cloning system to sdb

#13 Post by Head_on_a_Stick »

https://www.debian.org/Bugs/Reporting

Are you familiar with search engines? They can save time. Two hours in this case :roll:
deadbang

rayandrews
Posts: 108
Joined: 2014-01-31 21:32
Has thanked: 3 times
Been thanked: 1 time

Re: hibernate not working after cloning system to sdb

#14 Post by rayandrews »

Two hours? Where did that go? Anyway the problem with search engines is that you get five million hits and 99% of them are not what you are looking for. Why not ask an expert instead! Cost you the minute it took you to write that, and maybe saved *me* two hours of googling around. I'm not lazy, I just prefer to take advantage of experts when they are available.

Edit:

Done, let's see if anyone takes notice. BTW, install is done, now just configuring my way, importing stuff I need ... all going smoothly. Bullseye seems faster.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: hibernate not working after cloning system to sdb

#15 Post by Head_on_a_Stick »

I'm no expert.
deadbang

rayandrews
Posts: 108
Joined: 2014-01-31 21:32
Has thanked: 3 times
Been thanked: 1 time

Re: hibernate not working after cloning system to sdb

#16 Post by rayandrews »

Not to yourself, but you're an expert to me :-) an expert is a guy who knows more than I do. BTW, I did get a response from one of the devs.

rayandrews
Posts: 108
Joined: 2014-01-31 21:32
Has thanked: 3 times
Been thanked: 1 time

Re: hibernate not working after cloning system to sdb

#17 Post by rayandrews »

Well, just to wrap this up, bullseye is now installed and hibernate works just fine so whatever was going on with stretch don't matter no mo. Thanks guys.

Post Reply