Re: btrfs swapfile - Not enough swap space for hibernation.

2020-12-14 Thread Sreyan Chakravarty
On Mon, Dec 14, 2020 at 2:57 PM Sreyan Chakravarty  wrote:
>
> On Sun, Dec 13, 2020 at 3:23 AM Chris Murphy  wrote:
> > You are in adventure land. So you're going on an adventure. If you
> > want it to just work, use a swap partition.
>
> To be clear my problem is not with swap files per se.
>
> It's a SELinux error. I was asking for help on how to configure
> SELinux so it does not stop systemd-logind from accessing the
> /var/swap directory.
>
> It has nothing to do with swaps.
>
> FYI, I have used swaps in BTRFS with successful hibernation, but it
> fell apart when I restored snapshots.
>
> So I am not sure why you say a separate helper service will be required.
>

Done.

Changing to the "etc_runtime_t" solved problems.

But I am not sure if the permissions are not too permissive or not.

I have opened a discussion for that in Github:
https://github.com/fedora-selinux/selinux-policy/issues/508

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: btrfs swapfile - Not enough swap space for hibernation.

2020-12-14 Thread Sreyan Chakravarty
On Sun, Dec 13, 2020 at 3:23 AM Chris Murphy  wrote:
> You are in adventure land. So you're going on an adventure. If you
> want it to just work, use a swap partition.

To be clear my problem is not with swap files per se.

It's a SELinux error. I was asking for help on how to configure
SELinux so it does not stop systemd-logind from accessing the
/var/swap directory.

It has nothing to do with swaps.

FYI, I have used swaps in BTRFS with successful hibernation, but it
fell apart when I restored snapshots.

So I am not sure why you say a separate helper service will be required.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: btrfs swapfile - Not enough swap space for hibernation.

2020-12-12 Thread Chris Murphy
On Fri, Dec 11, 2020 at 7:02 AM Sreyan Chakravarty  wrote:
>
> The only reason I can fathom is that systemd-logind is unable to
> access the directory /var/swap. IIRC, you were the one who suggested I
> mount in that directory.
>
> Not blaming you, but the question is what do I do now ?

Well, what I recommended is a swap partition to avoid all of these
limitations and questions. If you're going to use swap on Btrfs then
you're kinda in the same boat as the rest of us who are trying to
address each limit. This is why it's not the default and why I haven't
written up anything yet.

My expectation is that swapfiles on btrfs need a helper service of
some sort, in order for it to be generally usable.

> The bug that you have linked to is about /home not /var.

It's a reference for a similar problem, not an identical problem, with
a how to enable debug for logind.

> So where should I keep the swap for logind to access it without any problems ?

You are in adventure land. So you're going on an adventure. If you
want it to just work, use a swap partition.


> I don't think that is possible since the file was created with dd, not
> fallocate.

Why? I've mentioned fallocate several times, and also man 5 btrfs
several times, and there it recommends fallocate. Nowhere is dd
suggested. It may not work with dd depending on the dd exact dd
command used.


-- 
Chris Murphy
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: btrfs swapfile - Not enough swap space for hibernation.

2020-12-12 Thread Grumpey
On Sat, Dec 12, 2020 at 10:12 AM stan via users
 wrote:
>
> On Sat, 12 Dec 2020 16:22:29 +0530
> Sreyan Chakravarty  wrote:
>
> > Isn't chcon just temporary ? Won't the changes be lost after a reboot
> > ?
>
> Persistent across reboots here.  I think "temporary" in this case means
> that it has no context with restorecon.  I haven't tried it, but if you
> change it with chcon, and then run restorecon, it will probably revert
> to unconstrained_u.  There are probably tools that can create a rule
> for restorecon so that it becomes "permanent", I don't know them.

You have to use semanage to set the context.
I always reference the samba docs to remember:
https://fedoraproject.org/wiki/SELinux/samba

> ___
> users mailing list -- users@lists.fedoraproject.org
> To unsubscribe send an email to users-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org

-Joe
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: btrfs swapfile - Not enough swap space for hibernation.

2020-12-12 Thread stan via users
On Sat, 12 Dec 2020 16:22:29 +0530
Sreyan Chakravarty  wrote:

> Isn't chcon just temporary ? Won't the changes be lost after a reboot
> ?

Persistent across reboots here.  I think "temporary" in this case means
that it has no context with restorecon.  I haven't tried it, but if you
change it with chcon, and then run restorecon, it will probably revert
to unconstrained_u.  There are probably tools that can create a rule
for restorecon so that it becomes "permanent", I don't know them.
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: btrfs swapfile - Not enough swap space for hibernation.

2020-12-12 Thread stan via users
On Sat, 12 Dec 2020 13:09:24 +0530
Sreyan Chakravarty  wrote:

> I am a novice of I am very squeamish about applying commands without
> understanding them.

man chcon

> Is system_u a type? Is there any way to view all types for SELinux
> within Fedora?

Search on  selinux system_u  for information on what it is.

I'm sure there is, but I don't know it off the top of my head, maybe
someone else will.

> 
> How do I use the sesearch tool?

Don't know.  man sesearch?

> Is there any GUI for SELinux? Is apol still a thing?

Don't know.  Search on  apol  ?
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: btrfs swapfile - Not enough swap space for hibernation.

2020-12-12 Thread Sreyan Chakravarty
On Fri, Dec 11, 2020 at 9:05 PM stan via users
 wrote:
>
> On Fri, 11 Dec 2020 20:26:31 +0530
> Sreyan Chakravarty  wrote:
>
> > It's a SELinux error. Are there any SELinux experts here ?
>
> [snip]
>
> > My current SELinux label is :
> >
> > unconfined_u:object_r:swapfile_t:s0 /var/swap/fedora.swap
>
> Not an expert.
> There is no context for this, as it is your unique creation, so
> restorecon won't work. Use
> chcon -u system_u /var/swap/fedora.swap


Isn't chcon just temporary ? Won't the changes be lost after a reboot ?

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: btrfs swapfile - Not enough swap space for hibernation.

2020-12-11 Thread Sreyan Chakravarty
On Fri, 11 Dec 2020, 9:05 pm stan via users, 
wrote:

> On Fri, 11 Dec 2020 20:26:31 +0530
> Sreyan Chakravarty  wrote:
>
> > It's a SELinux error. Are there any SELinux experts here ?
>
> [snip]
>
> > My current SELinux label is :
> >
> > unconfined_u:object_r:swapfile_t:s0 /var/swap/fedora.swap
>
> Not an expert.
> There is no context for this, as it is your unique creation, so
> restorecon won't work. Use
> chcon -u system_u /var/swap/fedora.swap
>

I am a novice of I am very squeamish about applying commands without
understanding them.

Is system_u a type? Is there any way to view all types for SELinux within
Fedora?

How do I use the sesearch tool?

Is there any GUI for SELinux? Is apol still a thing?

>
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: btrfs swapfile - Not enough swap space for hibernation.

2020-12-11 Thread stan via users
On Fri, 11 Dec 2020 20:26:31 +0530
Sreyan Chakravarty  wrote:
 
> It's a SELinux error. Are there any SELinux experts here ?

[snip]

> My current SELinux label is :
> 
> unconfined_u:object_r:swapfile_t:s0 /var/swap/fedora.swap

Not an expert.
There is no context for this, as it is your unique creation, so
restorecon won't work. Use
chcon -u system_u /var/swap/fedora.swap
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: btrfs swapfile - Not enough swap space for hibernation.

2020-12-11 Thread Sreyan Chakravarty
On Fri, Dec 11, 2020 at 8:26 PM Sreyan Chakravarty  wrote:
>
> On Fri, Dec 11, 2020 at 12:32 AM Chris Murphy  wrote:
> >
> > If the journal doesn't have more information about why it says this,
> > and if the error is reported in the journal by systemd-logind, enable
> > debug logging for logind and reproduce and the try to figure out why
> > logind is complaining:
> >
> > https://github.com/systemd/systemd/issues/15354#issuecomment-610385478
> >
> > There is a possibility there isn't enough contiguous space in the
> > swapfile for the hibernation image. i.e. when you fallocate the
> > swapfile, it may be comprised of one or even dozens of separate
> > extents and if one of them isn't big enough for hibernation entry then
> > it'll always fail.
> >
> > As far as I'm aware there isn't a way to ask fallocate for a minimum
> > extent size. I've sometimes had to fallocate multiple files in a row
> > to get a swapfile with few fragments and then delete the rest.
> >
> > You can use filefrag -v to see the extent sizes. Those extents are
> > basically holes that swap code writes into. The swap code isn't
> > writing swap or hibernation images via Btrfs. It's just asking Btrfs
> > "what are the ranges and locations I can use" and Btrfs reports that
> > and then the swap and hibernation code use those areas directly.
> >
> >
> > > $ lsattr /var/swap/fedora.swap
> > > ---C /var/swap/fedora.swap
> >
> > > UUID=7d9dbe1b-dea6-4141-807b-026325123ad8 /var/swap
> > >btrfs   
> > > subvol=swap,rw,nodatacow,noattime,nosuid,x-systemd.device-timeout=0
> >
> > OK you're confused. You do not need both chattr +C on the file and the
> > nodatacow option. You only need one of those. You should realize that
> > the nodatacow option applies file system wide. It's non-obvious but
> > really only the VFS mount options can apply separately to bind mounts.
> > And on Fedora, since subvolumes are mounted to specific mounts points
> > and are thus effectively bind mounts behind the scenes, it seems like
> > you can apply some mount options to specific subvolumes as if they are
> > separate file systems. But that's not what's going on, they're just
> > bind mounts. So you can do atime for one mount point, noatime for
> > another. And same for ro or rw. Those are VFS options. The Btrfs mount
> > options apply file system wide, that includes nodatacow, compress, and
> > so on.
> >
> > Further problem now that you're using nodatacow is that you have a
> > bunch of nodatacow files that have been created in the meantime. And
> > those do *not* have chattr +C so you have no easy way to find them.
> > You'd have to parse 'btrfs inspect-internal dump-tree' for the
> > nodatacow flag.
> >
> > nodatacow files are also no compression and no data checksums. So I'm
> > betting this is not what you want.
> >
>
>
> It's a SELinux error. Are there any SELinux experts here ?
>
> I ran the command:
>
> $ sudo ausearch -m AVC,USER_AVC,SELINUX_ERR -ts recent
>
> and got the error:
>
> time->Fri Dec 11 20:19:20 2020
> type=AVC msg=audit(1607698160.378:357): avc:  denied  { search } for
> pid=1362 comm="systemd-logind" name="swap" dev="dm-0" ino=256
> scontext=system_u:system_r:systemd_logind_t:s0
> tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir permissive=0
>
>
> If I run the command:
>
> $ /sbin/restorecon /var/swap/fedora.swap
>
> I get the following error:
>
> time->Fri Dec 11 19:59:56 2020
> type=AVC msg=audit(1607696996.854:323): avc:  denied  { read } for
> pid=2523 comm="systemd-sleep" name="fedora.swap" dev="dm-0" ino=257
> scontext=system_u:system_r:init_t:s0
> tcontext=unconfined_u:object_r:var_t:s0 tclass=file permissive=0
>
>
> My current SELinux label is :
>
> unconfined_u:object_r:swapfile_t:s0 /var/swap/fedora.swap
>
> When I run "/sbin/restorecon", the label changes to :
>
> unconfined_u:object_r:var_t:s0 /var/swap/fedora.swap
>
> IIRC, the correct label is etc_runtime or something like that.
>
> Can any SELinux expert help me ?
>
> --
> Regards,
> Sreyan Chakravarty


