Straightforward tutorial on how to set up hibernation without a swap partition (swapfile)
I had to consult multiple sources on how to do this so I thought it would be good to compile it all into one post. I don't have any blog site so I thought Reddit might be a good place to post this. It doesn't require update-initram2fs nor uswsusp (I accidentally overwrote my boot sector using these tools and plus they seem like magic, versus this method which seems more clear and obvious). It also does not require any other external tools other than the ones that come with Linux.
**Guide**
1. Create a swapfile. A good size would be more than your total RAM
1. `sudo fallocate -l 8G /swapfile`
2. `sudo mkswap /swapfile`
2. Set the permissions for the swapfile (only readable and writable by root)
1. `sudo chmod u=rw,go= /swapfile`
3. Enable the swapfile
1. `sudo swapon /swapfile`
4. Add an entry to /etc/fstab to enable swap at boot
1. `sudo bash -c "echo /swapfile none swap defaults 0 0 >> /etc/fstab"`
5. Find out which drive your system boots from
1. `lsblk`
2. See Figure 1 below for output example
6. Find out the offset in bytes of the swapfile is located on your disk
1. Run `sudo filefrag -v /swapfile`
2. You should get some output like the below Figure 2. Note the number circled in red because that is the swapfile offset.
7. Tell GRUB where to resume the session from on boot
1. Open /etc/default/grub in your favorite editor (as sudo of course) and find the line "GRUB\_CMDLINE\_LINUX\_DEFAULT"
2. Add `resume=<your boot drive here>` and `resume_offset=<your swapfile offset>` to the things in that list and then save the file
1. See Figure 3 below for my example
8. Apply the GRUB changes
1. `sudo grub-mkconfig -o /boot/grub/grub.cfg`
9. Now hibernate should work. Test with either `sudo systemctl hibernate` or `pm-hibernate` if you have pm-utils
10. You can set up your machine to hibernate in your distro's power settings on laptop lid close or hibernate button press or whatever now. I won't cover that in this post.
​
[Figure 1: lsblk output. I just have one partition so my system boots from \/dev\/sda1 \(resume value\)](https://preview.redd.it/vhoejij99zw31.png?width=584&format=png&auto=webp&s=7eab92d5285d91293617580ba0f221a106b65ccf)
[Figure 2: the number circled in red should be your resume\_offset for \/etc\/defaults\/grub](https://preview.redd.it/ygskmolg8zw31.png?width=827&format=png&auto=webp&s=5239057d79b5a681d3ae2e94cae873ec20be9a6e)
​
[Figure 3: You need to add these two circled fields to the GRUB\_CMDLINE\_LINUX\_DEFAULT list](https://preview.redd.it/6wgh7tnq9zw31.png?width=831&format=png&auto=webp&s=aa590f1d0b9485a95fad9e74f81f8e88b46db2ba)
Sources:
[https://wiki.manjaro.org/index.php?noscript=Swap#Using\_a\_Swapfile](https://wiki.manjaro.org/index.php?noscript=Swap#Using_a_Swapfile)
[https://wiki.archlinux.org/index.php/Power\_management/Suspend\_and\_hibernate#Hibernation](https://wiki.archlinux.org/index.php/Power_management/Suspend_and_hibernate#Hibernation)
[https://bbs.archlinux.org/viewtopic.php?id=182392](https://bbs.archlinux.org/viewtopic.php?id=182392)
​
​
Let me know if you guys have any problems.
https://redd.it/ds9w9e
@r_linux
I had to consult multiple sources on how to do this so I thought it would be good to compile it all into one post. I don't have any blog site so I thought Reddit might be a good place to post this. It doesn't require update-initram2fs nor uswsusp (I accidentally overwrote my boot sector using these tools and plus they seem like magic, versus this method which seems more clear and obvious). It also does not require any other external tools other than the ones that come with Linux.
**Guide**
1. Create a swapfile. A good size would be more than your total RAM
1. `sudo fallocate -l 8G /swapfile`
2. `sudo mkswap /swapfile`
2. Set the permissions for the swapfile (only readable and writable by root)
1. `sudo chmod u=rw,go= /swapfile`
3. Enable the swapfile
1. `sudo swapon /swapfile`
4. Add an entry to /etc/fstab to enable swap at boot
1. `sudo bash -c "echo /swapfile none swap defaults 0 0 >> /etc/fstab"`
5. Find out which drive your system boots from
1. `lsblk`
2. See Figure 1 below for output example
6. Find out the offset in bytes of the swapfile is located on your disk
1. Run `sudo filefrag -v /swapfile`
2. You should get some output like the below Figure 2. Note the number circled in red because that is the swapfile offset.
7. Tell GRUB where to resume the session from on boot
1. Open /etc/default/grub in your favorite editor (as sudo of course) and find the line "GRUB\_CMDLINE\_LINUX\_DEFAULT"
2. Add `resume=<your boot drive here>` and `resume_offset=<your swapfile offset>` to the things in that list and then save the file
1. See Figure 3 below for my example
8. Apply the GRUB changes
1. `sudo grub-mkconfig -o /boot/grub/grub.cfg`
9. Now hibernate should work. Test with either `sudo systemctl hibernate` or `pm-hibernate` if you have pm-utils
10. You can set up your machine to hibernate in your distro's power settings on laptop lid close or hibernate button press or whatever now. I won't cover that in this post.
​
[Figure 1: lsblk output. I just have one partition so my system boots from \/dev\/sda1 \(resume value\)](https://preview.redd.it/vhoejij99zw31.png?width=584&format=png&auto=webp&s=7eab92d5285d91293617580ba0f221a106b65ccf)
[Figure 2: the number circled in red should be your resume\_offset for \/etc\/defaults\/grub](https://preview.redd.it/ygskmolg8zw31.png?width=827&format=png&auto=webp&s=5239057d79b5a681d3ae2e94cae873ec20be9a6e)
​
[Figure 3: You need to add these two circled fields to the GRUB\_CMDLINE\_LINUX\_DEFAULT list](https://preview.redd.it/6wgh7tnq9zw31.png?width=831&format=png&auto=webp&s=aa590f1d0b9485a95fad9e74f81f8e88b46db2ba)
Sources:
[https://wiki.manjaro.org/index.php?noscript=Swap#Using\_a\_Swapfile](https://wiki.manjaro.org/index.php?noscript=Swap#Using_a_Swapfile)
[https://wiki.archlinux.org/index.php/Power\_management/Suspend\_and\_hibernate#Hibernation](https://wiki.archlinux.org/index.php/Power_management/Suspend_and_hibernate#Hibernation)
[https://bbs.archlinux.org/viewtopic.php?id=182392](https://bbs.archlinux.org/viewtopic.php?id=182392)
​
​
Let me know if you guys have any problems.
https://redd.it/ds9w9e
@r_linux
Gnome has reached its funding goal and OIN is pivoting to target patent trolls
https://www.theregister.co.uk/2019/11/04/open_invention_network_will_pivot_to_take_on_patent_trolls/
https://redd.it/dsbw8l
@r_linux
https://www.theregister.co.uk/2019/11/04/open_invention_network_will_pivot_to_take_on_patent_trolls/
https://redd.it/dsbw8l
@r_linux
www.theregister.co.uk
Pro-Linux IP consortium Open Invention Network will 'pivot' to take on patent trolls
Not many actual software companies threaten Linux now
Why is it so hard to install packages on Linux?
There are so many ways to install packages on Linux, sometimes it can be so technical compared to Windows and Mac. Just double click the . exe or . dmg and next, next, next, finish.
With Linux sometimes you need to find and install dependencies, or use command line apt-get, snap, dpkg -i, sometimes add repositories, etc. It can really turn some people off from Linux.
Yes, there is the graphical software store to install programs and packages such as on Ubuntu but why doesn't Linux have a standard double click, simple installation process for all programs like OSX and Windows?
What are the benefits, if any, of having so many methods of installing software on Linux?
https://redd.it/dsdxuy
@r_linux
There are so many ways to install packages on Linux, sometimes it can be so technical compared to Windows and Mac. Just double click the . exe or . dmg and next, next, next, finish.
With Linux sometimes you need to find and install dependencies, or use command line apt-get, snap, dpkg -i, sometimes add repositories, etc. It can really turn some people off from Linux.
Yes, there is the graphical software store to install programs and packages such as on Ubuntu but why doesn't Linux have a standard double click, simple installation process for all programs like OSX and Windows?
What are the benefits, if any, of having so many methods of installing software on Linux?
https://redd.it/dsdxuy
@r_linux
reddit
Why is it so hard to install packages on Linux?
There are so many ways to install packages on Linux, sometimes it can be so technical compared to Windows and Mac. Just double click the . exe or...
Big shout-out to Calculate Linux for hosting their own little PeerTube instance
https://tube.calculate.social/videos/trending
https://redd.it/dse9c2
@r_linux
https://tube.calculate.social/videos/trending
https://redd.it/dse9c2
@r_linux
tube.calculate.social
Calculate Tube
The site runs on a federated (ActivityPub) Peertube streaming video platform using P2P (BitTorrent) directly in a web browser with WebTorrenet and Angular.
Systemd needs official documentation on best practices
https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdNeedsBestPractices
https://redd.it/dsgf7t
@r_linux
https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdNeedsBestPractices
https://redd.it/dsgf7t
@r_linux
reddit
Systemd needs official documentation on best practices
Posted in r/linux by u/speckz • 7 points and 1 comment
Sudo Pronounciation
How do you guys pronounce sudo? Is it su doo or su doh? Or something else? I have heard both and am curious! Thanks :)
https://redd.it/dskpci
@r_linux
How do you guys pronounce sudo? Is it su doo or su doh? Or something else? I have heard both and am curious! Thanks :)
https://redd.it/dskpci
@r_linux
reddit
Sudo Pronounciation
How do you guys pronounce sudo? Is it su doo or su doh? Or something else? I have heard both and am curious! Thanks :)
Learning basic Linux fast
Hey all, I am looking for some references to some good sources to start my dive into the world of crazy. I am looking specifically for Ubuntu based resources. I am trying to learn how to use it for a job opportunity where the requirements are basic Linux usage. I have already spun up a Ubuntu VM. I have creating text files, moving through directories, moving and deleting down pretty well. Today was day one and I feel pretty good about it but I would love to find some good free resources to learn more.
https://redd.it/dsq4ej
@r_linux
Hey all, I am looking for some references to some good sources to start my dive into the world of crazy. I am looking specifically for Ubuntu based resources. I am trying to learn how to use it for a job opportunity where the requirements are basic Linux usage. I have already spun up a Ubuntu VM. I have creating text files, moving through directories, moving and deleting down pretty well. Today was day one and I feel pretty good about it but I would love to find some good free resources to learn more.
https://redd.it/dsq4ej
@r_linux
reddit
Learning basic Linux fast
Hey all, I am looking for some references to some good sources to start my dive into the world of crazy. I am looking specifically for Ubuntu...
The macOS Catalina release is now available for Linux users
https://twitter.com/FoxletFox/status/1181681413973843968
https://redd.it/dsxm1a
@r_linux
https://twitter.com/FoxletFox/status/1181681413973843968
https://redd.it/dsxm1a
@r_linux
Twitter
Foxlet
The macOS Catalina release is now available for Linux users! (Yes, iMessage works.) https://t.co/Tm8hyAvoK8
Microsoft defender will Come to Linux next year
https://www.linux.com/news/microsoft-defender-atp-is-coming-to-linux-in-2020/
https://redd.it/dsztm8
@r_linux
https://www.linux.com/news/microsoft-defender-atp-is-coming-to-linux-in-2020/
https://redd.it/dsztm8
@r_linux
Linux.com
Microsoft: Defender ATP is coming to Linux in 2020 - Linux.com
Microsoft is planning to bring its Defender antivirus to Linux systems next year and will be giving a demo of how security specialists can use Microsoft Defender at the Ignite Conference this week.
Run Linux desktop on any rooted Android device
Hi,
We can now run Linux desktop on any rooted Android device.
It is done via two applications.
Here is a clip of VolksPC OS running on ODROID-N2:
https://www.youtube.com/watch?v=RbVtqfnRhwI&t=13s
And on ODROID-C2:
https://www.youtube.com/watch?v=mNzru9WAoYg&t=17s
Vasant
https://redd.it/dsza4a
@r_linux
Hi,
We can now run Linux desktop on any rooted Android device.
It is done via two applications.
Here is a clip of VolksPC OS running on ODROID-N2:
https://www.youtube.com/watch?v=RbVtqfnRhwI&t=13s
And on ODROID-C2:
https://www.youtube.com/watch?v=mNzru9WAoYg&t=17s
Vasant
https://redd.it/dsza4a
@r_linux
YouTube
VOLKSPC- Debian XFCE running on Android ODROID-N2
VOLKSPC Debian Buster XFCE desktop runs as an application on Android Pie.
EA using Visual Studio for Linux Cross Platform development
https://devblogs.microsoft.com/cppblog/ea-and-visual-studios-linux-support/
https://redd.it/dt7dom
@r_linux
https://devblogs.microsoft.com/cppblog/ea-and-visual-studios-linux-support/
https://redd.it/dt7dom
@r_linux
Microsoft News
Electronic Arts and Visual Studio’s Linux Support
Electronic Arts (EA) is using Visual Studio’s cross-platform support to cross-compile on Windows and debug on Linux. The following post is written by Ben May, a Senior Software Engineer of Engineering Workflows at EA. Thanks Ben and EA for your partnership…
Any: keyword based navigation, in bash
I recently worked on a bash package to enable shell navigation based on keywords.
`any <command> keyword` expands to `any <command> filename-matching-keyword`.
If the matching is not unique, any prompts a selection menu.
[GitHub Link: https://github.com/acorbe/any](https://github.com/acorbe/any)
Any works for bash shells, and aim at expanding the capabilities of auto-completion.
Although there exist shells with smarter auto-completion features (e.g. zsh), it is not always possible to use them (e.g. on supercomputers frontend). Any is usable everywhere.
It speeds up considerably my daily job. What do you guys think?
https://redd.it/dtc4jv
@r_linux
I recently worked on a bash package to enable shell navigation based on keywords.
`any <command> keyword` expands to `any <command> filename-matching-keyword`.
If the matching is not unique, any prompts a selection menu.
[GitHub Link: https://github.com/acorbe/any](https://github.com/acorbe/any)
Any works for bash shells, and aim at expanding the capabilities of auto-completion.
Although there exist shells with smarter auto-completion features (e.g. zsh), it is not always possible to use them (e.g. on supercomputers frontend). Any is usable everywhere.
It speeds up considerably my daily job. What do you guys think?
https://redd.it/dtc4jv
@r_linux
GitHub
acorbe/any
Keyword-based shell navigation & auto-completion. For Bash. - acorbe/any