On Fri, Nov 13, 2020 at 5:41 AM Sreyan Chakravarty <sreya...@gmail.com> wrote:

> 1) Why doesn't fallocate work anymore ?

Fallocate is the preferred way to do this, e.g.

fallocate -l 8G swapfile

> 2) I tried        dd if=/dev/zero of=/fedora.swap bs=1 count=0 seek=8G
>
> This did not work. swapon complained about files being full of holes.

That's because that command creates a sparse file, which has holes in
it. Same as using 'truncate'.

> What is so special about bs=1M ?

I think it's count=0 and seek= that causes it to become sparse. I
don't think the bs size is relevant.

> /fedora.swap none swap sw 0 0

I have no idea what 'sw' is in the fstab file is for; I don't see it
in either man fstab or man swapon. I'd just make this line:

/fedora.swap none defaults



>
>
> I now have a new problem.
>
> SELinux is preventing systemd-logind to read the swap file.
>
> Here is the message:
>
> SELinux is preventing systemd-logind from read access on the file 
> /fedora.swap.

mkswap sets the label. So this is a secondary effect of what Sam Sieb
already discovered from the lack of a blkid swap signature. You forgot
to use mkswap on the file.




-- 
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

Reply via email to