I also got the following allow rules from "sesearch --allow | grep swap"

allow devices_unconfined_type device_node:blk_file { append
audit_access create execmod execute getattr ioctl link lock map
mounton open quotaon read relabelfrom relabelto rename setattr swapon
unlink write };
allow devices_unconfined_type device_node:chr_file { append
audit_access create execute execute_no_trans getattr ioctl link lock
map mounton open quotaon read relabelfrom relabelto rename setattr
swapon unlink write };
allow devices_unconfined_type device_node:file { append audit_access
create execute execute_no_trans getattr ioctl link lock map mounton
open quotaon read relabelfrom relabelto rename setattr swapon unlink
write };
allow devices_unconfined_type device_node:lnk_file { append
audit_access create execmod execute getattr ioctl link lock map
mounton open quotaon read relabelfrom relabelto rename setattr swapon
unlink write };
allow files_unconfined_type 

Re: btrfs swapfile - Not enough swap space for hibernation.

2020-12-11 Thread Sreyan Chakravarty
On Fri, Dec 11, 2020 at 12:32 AM Chris Murphy  wrote:
>
> If the journal doesn't have more information about why it says this,
> and if the error is reported in the journal by systemd-logind, enable
> debug logging for logind and reproduce and the try to figure out why
> logind is complaining:
>
> https://github.com/systemd/systemd/issues/15354#issuecomment-610385478
>
> There is a possibility there isn't enough contiguous space in the
> swapfile for the hibernation image. i.e. when you fallocate the
> swapfile, it may be comprised of one or even dozens of separate
> extents and if one of them isn't big enough for hibernation entry then
> it'll always fail.
>
> As far as I'm aware there isn't a way to ask fallocate for a minimum
> extent size. I've sometimes had to fallocate multiple files in a row
> to get a swapfile with few fragments and then delete the rest.
>
> You can use filefrag -v to see the extent sizes. Those extents are
> basically holes that swap code writes into. The swap code isn't
> writing swap or hibernation images via Btrfs. It's just asking Btrfs
> "what are the ranges and locations I can use" and Btrfs reports that
> and then the swap and hibernation code use those areas directly.
>
>
> > $ lsattr /var/swap/fedora.swap
> > ---C /var/swap/fedora.swap
>
> > UUID=7d9dbe1b-dea6-4141-807b-026325123ad8 /var/swap
> >btrfs   
> > subvol=swap,rw,nodatacow,noattime,nosuid,x-systemd.device-timeout=0
>
> OK you're confused. You do not need both chattr +C on the file and the
> nodatacow option. You only need one of those. You should realize that
> the nodatacow option applies file system wide. It's non-obvious but
> really only the VFS mount options can apply separately to bind mounts.
> And on Fedora, since subvolumes are mounted to specific mounts points
> and are thus effectively bind mounts behind the scenes, it seems like
> you can apply some mount options to specific subvolumes as if they are
> separate file systems. But that's not what's going on, they're just
> bind mounts. So you can do atime for one mount point, noatime for
> another. And same for ro or rw. Those are VFS options. The Btrfs mount
> options apply file system wide, that includes nodatacow, compress, and
> so on.
>
> Further problem now that you're using nodatacow is that you have a
> bunch of nodatacow files that have been created in the meantime. And
> those do *not* have chattr +C so you have no easy way to find them.
> You'd have to parse 'btrfs inspect-internal dump-tree' for the
> nodatacow flag.
>
> nodatacow files are also no compression and no data checksums. So I'm
> betting this is not what you want.
>


It's a SELinux error. Are there any SELinux experts here ?

I ran the command:

$ sudo ausearch -m AVC,USER_AVC,SELINUX_ERR -ts recent

and got the error:

time->Fri Dec 11 20:19:20 2020
type=AVC msg=audit(1607698160.378:357): avc:  denied  { search } for
pid=1362 comm="systemd-logind" name="swap" dev="dm-0" ino=256
scontext=system_u:system_r:systemd_logind_t:s0
tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir permissive=0


If I run the command:

$ /sbin/restorecon /var/swap/fedora.swap

I get the following error:

time->Fri Dec 11 19:59:56 2020
type=AVC msg=audit(1607696996.854:323): avc:  denied  { read } for
pid=2523 comm="systemd-sleep" name="fedora.swap" dev="dm-0" ino=257
scontext=system_u:system_r:init_t:s0
tcontext=unconfined_u:object_r:var_t:s0 tclass=file permissive=0


My current SELinux label is :

unconfined_u:object_r:swapfile_t:s0 /var/swap/fedora.swap

When I run "/sbin/restorecon", the label changes to :

unconfined_u:object_r:var_t:s0 /var/swap/fedora.swap

IIRC, the correct label is etc_runtime or something like that.

Can any SELinux expert help me ?

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: btrfs swapfile - Not enough swap space for hibernation.

2020-12-11 Thread Sreyan Chakravarty
On Fri, Dec 11, 2020 at 12:32 AM Chris Murphy  wrote:
>
> If the journal doesn't have more information about why it says this,
> and if the error is reported in the journal by systemd-logind, enable
> debug logging for logind and reproduce and the try to figure out why
> logind is complaining:
>
> https://github.com/systemd/systemd/issues/15354#issuecomment-610385478
>

Yes.

I have finally found out the reason why logind is complaining, thanks to you.

Dec 11 18:45:05 localhost.HPNotebook systemd-logind[1222]: Failed to
open swap file /var/swap/fedora.swap to determine on-disk offset:
Permission denied
Dec 11 18:45:05 localhost.HPNotebook systemd-logind[1222]: Sent
message type=method_return sender=n/a destination=:1.57 path=n/a
interface=n/a member=n/a cookie=130 reply_cookie=49 signature=s
error-name=n/a error-message=n/a
Dec 11 18:45:05 localhost.HPNotebook systemd-logind[1222]: Got message
type=method_call sender=:1.57 destination=org.freedesktop.login1
path=/org/freedesktop/login1 interface=org.freedesktop.login1.Manager
member=CanHybridSleep cookie=50 reply_cookie=0 signature=n/a
error-name=n/a error-message=n/a
Dec 11 18:45:05 localhost.HPNotebook systemd-logind[1222]: Sleep mode
"disk" is supported by the kernel.
Dec 11 18:45:05 localhost.HPNotebook systemd-logind[1222]: /dev/zram0:
ignoring zram swap


My permissions are as follows:

Permissions of /var/swap directory:
drwxr-xr-x. 1 root root   22 Dec 11 15:06 swap

Permissions of the actual swap file:
-rw---. 1 root root 9663676416 Dec 11 15:09 fedora.swap

Permissions of the swap subvolume:
drwxr-xr-x. 1 root root   22 Dec 11 15:06 swap

Mount options:
UUID=7d9dbe1b-dea6-4141-807b-026325123ad8 /var/swap
   btrfs   subvol=swap,rw,noattime,nosuid,x-systemd.device-timeout=0 0
0
/var/swap/fedora.swap none swap
defaults,x-systemd.requires-mounts-for=/var/swap 0 2

Output of /proc/swaps:
Filename Type Size Used Priority
/dev/zram0  partition 4020220 0 100
/var/swap/fedora.swap   file 9437180 0 -2


The only reason I can fathom is that systemd-logind is unable to
access the directory /var/swap. IIRC, you were the one who suggested I
mount in that directory.

Not blaming you, but the question is what do I do now ?

The bug that you have linked to is about /home not /var.

So where should I keep the swap for logind to access it without any problems ?

> There is a possibility there isn't enough contiguous space in the
> swapfile for the hibernation image. i.e. when you fallocate the
> swapfile, it may be comprised of one or even dozens of separate
> extents and if one of them isn't big enough for hibernation entry then
> it'll always fail.
>
> As far as I'm aware there isn't a way to ask fallocate for a minimum
> extent size. I've sometimes had to fallocate multiple files in a row
> to get a swapfile with few fragments and then delete the rest.
>

I don't think that is possible since the file was created with dd, not
fallocate.
Also the +C attribute was used.

> OK you're confused. You do not need both chattr +C on the file and the
> nodatacow option. You only need one of those. You should realize that
> the nodatacow option applies file system wide. It's non-obvious but
> really only the VFS mount options can apply separately to bind mounts.
> And on Fedora, since subvolumes are mounted to specific mounts points
> and are thus effectively bind mounts behind the scenes, it seems like
> you can apply some mount options to specific subvolumes as if they are
> separate file systems. But that's not what's going on, they're just
> bind mounts. So you can do atime for one mount point, noatime for
> another. And same for ro or rw. Those are VFS options. The Btrfs mount
> options apply file system wide, that includes nodatacow, compress, and
> so on.
>
> Further problem now that you're using nodatacow is that you have a
> bunch of nodatacow files that have been created in the meantime. And
> those do *not* have chattr +C so you have no easy way to find them.
> You'd have to parse 'btrfs inspect-internal dump-tree' for the
> nodatacow flag.
>
> nodatacow files are also no compression and no data checksums. So I'm
> betting this is not what you want.

Yes, I have removed the nodatacow option from my mount in fstab as it
clearly had no effect.
I am now using the +C attribute.

--
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation [solved]

2020-12-09 Thread Sreyan Chakravarty
On Wed, Dec 9, 2020 at 5:36 AM Chris Murphy  wrote:

> Small clarification. 'chattr +C' to set the C file attribute is
> 'nodatacow'. Since Btrfs is cow by default, it's generally OK to
> assume cow unless this attribute is set. But there's a rather uncommon
> and not highly recommended mount option too: nodatacow. This does not
> set C attribute everywhere, but all the files written while this mount
> option is used are nodatacow and will always be nodatacow.
>
> Note that nodatacow (how ever you enable it) also means nodatasum,
> i.e. no checksumming for data, and no compression.
>
> Also, btrfs metadata (the file system itself) is always cow. It can't
> be disabled.
>

What is the correct way to calculate the physical offset of the swap file
in another subvolume ?

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation [solved]

2020-12-09 Thread Sreyan Chakravarty
On Wed, Dec 9, 2020 at 5:31 AM Chris Murphy  wrote:

>
> I referred you to man 5 btrfs about a list of limitations of swapfiles
> on btrfs 10 days ago.
>
> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org/message/XF7YO27N2XPWGLPMPUN76VFT3RW2KFYS/
>
> It's important to know all the limitations. Most people will find them
> a non-issue. But...
>
> Like, where should the swapfile go? I think maybe /var/swap could be a
> nested subvolume, i.e. actually create the subvolume in /var/. That's
> pretty straightforward, and is compatible with rpm-ostree systems
> where root is read-only. The catch is if there's any kind of rollback
> of sysroot (on the subvolume typically named "root") because if
> /var/swap is a subvolume, then the snapshot of the "root" subvolume on
> / will stop at /var/swap. That's exactly what we want, to avoid
> snapshotting it. But then on rollback of "root", /var/swap is just an
> empty directory. So we need some intelligent handling up front, or at
> the back end to find that older/pre-rollback /var/swap and move that
> subvolume into the new position. Ick. Right?
>
> However, it might be better to have a "swap" subvolume along with
> "root" and "home" in the top-level of the file system. And add it to
> fstab or maybe we can create a native systemd mount unit. Importantly
> we have to have complete certainty that this mount happens before
> swapon, or it'll fail. So we can't have races either. Now both issues
> are fixed. It won't be snapshot if we snapshot "root". But if we
> rollback a "root" snapshot, then the same "swap" subvolume always
> mounts into the proper position at /var/swap with the same swapfile.
>
> But that automatic solution is also kinda hidden. So no matter what
> there's some kind of tradeoff. And that's the long answer for why it's
> not the default yet, and also not even documented how to do a
> post-install setup of swap. But it's on my todo.
>

Ok, I am out of ideas.

Have created the swap file in a different subvolume from my root.

I have also used btrfs_map_physical script to find the offset, but I am
still getting

"Not enough swap space for hibernation."

What else can I do?

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation [solved]

2020-12-09 Thread Sreyan Chakravarty
On Wed, Dec 9, 2020 at 5:31 AM Chris Murphy  wrote:

> I referred you to man 5 btrfs about a list of limitations of swapfiles
> on btrfs 10 days ago.
>
> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org/message/XF7YO27N2XPWGLPMPUN76VFT3RW2KFYS/


Apologies, I missed that.


> However, it might be better to have a "swap" subvolume along with
> "root" and "home" in the top-level of the file system. And add it to
> fstab or maybe we can create a native systemd mount unit. Importantly
> we have to have complete certainty that this mount happens before
> swapon, or it'll fail. So we can't have races either. Now both issues
> are fixed. It won't be snapshot if we snapshot "root". But if we
> rollback a "root" snapshot, then the same "swap" subvolume always
> mounts into the proper position at /var/swap with the same swapfile.
>
>
Ok, how can I guarantee that the swap subvolume will be mounted before
swapon is executed ?

Is swapon executed after all mounts in /etc/fstab by design ?

Is there something else I can do to guarantee this?

Or is there no way to guarantee this now ?


Yes you were right. I have just restored my snapshot and now swap is
malfunctioning.

I guess that's because the physical offset of the file is different.

But that automatic solution is also kinda hidden. So no matter what
> there's some kind of tradeoff. And that's the long answer for why it's
> not the default yet, and also not even documented how to do a
> post-install setup of swap. But it's on my todo.
>

 Lets hope you get around to it soon.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation [solved]

2020-12-09 Thread Sreyan Chakravarty
On Tue, Dec 8, 2020 at 9:30 PM Qiyu Yan  wrote:

> Since swapfile should always be NOCOW, while doing snapshot the subvol
> containing the file will definitely make it COW. You may want to put
> swapfile to a separate subvol.
>

Yes, you are right.

I just snapshotted my root, and restored the snapshot. Now swap is
malfunctioning.

swapon is unable to mount the swap.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation [solved]

2020-12-08 Thread Chris Murphy
On Tue, Dec 8, 2020 at 11:14 AM Garry T. Williams  wrote:
>
> On Tuesday, December 8, 2020 1:02:19 PM EST Sreyan Chakravarty wrote:
> > How would you verify if a file is CoW in BTRFS?
>
> It's not btrfs-specific, but use the lsattr(1) command.  E.g.,
>
> garry@gtw$ lsattr .local/share/akonadi/db_data/ibdata1
> ---C .local/share/akonadi/db_data/ibdata1
> garry@gtw$


Small clarification. 'chattr +C' to set the C file attribute is
'nodatacow'. Since Btrfs is cow by default, it's generally OK to
assume cow unless this attribute is set. But there's a rather uncommon
and not highly recommended mount option too: nodatacow. This does not
set C attribute everywhere, but all the files written while this mount
option is used are nodatacow and will always be nodatacow.

Note that nodatacow (how ever you enable it) also means nodatasum,
i.e. no checksumming for data, and no compression.

Also, btrfs metadata (the file system itself) is always cow. It can't
be disabled.


-- 
Chris Murphy
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation [solved]

2020-12-08 Thread Chris Murphy
On Tue, Dec 8, 2020 at 5:53 AM Sreyan Chakravarty  wrote:
>
> On Mon, Dec 7, 2020 at 3:43 PM Chris Murphy  wrote:
>>
>>
>> This isn't a great location for a swapfile on btrfs because you can't ever 
>> snapshot /.
>
>
> You never said why it was not possible to snapshot /.
>
> Why is that ?

I referred you to man 5 btrfs about a list of limitations of swapfiles
on btrfs 10 days ago.
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org/message/XF7YO27N2XPWGLPMPUN76VFT3RW2KFYS/

It's important to know all the limitations. Most people will find them
a non-issue. But...

Like, where should the swapfile go? I think maybe /var/swap could be a
nested subvolume, i.e. actually create the subvolume in /var/. That's
pretty straightforward, and is compatible with rpm-ostree systems
where root is read-only. The catch is if there's any kind of rollback
of sysroot (on the subvolume typically named "root") because if
/var/swap is a subvolume, then the snapshot of the "root" subvolume on
/ will stop at /var/swap. That's exactly what we want, to avoid
snapshotting it. But then on rollback of "root", /var/swap is just an
empty directory. So we need some intelligent handling up front, or at
the back end to find that older/pre-rollback /var/swap and move that
subvolume into the new position. Ick. Right?

However, it might be better to have a "swap" subvolume along with
"root" and "home" in the top-level of the file system. And add it to
fstab or maybe we can create a native systemd mount unit. Importantly
we have to have complete certainty that this mount happens before
swapon, or it'll fail. So we can't have races either. Now both issues
are fixed. It won't be snapshot if we snapshot "root". But if we
rollback a "root" snapshot, then the same "swap" subvolume always
mounts into the proper position at /var/swap with the same swapfile.

But that automatic solution is also kinda hidden. So no matter what
there's some kind of tradeoff. And that's the long answer for why it's
not the default yet, and also not even documented how to do a
post-install setup of swap. But it's on my todo.


-- 
Chris Murphy
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation [solved]

2020-12-08 Thread Garry T. Williams
On Tuesday, December 8, 2020 1:02:19 PM EST Sreyan Chakravarty wrote:
> How would you verify if a file is CoW in BTRFS?

It's not btrfs-specific, but use the lsattr(1) command.  E.g.,

garry@gtw$ lsattr .local/share/akonadi/db_data/ibdata1 
---C .local/share/akonadi/db_data/ibdata1
garry@gtw$

-- 
Garry T. Williams


___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation [solved]

2020-12-08 Thread Sreyan Chakravarty
On Tue, 8 Dec 2020, 9:30 pm Qiyu Yan,  wrote:

> Since swapfile should always be NOCOW, while doing snapshot the subvol
> containing the file will definitely make it COW. You may want to put
> swapfile to a separate subvol.
>

How would you verify if a file is CoW in BTRFS?

>
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation [solved]

2020-12-08 Thread Qiyu Yan
Sreyan Chakravarty  于2020年12月8日周二 下午8:53写道:
>
> On Mon, Dec 7, 2020 at 3:43 PM Chris Murphy  wrote:
>>
>>
>> This isn't a great location for a swapfile on btrfs because you can't ever 
>> snapshot /.
>
>
> You never said why it was not possible to snapshot /.
Since swapfile should always be NOCOW, while doing snapshot the subvol
containing the file will definitely make it COW. You may want to put
swapfile to a separate subvol.
>
> Why is that ?
>
> --
> Regards,
> Sreyan Chakravarty
> ___
> users mailing list -- users@lists.fedoraproject.org
> To unsubscribe send an email to users-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation [solved]

2020-12-08 Thread Sreyan Chakravarty
On Mon, Dec 7, 2020 at 3:43 PM Chris Murphy  wrote:

>
> This isn't a great location for a swapfile on btrfs because you can't ever
> snapshot /.
>

You never said why it was not possible to snapshot /.

Why is that ?

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation [SOLVED]

2020-12-07 Thread Sreyan Chakravarty
On Mon, Dec 7, 2020 at 3:43 PM Chris Murphy  wrote:

>
> The more predictable arrangement is a swap partition.
>

I did it.

The problem was that btrfs_map_physical script will actually output the
offset in bytes.

I had to divide by my block size 4096.

So the correct resume_offset is =  14745509888 / 4096

After that hibernation worked like a charm.
Got help from this thread on reddit:
https://www.reddit.com/r/archlinux/comments/e623w8/hibernation_into_swapfile_on_btrfs_is_borked/f9nnzpl/?utm_source=reddit_medium=web2x=3

But now I have broken my system after a dnf update.
Man, Linux does not give you a break.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-07 Thread Sreyan Chakravarty
On Mon, Dec 7, 2020 at 3:43 PM Chris Murphy  wrote:

> What happens if you manually swapon? What does cat /proc/cmdline show?
>
>
Output of manual swapon:

$ swapon -v -f /fedora.swap
swapon: /fedora.swap: found signature [pagesize=4096, signature=swap]
swapon: /fedora.swap: pagesize=4096, swapsize=10737418240,
devsize=10737418240
swapon /fedora.swap

Output of 'cat /proc/cmdline':

$ cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-5.8.15-301.fc33.x86_64
root=UUID=7d9dbe1b-dea6-4141-807b-026325123ad8 ro rootflags=subvol=root
rd.luks.uuid=luks-1136a62b-955b-4391-b9a4-b48ab11a862d
resume=/dev/disk/by-uuid/7d9dbe1b-dea6-4141-807b-026325123ad8
resume_offset=14745509888


This isn't a great location for a swapfile on btrfs because you can't ever
> snapshot /. And it takes extra steps to make hibernation possible.
>

Why can't I snapshot / ?


> The more predictable arrangement is a swap partition.
>
>
How can I have an encrypted swap partition ?

I need Full Disk Encryption, even for my swap, that's why I went with one
large encrypted partition with root,home and swap all in one.


-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-07 Thread Chris Murphy
On Mon, Dec 7, 2020, 1:48 AM Sreyan Chakravarty  wrote:

> On Mon, Dec 7, 2020 at 1:58 PM Samuel Sieb  wrote:
>


>> >
>> > [  269.976652] PM: Cannot find swap device, try swapon -a
>>
>> This is the important line.
>>
>>
> What could be causing this ? I am not even getting error messages.
>
>
>> Do you have the swap file in the fstab?
>>
>
> Yes.
>
> This is my /etc/fstab:
>
> UUID=7d9dbe1b-dea6-4141-807b-026325123ad8 /   btrfs
> subvol=root,x-systemd.device-timeout=0 0 0
> UUID=0e9cf655-eaef-44d6-8b5d-3f84e7449c0e /boot   ext4
>  defaults1 2
> UUID=CACC-9508  /boot/efi   vfat
>  umask=0077,shortname=winnt 0 2
> /fedora.swap none swap defaults 0 2
>


What happens if you manually swapon? What does cat /proc/cmdline show?

This isn't a great location for a swapfile on btrfs because you can't ever
snapshot /. And it takes extra steps to make hibernation possible.

The more predictable arrangement is a swap partition.

--
Chris Murphy
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-07 Thread Sreyan Chakravarty
On Mon, Dec 7, 2020 at 1:58 PM Samuel Sieb  wrote:

> On 12/7/20 12:13 AM, Sreyan Chakravarty wrote:
> > Hibernation is not successful.
> >
> > This is what I get from 'dmesg':
> >
> > [  269.976652] PM: Cannot find swap device, try swapon -a
>
> This is the important line.
>
>
What could be causing this ? I am not even getting error messages.


> Do you have the swap file in the fstab?
>

Yes.

This is my /etc/fstab:

UUID=7d9dbe1b-dea6-4141-807b-026325123ad8 /   btrfs
subvol=root,x-systemd.device-timeout=0 0 0
UUID=0e9cf655-eaef-44d6-8b5d-3f84e7449c0e /boot   ext4
 defaults1 2
UUID=CACC-9508  /boot/efi   vfat
 umask=0077,shortname=winnt 0 2
/fedora.swap none swap defaults 0 2



> Is there any more info in the journal?  The dmesg shows very little of
> what is going on.
>
>
I get the same thing that I have already shared, along with a few extra
lines from 'journalctl' :

systemd-sleep[3966]: Failed to suspend system. System resumed again: No
such device
systemd[1]: systemd-hibernate.service: Main process exited, code=exited,
status=1/FAILURE
systemd[1]: systemd-hibernate.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Hibernate.
systemd[1]: Dependency failed for Hibernate.
systemd[1]: hibernate.target: Job hibernate.target/start failed with result
'dependency'.
systemd-logind[1248]: Operation 'sleep' finished.
systemd[1]: Stopped target Sleep.



> I remember another very long thread helping you get a hibernation swap
> file working quite a while back.  Can you go over that again and see if
> there's something you've missed here?
>

That was for configuring hibernate on ext4 with LVM.

I did go through that. The only thing I missed was putting the correct
offset in the kernel cmd line. Which I have done now.

This problem is more serious as the hibernate job fails.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-07 Thread Samuel Sieb

On 12/7/20 12:13 AM, Sreyan Chakravarty wrote:

Hibernation is not successful.

This is what I get from 'dmesg':

[  269.976652] PM: Cannot find swap device, try swapon -a


This is the important line.


What does 'Cannot get swap writer' mean ?


It means that the previous thing failed.


This is my output from 'swapon':

$ swapon
NAME         TYPE      SIZE USED PRIO
/fedora.swap file       10G   0B   -2
/dev/zram0   partition 3.8G  27M  100


Do you have the swap file in the fstab?

Is there any more info in the journal?  The dmesg shows very little of 
what is going on.


I remember another very long thread helping you get a hibernation swap 
file working quite a while back.  Can you go over that again and see if 
there's something you've missed here?

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-07 Thread Sreyan Chakravarty
On Mon, Dec 7, 2020 at 11:55 AM Samuel Sieb  wrote:

>
> So this is why you aren't noticing any improvement from zram.  You
> aren't using any swap at all at this point.  But more importantly, this
> is why hibernation isn't working.  You don't have any disk swap.  What
> happened to your swap file?
>

Alright, I am now out of ideas.

I have tried the btrfs_map_physical.c script to get the physical offset.

I now even have the 'Hibernate' option in the 'KDE Leave' menu.

BUT

When I do a hibernate either via the KDE menu or 'systemctl hibernate', the
screen goes blank for 2 seconds and comes back.

Hibernation is not successful.

This is what I get from 'dmesg':

[  269.976652] PM: Cannot find swap device, try swapon -a
[  269.976655] PM: Cannot get swap writer
[  270.069993] PM: hibernation: Basic memory bitmaps freed
[  270.069997] OOM killer enabled.
[  270.06] Restarting tasks ... done.
[  270.076223] Bluetooth: hci0: RTL: examining hci_ver=06 hci_rev=000b
lmp_ver=06 lmp_subver=8723
[  270.076867] Bluetooth: hci0: RTL: rom_version status=0 version=1
[  270.076870] Bluetooth: hci0: RTL: loading rtl_bt/rtl8723b_fw.bin
[  270.076880] Bluetooth: hci0: RTL: loading rtl_bt/rtl8723b_config.bin
[  270.076945] bluetooth hci0: Direct firmware load for
rtl_bt/rtl8723b_config.bin failed with error -2
[  270.076951] Bluetooth: hci0: RTL: cfg_sz -2, total sz 22496
[  270.097216] PM: hibernation: hibernation exit

What does 'Cannot get swap writer' mean ?

This is my output from 'swapon':

$ swapon
NAME TYPE  SIZE USED PRIO
/fedora.swap file   10G   0B   -2
/dev/zram0   partition 3.8G  27M  100


Patrick said BTRFS have been set up by people here, but I could not find
any relevant threads that showed that.

So what is going wrong ?

Is this a bug ?

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-06 Thread Sreyan Chakravarty
On Mon, Dec 7, 2020 at 11:55 AM Samuel Sieb  wrote:

>
> So this is why you aren't noticing any improvement from zram.  You
> aren't using any swap at all at this point.  But more importantly, this
> is why hibernation isn't working.  You don't have any disk swap.  What
> happened to your swap file?
>

When I added my swap file and did:
 systemctl hibernate

I got:

     Not enough swap space for hibernation.

I used the filefrag tool for calculating the offset.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-06 Thread Samuel Sieb

On 12/6/20 10:17 PM, Sreyan Chakravarty wrote:
On Mon, Dec 7, 2020 at 1:31 AM Chris Murphy > wrote:


What do you get for 'swapon' ?


# swapon
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition 3.8G   0B  100


So this is why you aren't noticing any improvement from zram.  You 
aren't using any swap at all at this point.  But more importantly, this 
is why hibernation isn't working.  You don't have any disk swap.  What 
happened to your swap file?

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-06 Thread Sreyan Chakravarty
On Mon, Dec 7, 2020 at 2:04 AM Chris Murphy  wrote:

>
> I think a higher priority is supporting encrypted authenticated
> hibernation images. And arguably it's needed for swap as well, because
> there are all kinds of private user data that can be evicted to swap.
> It's another advantage of swap on zram, in that since it's volatile,
> we don't have to worry about it as much when it comes to leaking user
> data. It's not the same as being encrypted, of course, putting the
> system in S3 means this private data could still be pilfered if the
> attacker has physical access. But at least it's not persistent.
>
>
Why is encrypted and signed hibernation images a bigger priority ? Isn't
that achieved with full disk encrypted systems ?

It is a good idea to setup disk based swap with a random key on each
> boot. This means you don't have to enter a passphrase. But it also
> means it can't be used for a hibernation image.
>
>
How would you do this even if I was not using hibernation ? Sounds pretty
cool.


> I think a key pre-requisite is working authenticated and signed
> hibernation images. Until we can bring back hibernation support for
> systems with UEFI Secure Boot, the most common configuration out of
> the box, we're kinda stuck not being able to do much of anything with
> hibernation.
>
>
It's sad that Linux isn't able to do hibernation with secure boot.


>
-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-06 Thread Sreyan Chakravarty
On Mon, Dec 7, 2020 at 1:31 AM Chris Murphy  wrote:

> What do you get for 'swapon' ?
>

# swapon
NAME   TYPE  SIZE USED PRIO
/dev/zram0 partition 3.8G   0B  100


-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-06 Thread Sreyan Chakravarty
On Sun, Dec 6, 2020 at 11:42 PM Qiyu Yan  wrote:

> https://chrisdown.name/2018/01/02/in-defence-of-swap.html
>
> A good article answering why we need swap.
>
>>
>>
Yes I have read this. It is indeed a good article.


>
>>> Or another workaround, swapon the hibernation only file and swapoff all
> others before hibernation happens. This could be able to do with some
> tricks with systemd.
>

How do I do this ? I am interested in learning more about this. I can
obviously write a BASH script but I believe the more correct option would
be via systemd.


>
>>
-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-06 Thread Chris Murphy
On Sun, Dec 6, 2020 at 11:12 AM Qiyu Yan  wrote:
>
> IDK, maybe just because no one is working on this. But changing PRIO may do 
> similar thing, page swap to zram and hibernat to disk.

The kernel knows not to write a hibernation image to a swap device
backed by zram. In fact it knows it needs contiguous space to write
the hibernation image into, ergo a fragmented swap partition can still
result in hibernation entry failure.

But yeah the bottom line is, resources.

I think a higher priority is supporting encrypted authenticated
hibernation images. And arguably it's needed for swap as well, because
there are all kinds of private user data that can be evicted to swap.
It's another advantage of swap on zram, in that since it's volatile,
we don't have to worry about it as much when it comes to leaking user
data. It's not the same as being encrypted, of course, putting the
system in S3 means this private data could still be pilfered if the
attacker has physical access. But at least it's not persistent.

It is a good idea to setup disk based swap with a random key on each
boot. This means you don't have to enter a passphrase. But it also
means it can't be used for a hibernation image.

The passwordless boot with encrypted authenticated hibernation image
also requires a TPM chip, or maybe certain yubikeys could be used.
It's a lot of work.

>
> Or another workaround, swapon the hibernation only file and swapoff all 
> others before hibernation happens. This could be able to do with some tricks 
> with systemd.

Yep. This has also been discussed. There's some concern it could
result in races when the system is under memory pressure and
hibernation is called. It might take some upstream kernel work and
also a lot of testing to prove it's reliable. And the problem there
already is, hibernation entry isn't reliable for myriad reasons.
Adding this funtionality may just make it more complicated without
improving reliability.

I think a key pre-requisite is working authenticated and signed
hibernation images. Until we can bring back hibernation support for
systems with UEFI Secure Boot, the most common configuration out of
the box, we're kinda stuck not being able to do much of anything with
hibernation.

There is work happening in the VM world with hibernation,
interestingly enough. And some of that work has a good chance of
making it more reliable, and helping once we come back full circle on
baremetal. They too are concerned about having signed and
authenticated hibernation images, even when not in a Secure Boot
context, because of the potential for secrecy/privacy leaks in the
hibernation image, and ensuring it hasn't been tampered with while in
transit.



-- 
Chris Murphy
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-06 Thread Chris Murphy
On Sun, Dec 6, 2020 at 12:35 AM Sreyan Chakravarty  wrote:
>
> On Sat, Dec 5, 2020 at 3:37 AM Ed Greshko  wrote:
>>
>> Well, which "echo" command fails?
>>
>> Do these exist?
>>
>> /sys/power/disk
>> /sys/power/state
>
>
>  $ ll /sys/power/disk
>  -rw-r--r--. 1 root root 4096 Dec  6 12:53 /sys/power/disk
>  $ ll /sys/power/state
> -rw-r--r--. 1 root root 4096 Dec  6 12:53 /sys/power/state
>
> echo reboot > /sys/power/disk (This succeeds)
>
> echo disk > /sys/power/state (Fails)
>
> The above fails with :
> -bash: echo: write error: No such device
>

What do you get for 'swapon' ?



-- 
Chris Murphy
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-06 Thread Qiyu Yan
Sreyan Chakravarty  于 2020年12月6日周日 下午6:23写道:

> On Sun, Dec 6, 2020 at 1:29 PM Samuel Sieb  wrote:
>
>> Are you actually using the swap?  If you aren't, or only very little,
>> then you aren't going to notice anything.  It will only use RAM if
>> you're swapping out pages.
>>
>>
> Well I do have a lot of open tabs in chrome and firefox for testing.
> I haven't noticed any difference, but that's just my perception,
> I won't know anything unless a real benchmark is run.
>

https://chrisdown.name/2018/01/02/in-defence-of-swap.html

A good article answering why we need swap.

>
> I have definitely noticed a drastic improvement on my laptop after
>> setting up zram and as I mentioned, I'm using a *lot* more than the
>> default.  Do check out the very large threads from -devel a while back
>> on this topic.
>>
>
> Ok after reading up on this topic I have a little more knowledge and
> context and have some questions.
>
> Please forgive my ignorance, I do not wish to be glib, I understand that
> these are extremely complex topics.
>
> Now my questions are as follows:
>
> 1) Why not have separate partitions for swap and hibernate ?
>
> Seems the number one problem when it comes to using hibernation is that
> there is no kernel support for dedicating where the hibernation will be
> done dedicatedly.
> It uses the swap and if it does not have enough contiguous memory then it
> will fail.
> An obvious fix would be to have a dedicated hibernation file/partition and
> use zram for swap.
>
> It is currently possible to have both partition/file and zram for swap but
> no way to mark the partition/file for just hibernation exclusively, AFAIK.
>
> This separation seems like an essential feature then why has more work not
> gone into this ?
>
> I only ask since Windows provides a dedicated Hibernate file called
> hiberfil.sys.
>
IDK, maybe just because no one is working on this. But changing PRIO may do
similar thing, page swap to zram and hibernat to disk.

Or another workaround, swapon the hibernation only file and swapoff all
others before hibernation happens. This could be able to do with some
tricks with systemd.

>
> 2)  Can we have on-demand hibernate files ?
>
> Why not just create a hibernate file each time we hibernate ?
>
It's hard to do so, resuming from swap file needs to be done before
mounting any filesystem, thus systemd in initramfs needs to know where the
file is, usually the information is passed to initramfs via kernel cmdline.
While it is possible to create a new swap file on hibernation and rewrite
kernel cmdline, but IIRC nobody implements that.

So you have to stick to a swapfile and hardcode its block path and offset
on kernel cmdline.

>
> Thanks for all your help.
>
> --
> Regards,
> Sreyan Chakravarty
> ___
> users mailing list -- users@lists.fedoraproject.org
> To unsubscribe send an email to users-le...@lists.fedoraproject.org
> Fedora Code of Conduct:
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
>
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-06 Thread Sreyan Chakravarty
On Sun, Dec 6, 2020 at 1:29 PM Samuel Sieb  wrote:

> Are you actually using the swap?  If you aren't, or only very little,
> then you aren't going to notice anything.  It will only use RAM if
> you're swapping out pages.
>
>
Well I do have a lot of open tabs in chrome and firefox for testing.
I haven't noticed any difference, but that's just my perception,
I won't know anything unless a real benchmark is run.

I have definitely noticed a drastic improvement on my laptop after
> setting up zram and as I mentioned, I'm using a *lot* more than the
> default.  Do check out the very large threads from -devel a while back
> on this topic.
>

Ok after reading up on this topic I have a little more knowledge and
context and have some questions.

Please forgive my ignorance, I do not wish to be glib, I understand that
these are extremely complex topics.

Now my questions are as follows:

1) Why not have separate partitions for swap and hibernate ?

Seems the number one problem when it comes to using hibernation is that
there is no kernel support for dedicating where the hibernation will be
done dedicatedly.
It uses the swap and if it does not have enough contiguous memory then it
will fail.
An obvious fix would be to have a dedicated hibernation file/partition and
use zram for swap.

It is currently possible to have both partition/file and zram for swap but
no way to mark the partition/file for just hibernation exclusively, AFAIK.

This separation seems like an essential feature then why has more work not
gone into this ?

I only ask since Windows provides a dedicated Hibernate file called
hiberfil.sys.

2)  Can we have on-demand hibernate files ?

Why not just create a hibernate file each time we hibernate ?

Thanks for all your help.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-06 Thread Sreyan Chakravarty
On Sun, 6 Dec 2020, 2:00 pm Andras Simon,  wrote:

>
> Don't think of it as swap. It's in-place compression of memory.
>

Thank you. Sir I rarely get such short concise and eloquent answers.

I really wish naming was easier in computer science.

In place memory compression is exactly what the zram swap does.

Again thank you.

>
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-06 Thread Andras Simon
2020-12-06 8:51 UTC+01:00, Sreyan Chakravarty :
> On Sun, Dec 6, 2020 at 10:33 AM Tim via users
> 
> wrote:
>
>> On Sat, 2020-12-05 at 17:45 -0700, Chris Murphy wrote:
>> > There definitely is no free lunch with swap-on-zram, but it helps
>> > quite a lot for most workloads.
>>
>> I'm curious how dedicating some of your RAM for swap, therefore having
>> less RAM, is more beneficial than just using your RAM as RAM.
>>
>
> Exactly my point.

Don't think of it as swap. It's in-place compression of memory.
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-06 Thread Samuel Sieb

On 12/5/20 11:56 PM, Sreyan Chakravarty wrote:
On Sun, Dec 6, 2020 at 11:13 AM Chris Murphy > wrote:


https://fedoraproject.org/wiki/Changes/SwapOnZRAM#Detailed_Description


Let me know if you have questions not answered there. A key point is
this is not a preallocation. Creating a 4G /dev/zram0 device doesn't
reserve or consume 4G. It's dynamically allocated, and even once full
it's not using that amount of memory, instead actual memory consumed
is related to the compression ratio achieved. Typical is 1 to 1.5G
memory consumption to swap out 4G worth of pages, for a net gain of
2.5G - 3G memory for use by other programs. And without having to
write to disk at all.

Not perfect, and not magic. It does have some tradeoffs.


I have a follow up question.

Why not just disable swap entirely, rather than keeping a swap store in 
memory ?


Then when you run out of memory, your system will choke until the OOM 
killer kills some process.

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-05 Thread Samuel Sieb

On 12/5/20 11:49 PM, Sreyan Chakravarty wrote:
On Sat, Dec 5, 2020 at 12:18 PM Samuel Sieb > wrote:



Because there isn't one that can do everything.  With both, you get
fast
swap, but also the ability to hibernate.


To be honest, I have not seen any performance or responsiveness 
improvement with ZRAM. Hence I am very suspicious when it comes to 
blocking RAM for swap.


Are you actually using the swap?  If you aren't, or only very little, 
then you aren't going to notice anything.  It will only use RAM if 
you're swapping out pages.


I have definitely noticed a drastic improvement on my laptop after 
setting up zram and as I mentioned, I'm using a *lot* more than the 
default.  Do check out the very large threads from -devel a while back 
on this topic.

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-05 Thread Sreyan Chakravarty
On Sun, Dec 6, 2020 at 11:13 AM Chris Murphy 
wrote:

> https://fedoraproject.org/wiki/Changes/SwapOnZRAM#Detailed_Description
>
> Let me know if you have questions not answered there. A key point is
> this is not a preallocation. Creating a 4G /dev/zram0 device doesn't
> reserve or consume 4G. It's dynamically allocated, and even once full
> it's not using that amount of memory, instead actual memory consumed
> is related to the compression ratio achieved. Typical is 1 to 1.5G
> memory consumption to swap out 4G worth of pages, for a net gain of
> 2.5G - 3G memory for use by other programs. And without having to
> write to disk at all.
>
> Not perfect, and not magic. It does have some tradeoffs.
>

I have a follow up question.

Why not just disable swap entirely, rather than keeping a swap store in
memory ?
-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-05 Thread Samuel Sieb

On 12/5/20 11:45 PM, Sreyan Chakravarty wrote:
On Sat, Dec 5, 2020 at 3:47 AM Samuel Sieb > wrote:
But what you are saying is that if I have 8 GB of RAM and let's say 3 GB 
is actually full of zram swap pages, then, by that logic, applications 
will have 3GB less RAM to operate than if the kernel had written out to 
disk. I mean the RAM is still BEING USED.


Sure, but by that point you've also paged out 9GB of data.


Am I correct ? Do you see why this may not be a good idea ?


As Chris keeps saying, there is a tradeoff.  But it's a very useful 
tradeoff.  You use a little bit of RAM to store a lot more pages of 
swap.  It's very fast to swap out and very fast to swap back in.  You 
really need to do some research and understand how it works before you 
reject it so thoroughly.  It was made the default for Fedora (at least 
for workstation and maybe the other desktop spins), so you might want to 
consider that there are some very valid reasons to use it.

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-05 Thread Sreyan Chakravarty
On Sun, Dec 6, 2020 at 10:33 AM Tim via users 
wrote:

> On Sat, 2020-12-05 at 17:45 -0700, Chris Murphy wrote:
> > There definitely is no free lunch with swap-on-zram, but it helps
> > quite a lot for most workloads.
>
> I'm curious how dedicating some of your RAM for swap, therefore having
> less RAM, is more beneficial than just using your RAM as RAM.
>

Exactly my point.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-05 Thread Sreyan Chakravarty
On Sat, Dec 5, 2020 at 12:18 PM Samuel Sieb  wrote:

>
> Because there isn't one that can do everything.  With both, you get fast
> swap, but also the ability to hibernate.
>

To be honest, I have not seen any performance or responsiveness
improvement with ZRAM. Hence I am very suspicious when it comes to blocking
RAM for swap.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-05 Thread Sreyan Chakravarty
On Sat, Dec 5, 2020 at 11:44 AM Jon LaBadie  wrote:

> Because your needs are not my needs.
>
> I have no use for hibernation.
>
> I may have a need for fast, ram-based swap.
>

I understand my workflows are not your workflows.

But my question is how can you conserve RAM by using more RAM ?

That makes no sense, you are just blocking RAM that could be used by
new/current applications.

Where am I going wrong ?

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-05 Thread Sreyan Chakravarty
On Sat, Dec 5, 2020 at 3:47 AM Samuel Sieb  wrote:

> It's more like having a TARDIS in your room if you understand that
> reference.  It takes up some space, but it's bigger on the inside. :-)
>

Sorry not a Doctor Who fan. It's way too convoluted a plot for me. :-)


> Although in this case, it does take up more space the more you stuff in
> it, but it holds more than the space it takes up.
>

Exactly my point. It's like saying that you are conserving the water in
your house by using more water.

Am I the only one who thinks that idea is crazy ?

The RAM pages that need to get paged out get compressed and kept in
> memory.  I suppose you could consider that my system with 12GB of RAM
> and 12GB of zram configured could become an 8GB system with 12GB of used
> swap.  20GB of virtual memory but still not using the disk.
>

Why page out to RAM ? You are still blocking up RAM that other applications
could still have used.

I see swap as means by which RAM is freed up by the kernel writing out
pages to the disk.

But what you are saying is that if I have 8 GB of RAM and let's say 3 GB is
actually full of zram swap pages, then, by that logic, applications will
have 3GB less RAM to operate than if the kernel had written out to disk. I
mean the RAM is still BEING USED.

Am I correct ? Do you see why this may not be a good idea ?
-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-05 Thread Sreyan Chakravarty
On Sat, Dec 5, 2020 at 3:37 AM Ed Greshko  wrote:

> Well, which "echo" command fails?
>
> Do these exist?
>
> /sys/power/disk
> /sys/power/state
>

 $ ll /sys/power/disk
 -rw-r--r--. 1 root root 4096 Dec  6 12:53 /sys/power/disk
 $ ll /sys/power/state
-rw-r--r--. 1 root root 4096 Dec  6 12:53 /sys/power/state

echo reboot > /sys/power/disk (This succeeds)

echo disk > /sys/power/state (Fails)

The above fails with :
-bash: echo: write error: No such device

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-05 Thread Chris Murphy
On Sat, Dec 5, 2020 at 10:03 PM Tim via users
 wrote:
>
> On Sat, 2020-12-05 at 17:45 -0700, Chris Murphy wrote:
> > There definitely is no free lunch with swap-on-zram, but it helps
> > quite a lot for most workloads.
>
> I'm curious how dedicating some of your RAM for swap, therefore having
> less RAM, is more beneficial than just using your RAM as RAM.

https://fedoraproject.org/wiki/Changes/SwapOnZRAM#Detailed_Description

Let me know if you have questions not answered there. A key point is
this is not a preallocation. Creating a 4G /dev/zram0 device doesn't
reserve or consume 4G. It's dynamically allocated, and even once full
it's not using that amount of memory, instead actual memory consumed
is related to the compression ratio achieved. Typical is 1 to 1.5G
memory consumption to swap out 4G worth of pages, for a net gain of
2.5G - 3G memory for use by other programs. And without having to
write to disk at all.

Not perfect, and not magic. It does have some tradeoffs.

-- 
Chris Murphy
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-05 Thread Doug H.
On Sat, Dec 5, 2020, at 9:03 PM, Tim via users wrote:
> On Sat, 2020-12-05 at 17:45 -0700, Chris Murphy wrote:
> > There definitely is no free lunch with swap-on-zram, but it helps
> > quite a lot for most workloads.
> 
> I'm curious how dedicating some of your RAM for swap, therefore having
> less RAM, is more beneficial than just using your RAM as RAM.

Compression. It uses some CPU, but seems to work well.


-- 
 Doug Herr
fedoraproject@wombatz.com
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-05 Thread Tim via users
On Sat, 2020-12-05 at 17:45 -0700, Chris Murphy wrote:
> There definitely is no free lunch with swap-on-zram, but it helps
> quite a lot for most workloads.

I'm curious how dedicating some of your RAM for swap, therefore having
less RAM, is more beneficial than just using your RAM as RAM.
 
-- 
 
uname -rsvp
Linux 3.10.0-1160.6.1.el7.x86_64 #1 SMP Tue Nov 17 13:59:11 UTC 2020 x86_64
 
Boilerplate:  All unexpected mail to my mailbox is automatically deleted.
I will only get to see the messages that are posted to the mailing list.
 
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-05 Thread Chris Murphy
On Fri, Dec 4, 2020 at 9:32 AM Sreyan Chakravarty  wrote:
>
>
>
> On Fri, Dec 4, 2020 at 5:50 PM Qiyu Yan  wrote:
>>
>>
>> No
>
>
> How can I shut off the ZRAM swap ?


Sreyan, it's OK to be confused and ask a lot of questions. However,
Qiyu did go to the trouble to refer you to the swap-on-zram feature
page which contains the very answers to a lot of your questions. Right
in the Contents block "1.4.6 How can it be disabled?" points to this
section:

https://fedoraproject.org/wiki/Changes/SwapOnZRAM#How_can_it_be_disabled.3F

More of your valid questions are answered in the devel@ list, if you
search for zram, you'll find the relevant threads.There's been a lot
of discussion about it before the feature was approved - and even
before it was a proposed feature.
https://lists.fedoraproject.org/archives/

There definitely is no free lunch with swap-on-zram, but it helps
quite a lot for most workloads. There's on-going work that will
hopefully more broadly serve even more workloads without having to
deal with it on a case by case basis.

Another reference you might be interested in, about hibernation in Fedora:
https://pagure.io/fedora-workstation/blob/master/f/hibernationstatus.md

That doc goes into the details of why hibernation is difficult to
support, and won't limit future decisions for Fedora.


-- 
Chris Murphy
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Samuel Sieb

On 12/4/20 11:56 AM, Sreyan Chakravarty wrote:



On Sat, Dec 5, 2020 at 1:14 AM Ed Greshko > wrote:



I'm not advocating doing this.  And, I don't use hibernation.

But there is also

https://fedoraproject.org/wiki/QA:Testcase_SwapOnZRAM_hibernation



One question, why is it considered Hibernation on ZRAM if you have to 
set up a file or partition for hibernation ?


I think you misread it.  It's swap on zram with also hibernation.

Doesn't it seem pointless to have 2 types of swap ? Why not have one 
that can do everything ?


Because there isn't one that can do everything.  With both, you get fast 
swap, but also the ability to hibernate.

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Jon LaBadie
On Sat, Dec 05, 2020 at 01:26:35AM +0530, Sreyan Chakravarty wrote:
> On Sat, Dec 5, 2020 at 1:14 AM Ed Greshko  wrote:
> 
> >
> > I'm not advocating doing this.  And, I don't use hibernation.
> >
> > But there is also
> >
> > https://fedoraproject.org/wiki/QA:Testcase_SwapOnZRAM_hibernation
> 
> 
> One question, why is it considered Hibernation on ZRAM if you have to set
> up a file or partition for hibernation ?
> 
> Doesn't it seem pointless to have 2 types of swap ? Why not have one that
> can do everything ?
> 

Because your needs are not my needs.

I have no use for hibernation.

I may have a need for fast, ram-based swap.

-- 
Jon H. LaBadie  jo...@jgcomp.com
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Samuel Sieb

On 12/4/20 2:04 PM, Sreyan Chakravarty wrote:

On Sat, 5 Dec 2020, 3:17 am Samuel Sieb, <

zram doesn't take up any significant amount of RAM until it's needed.
Then it compresses the swapped data blocks.  I see that I've
misconfigured something and ended up with two zram swaps active, so I
have almost 17GB of zram defined on my 12GB laptop.  Currently there is
9GB of swapped data using just over 2GB of RAM.  So even if I used the
entire 17GB of zram swap, my system would probably still be ok.

# zramctl
NAME       ALGORITHM DISKSIZE  DATA  COMPR  TOTAL STREAMS MOUNTPOINT
/dev/zram1 lz4             5G    5G   1.3G   1.4G       4
/dev/zram0 lzo-rle      11.6G  3.8G 931.8M 968.5M       4 [SWAP]

The whole zram thing does not make sense to me.


It does take a bit of getting used to.

You allocate swap so that you can swap pages to the disk if you run out 
of physical memory.


Thus it makes sense that the backing store will be on the disk.

How does it make sense to keep that store in the RAM? On the very 
resource that is scarce.


Its like you want more room, so you half your room and once a half is 
used you move onto the next room. This makes no sense. If you want more 
room you need get some actual space.


It's more like having a TARDIS in your room if you understand that 
reference.  It takes up some space, but it's bigger on the inside. :-) 
Although in this case, it does take up more space the more you stuff in 
it, but it holds more than the space it takes up.


The RAM pages that need to get paged out get compressed and kept in 
memory.  I suppose you could consider that my system with 12GB of RAM 
and 12GB of zram configured could become an 8GB system with 12GB of used 
swap.  20GB of virtual memory but still not using the disk.

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Ed Greshko

On 05/12/2020 04:06, Sreyan Chakravarty wrote:



On Sat, Dec 5, 2020 at 1:14 AM Ed Greshko mailto:ed.gres...@greshko.com>> wrote:

https://fedoraproject.org/wiki/QA:Testcase_SwapOnZRAM_hibernation 



BTW, the above does not work.

I get:

           -bash: echo: write error: No such device



Well, which "echo" command fails?

Do these exist?

/sys/power/disk
/sys/power/state



---
The key to getting good answers is to ask good questions.
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Sat, 5 Dec 2020, 3:17 am Samuel Sieb, <

>
> zram doesn't take up any significant amount of RAM until it's needed.
> Then it compresses the swapped data blocks.  I see that I've
> misconfigured something and ended up with two zram swaps active, so I
> have almost 17GB of zram defined on my 12GB laptop.  Currently there is
> 9GB of swapped data using just over 2GB of RAM.  So even if I used the
> entire 17GB of zram swap, my system would probably still be ok.
>
> # zramctl
> NAME   ALGORITHM DISKSIZE  DATA  COMPR  TOTAL STREAMS MOUNTPOINT
> /dev/zram1 lz4 5G5G   1.3G   1.4G   4
> /dev/zram0 lzo-rle  11.6G  3.8G 931.8M 968.5M   4 [SWAP]
>

The whole zram thing does not make sense to me.

You allocate swap so that you can swap pages to the disk if you run out of
physical memory.

Thus it makes sense that the backing store will be on the disk.

How does it make sense to keep that store in the RAM? On the very resource
that is scarce.

Its like you want more room, so you half your room and once a half is used
you move onto the next room. This makes no sense. If you want more room you
need get some actual space.

>
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Samuel Sieb

On 12/4/20 1:32 PM, Sreyan Chakravarty wrote:
On Sat, 5 Dec 2020, 2:57 am Samuel Sieb, > wrote:


I think you missed the point about it being *fast*.  Swapping in RAM is
orders of magnitude faster than swapping to disk, even SSD.

I thought swap was supposed to be used when you were running low on RAM. 
Then it kind of makes intuitive sense that the swap will be on disk and 
not ram.


Why block RAM by ZRAM Swap? Why not just keep it free?


zram doesn't take up any significant amount of RAM until it's needed. 
Then it compresses the swapped data blocks.  I see that I've 
misconfigured something and ended up with two zram swaps active, so I 
have almost 17GB of zram defined on my 12GB laptop.  Currently there is 
9GB of swapped data using just over 2GB of RAM.  So even if I used the 
entire 17GB of zram swap, my system would probably still be ok.


# zramctl
NAME   ALGORITHM DISKSIZE  DATA  COMPR  TOTAL STREAMS MOUNTPOINT
/dev/zram1 lz4 5G5G   1.3G   1.4G   4
/dev/zram0 lzo-rle  11.6G  3.8G 931.8M 968.5M   4 [SWAP]
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Sat, 5 Dec 2020, 2:57 am Samuel Sieb,  wrote:

>
>
> I think you missed the point about it being *fast*.  Swapping in RAM is
> orders of magnitude faster than swapping to disk, even SSD.
>

I thought swap was supposed to be used when you were running low on RAM.
Then it kind of makes intuitive sense that the swap will be on disk and not
ram.

Why block RAM by ZRAM Swap? Why not just keep it free?

>
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Samuel Sieb

On 12/4/20 11:43 AM, Sreyan Chakravarty wrote:
On Sat, Dec 5, 2020 at 1:12 AM Samuel Sieb > wrote:


The zram swap is fast and efficient.  But if you use more than that,
there is the disk swap to fall back on.  Also, you can only
hibernate to
disk swap so in your case, you need it too.

There is no point to having the zram swap if I have a much larger disk 
swap. Seems pretty redundant.


I think you missed the point about it being *fast*.  Swapping in RAM is 
orders of magnitude faster than swapping to disk, even SSD.

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Sat, Dec 5, 2020 at 1:14 AM Ed Greshko  wrote:

> https://fedoraproject.org/wiki/QA:Testcase_SwapOnZRAM_hibernation


BTW, the above does not work.

I get:

   -bash: echo: write error: No such device

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Sat, Dec 5, 2020 at 1:14 AM Ed Greshko  wrote:

>
> I'm not advocating doing this.  And, I don't use hibernation.
>
> But there is also
>
> https://fedoraproject.org/wiki/QA:Testcase_SwapOnZRAM_hibernation


One question, why is it considered Hibernation on ZRAM if you have to set
up a file or partition for hibernation ?

Doesn't it seem pointless to have 2 types of swap ? Why not have one that
can do everything ?

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Ed Greshko

On 05/12/2020 02:58, Sreyan Chakravarty wrote:



On Fri, Dec 4, 2020 at 11:13 PM Patrick O'Callaghan mailto:pocallag...@gmail.com>> wrote:

Using swapoff(8)


I mean how do I disable it permanently?


The swap-on-zram feature can be disabled with sudo touch 
/etc/systemd/zram-generator.conf and reenabled by removing this file, and 
customized by editing it. See man zram-generator.conf for configuration 
information, including a description of the default configuration.

Also  From another result of using google

 How can it be disabled?
Immediately:
sudo systemctl stop swap-create@zram0

Permanently:
sudo touch /etc/systemd/zram-generator.conf or sudo dnf remove 
zram-generator-defaults


I'm not advocating doing this.  And, I don't use hibernation.

But there is also

https://fedoraproject.org/wiki/QA:Testcase_SwapOnZRAM_hibernation


---
The key to getting good answers is to ask good questions.

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Sat, Dec 5, 2020 at 1:12 AM Samuel Sieb  wrote:

>
> The zram swap is fast and efficient.  But if you use more than that,
> there is the disk swap to fall back on.  Also, you can only hibernate to
> disk swap so in your case, you need it too.
>

There is no point to having the zram swap if I have a much larger disk
swap. Seems pretty redundant.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Samuel Sieb

On 12/4/20 11:27 AM, Sreyan Chakravarty wrote:
On Sat, Dec 5, 2020 at 12:37 AM Samuel Sieb > wrote:


Why would you want to?

What is the point of having 2 types of swap ?


The zram swap is fast and efficient.  But if you use more than that, 
there is the disk swap to fall back on.  Also, you can only hibernate to 
disk swap so in your case, you need it too.

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Sat, Dec 5, 2020 at 12:37 AM Samuel Sieb  wrote:

> Why would you want to?
>

What is the point of having 2 types of swap ?
-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Samuel Sieb

On 12/4/20 10:58 AM, Sreyan Chakravarty wrote:
On Fri, Dec 4, 2020 at 11:13 PM Patrick O'Callaghan 
mailto:pocallag...@gmail.com>> wrote:


Using swapoff(8)

I mean how do I disable it permanently?


Why would you want to?
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Fri, Dec 4, 2020 at 11:13 PM Patrick O'Callaghan 
wrote:

> Using swapoff(8)
>

I mean how do I disable it permanently?
-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Fri, Dec 4, 2020 at 11:17 PM Patrick O'Callaghan 
wrote:

> I'm referring to recent messages in which the question of swap on BTRFS
> has been discussed. You'll have to search for them, but I'm doing this
> myself and it wasn't a big deal to set up.
>

You mean discussions on this mailing list ?

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Patrick O'Callaghan
On Fri, 2020-12-04 at 21:53 +0530, Sreyan Chakravarty wrote:
> On Fri, Dec 4, 2020 at 6:35 PM Patrick O'Callaghan 
> wrote:
> 
> > 
> > 
> > You seem to be confusing two different things. BTRFS has nothing to do
> > with Zram. IIRC previous posters have already pointed to descriptions
> > of using BTRFS for hibernation.
> 
> 
> Are you referring to this script  ?
> 
> https://raw.githubusercontent.com/osandov/osandov-linux/master/scripts/btrfs_map_physical.c

I'm referring to recent messages in which the question of swap on BTRFS
has been discussed. You'll have to search for them, but I'm doing this
myself and it wasn't a big deal to set up.

poc
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Patrick O'Callaghan
On Fri, 2020-12-04 at 22:01 +0530, Sreyan Chakravarty wrote:
> On Fri, Dec 4, 2020 at 5:50 PM Qiyu Yan  wrote:
> 
> > 
> > No
> > 
> 
> How can I shut off the ZRAM swap ?

Using swapoff(8)

poc
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Fri, Dec 4, 2020 at 5:50 PM Qiyu Yan  wrote:

>
> No
>

How can I shut off the ZRAM swap ?

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Fri, Dec 4, 2020 at 6:35 PM Patrick O'Callaghan 
wrote:

>
>
> You seem to be confusing two different things. BTRFS has nothing to do
> with Zram. IIRC previous posters have already pointed to descriptions
> of using BTRFS for hibernation.


Are you referring to this script  ?

https://raw.githubusercontent.com/osandov/osandov-linux/master/scripts/btrfs_map_physical.c
-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Patrick O'Callaghan
On Fri, 2020-12-04 at 18:23 +0530, Sreyan Chakravarty wrote:
> On Fri, 4 Dec 2020, 5:56 pm Patrick O'Callaghan, 
> wrote:
> 
> > 
> > 
> > It's in RAM, so not permanent.
> > 
> 
> 
> So how is hibernation done in BTRFS?

You seem to be confusing two different things. BTRFS has nothing to do
with Zram. IIRC previous posters have already pointed to descriptions
of using BTRFS for hibernation.

poc
> 
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Fri, 4 Dec 2020, 5:56 pm Patrick O'Callaghan, 
wrote:

>
>
> It's in RAM, so not permanent.
>


So how is hibernation done in BTRFS?

>
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Fri, 4 Dec 2020, 5:50 pm Qiyu Yan,  wrote:

> No
>

So how do you do hibernate on BTRFS?

>
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Patrick O'Callaghan
On Fri, 2020-12-04 at 17:22 +0530, Sreyan Chakravarty wrote:
> On Fri, 4 Dec 2020, 5:15 pm Patrick O'Callaghan, 
> wrote:
> 
> > 
> > It's a compressed RAM disk:
> > 
> > https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html
> > 
> > poc
> > 
> 
> Can it be used for hibernation?

It's in RAM, so not permanent.

poc
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Qiyu Yan
Sreyan Chakravarty  于2020年12月4日周五 下午7:52写道:
>
>
>
> On Fri, 4 Dec 2020, 5:15 pm Patrick O'Callaghan,  
> wrote:
>>
>>
>> It's a compressed RAM disk:
>>
>> https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html
>>
>> poc
>
>
> Can it be used for hibernation?
No
>
> ___
> users mailing list -- users@lists.fedoraproject.org
> To unsubscribe send an email to users-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Fri, 4 Dec 2020, 5:15 pm Patrick O'Callaghan, 
wrote:

>
> It's a compressed RAM disk:
>
> https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html
>
> poc
>

Can it be used for hibernation?

>
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Patrick O'Callaghan
On Fri, 2020-12-04 at 16:16 +0530, Sreyan Chakravarty wrote:
> Is ZRAM a file or is it a partition ?

It's a compressed RAM disk:

https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html

poc
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Fri, Dec 4, 2020 at 3:58 PM Qiyu Yan  wrote:

> Just execute `swapon` to see a list of all swap devices or files, such
> as...
>

# swapon
NAME   TYPE  SIZE USED PRIO
/dev/zram0 partition 3.8G   0B  100

How do I increase the size of zram0 ?

I want to have the hibernate facility.


> ... by default, in Fedora 33, an up-to 4GB zram device will be setup as
> swap.
>
> see also:
> https://fedoraproject.org/wiki/Changes/SwapOnZRAM


Is ZRAM a file or is it a partition ?

I checked on gparted but there is no extra partition for zram.

I use LUKS2 encryption, but I saw no extra partition for swap, and I don't
remember setting up LVM.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Qiyu Yan
Sreyan Chakravarty  于2020年12月4日周五 下午6:07写道:
>
> On Fri, Dec 4, 2020 at 3:20 PM Qiyu Yan  wrote:
>>
>> Try checking with `swapon`,
>
>
> This is the output I get with `swapon`:
>
> # swapon -v -f /fedora.swap
> swapon: /fedora.swap: found signature [pagesize=4096, signature=swap]
> swapon: /fedora.swap: pagesize=4096, swapsize=15032385536, devsize=15032385536
> swapon /fedora.swap
>
> I am reading that `filefrag` does not work correctly on BTRFS, but don't know 
> for sure.
Just execute `swapon` to see a list of all swap devices or files, such as...
>
>> I guess the 4G zram swap makes the difference.
>>
>
> I have no idea what you mean, please elaborate.
... by default, in Fedora 33, an up-to 4GB zram device will be setup as swap.

see also:
https://fedoraproject.org/wiki/Changes/SwapOnZRAM
> --
> Regards,
> Sreyan Chakravarty
> ___
> users mailing list -- users@lists.fedoraproject.org
> To unsubscribe send an email to users-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
On Fri, Dec 4, 2020 at 3:20 PM Qiyu Yan  wrote:

> Try checking with `swapon`,


This is the output I get with `swapon`:

# swapon -v -f /fedora.swap
swapon: /fedora.swap: found signature [pagesize=4096, signature=swap]
swapon: /fedora.swap: pagesize=4096, swapsize=15032385536,
devsize=15032385536
swapon /fedora.swap

I am reading that `filefrag` does not work correctly on BTRFS, but don't
know for sure.

I guess the 4G zram swap makes the difference.
>
>
I have no idea what you mean, please elaborate.
-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Qiyu Yan
Try checking with `swapon`, I guess the 4G zram swap makes the difference.

Sreyan Chakravarty  于2020年12月4日周五 下午5:45写道:
>
> Hi,
>
> Migrated to BTRFS on Fedora 33.
>
> How do I get hibernate to work with swap files ?
>
> I did:
> touch /fedora.swap
> chattr +C /fedora.swap
> dd if=/dev/zero of=/fedora.swap bs=1M count=14336 status=progress
> chmod 600 /fedora.swap
> mkswap /fedora.swap
>
> /etc/fstab entry:
>
>   /fedora.swap none swap defaults 0 2
>
> swap is mounted but is behaving weirdly since I have more swap than I 
> actually allocated:
>
>   totalusedfree  shared  buff/cache   
> available
> Mem:  7.7Gi   1.5Gi   4.2Gi   407Mi   2.0Gi   
> 5.6Gi
> Swap:  17Gi  0B17Gi
>
> Don't have any idea where 17 GiB is coming from.
>
> Using the --giga option I get:
>
>   totalusedfree  shared  buff/cache   
> available
> Mem:  8   1   4   0   2   
> 5
> Swap:19   0  19
>
> I have no idea what is happening.
>
> What is going on?
> --
> Regards,
> Sreyan Chakravarty
> ___
> users mailing list -- users@lists.fedoraproject.org
> To unsubscribe send an email to users-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


F33 BTRFS - Not enough swap space for hibernation

2020-12-04 Thread Sreyan Chakravarty
Hi,

Migrated to BTRFS on Fedora 33.

How do I get hibernate to work with swap files ?

I did:
touch /fedora.swap
chattr +C /fedora.swap
dd if=/dev/zero of=/fedora.swap bs=1M count=14336 status=progress
chmod 600 /fedora.swap
mkswap /fedora.swap

/etc/fstab entry:

  /fedora.swap none swap defaults 0 2

swap is mounted but is behaving weirdly since I have more swap than I
actually allocated:

  totalusedfree  shared  buff/cache
available
Mem:  7.7Gi   1.5Gi   4.2Gi   407Mi   2.0Gi
5.6Gi
Swap:  17Gi  0B17Gi

Don't have any idea where 17 GiB is coming from.

Using the --giga option I get:

  totalusedfree  shared  buff/cache
available
Mem:  8   1   4   0   2
  5
Swap:19   0  19

I have no idea what is happening.

What is going on?
-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: Not enough swap space for hibernation

2020-11-18 Thread Sreyan Chakravarty
Thank you to everyone here.

I guess the problem was not putting the correct kernel parameters.

Now hibernation actually works faster.

Thanks again.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: Not enough swap space for hibernation

2020-11-18 Thread Sreyan Chakravarty
On Sat, Nov 14, 2020 at 11:40 AM Samuel Sieb  wrote:

> That's a good point.  The memory usage is quite low at that point, but
> if he ever ended up using swap space, there could easily not be enough
> to hibernate.  However, it should work in this current case.
>

Exactly, it should work. It use to work before I upgraded to the latest
release of F32.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: Not enough swap space for hibernation

2020-11-15 Thread Chris Murphy
On Fri, Nov 13, 2020 at 11:10 PM Samuel Sieb  wrote:
>
> On 11/13/20 9:39 PM, Tim via users wrote:
> > On Fri, 2020-11-13 at 21:24 +0530, Sreyan Chakravarty wrote:
> >> I have no idea why this is happening when I have 8GB of free swap space :
> >>
> >> $  free -h
> >>totalusedfree  shared  buff/cache   
> >> available
> >> Mem:  7.7Gi   1.6Gi   4.1Gi   269Mi   2.0Gi   
> >> 5.6Gi
> >> Swap: 8.0Gi  0B   8.0Gi
> >>
> >> My RAM is also 8GB.
> >
> > The old recommendation always was to have *MORE* swap space than RAM.
>
> That's a good point.  The memory usage is quite low at that point, but
> if he ever ended up using swap space, there could easily not be enough
> to hibernate.  However, it should work in this current case.

Hibernation is pretty complicated. What should happen is the kernel
evicts dirty pages to swap in order to free up 50% RAM. Then the
kernel uses that free memory to create the hibernation image and
compress it and then it gets written into swap. So there are some
opportunities for it to fail.

There's a bunch of tests to do to help narrow down the problem.
https://www.kernel.org/doc/html/latest/power/basic-pm-debugging.html

Note that swapfiles on Btrfs additionally need an offset boot parameter added.
https://bugzilla.kernel.org/show_bug.cgi?id=202803#c9


-- 
Chris Murphy
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: Not enough swap space for hibernation

2020-11-13 Thread Samuel Sieb

On 11/13/20 9:39 PM, Tim via users wrote:

On Fri, 2020-11-13 at 21:24 +0530, Sreyan Chakravarty wrote:

I have no idea why this is happening when I have 8GB of free swap space :

$  free -h
   totalusedfree  shared  buff/cache   available
Mem:  7.7Gi   1.6Gi   4.1Gi   269Mi   2.0Gi   5.6Gi
Swap: 8.0Gi  0B   8.0Gi

My RAM is also 8GB.


The old recommendation always was to have *MORE* swap space than RAM.


That's a good point.  The memory usage is quite low at that point, but 
if he ever ended up using swap space, there could easily not be enough 
to hibernate.  However, it should work in this current case.

___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: Not enough swap space for hibernation

2020-11-13 Thread Tim via users
On Fri, 2020-11-13 at 21:24 +0530, Sreyan Chakravarty wrote:
> I have no idea why this is happening when I have 8GB of free swap space :
> 
> $  free -h
>   totalusedfree  shared  buff/cache   
> available
> Mem:  7.7Gi   1.6Gi   4.1Gi   269Mi   2.0Gi   
> 5.6Gi
> Swap: 8.0Gi  0B   8.0Gi
> 
> My RAM is also 8GB.

The old recommendation always was to have *MORE* swap space than RAM.
 
-- 
 
uname -rsvp
Linux 3.10.0-1160.2.2.el7.x86_64 #1 SMP Tue Oct 20 16:53:08 UTC 2020 x86_64
 
Boilerplate:  All unexpected mail to my mailbox is automatically deleted.
I will only get to see the messages that are posted to the mailing list.
 
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: Not enough swap space for hibernation

2020-11-13 Thread Sreyan Chakravarty
On Fri, Nov 13, 2020 at 9:29 PM Jonathan Billings 
wrote:

> I believe that using a swap *file* for hibernation requires special
> steps, as described here:
>
> https://www.kernel.org/doc/html/latest/power/swsusp-and-swap-files.html
>
> I believe you need to add the kernel parameters to make it work, or
> you have to switch to the userland suspend interface.
>

I already have the required kernel parameters set.

-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Re: Not enough swap space for hibernation

2020-11-13 Thread Jonathan Billings
On Fri, Nov 13, 2020 at 09:24:52PM +0530, Sreyan Chakravarty wrote:
>
> Hi,
> 
> I have just upgraded to the new 5.8 kernel on Fedora 32.
> 
> I have also configured my swap as a swap file of 8GB.
> 
> But when I try to hibernate using the following command:
> 
> $ systemctl hibernate
> Failed to hibernate system via logind: Not enough swap space for hibernation
> 
> I have no idea why this is happening when I have 8GB of free swap space :
> 
> $  free -h
>   totalusedfree  shared  buff/cache
> available
> Mem:  7.7Gi   1.6Gi   4.1Gi   269Mi   2.0Gi
> 5.6Gi
> Swap: 8.0Gi  0B   8.0Gi
> 
> My RAM is also 8GB.
> 
> Any ideas ?

I believe that using a swap *file* for hibernation requires special
steps, as described here:

https://www.kernel.org/doc/html/latest/power/swsusp-and-swap-files.html

I believe you need to add the kernel parameters to make it work, or
you have to switch to the userland suspend interface.


-- 
Jonathan Billings 
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


Not enough swap space for hibernation

2020-11-13 Thread Sreyan Chakravarty
Hi,

I have just upgraded to the new 5.8 kernel on Fedora 32.

I have also configured my swap as a swap file of 8GB.

But when I try to hibernate using the following command:

$ systemctl hibernate
Failed to hibernate system via logind: Not enough swap space for hibernation

I have no idea why this is happening when I have 8GB of free swap space :

$  free -h
  totalusedfree  shared  buff/cache
available
Mem:  7.7Gi   1.6Gi   4.1Gi   269Mi   2.0Gi
5.6Gi
Swap: 8.0Gi  0B   8.0Gi

My RAM is also 8GB.

Any ideas ?
-- 
Regards,
Sreyan Chakravarty
___
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org