Is there a way to detect whether a swap partition contains the memory of a hibernated system?  More specifically: suppose I have a Linux installation and that I hibernate it. This means that all the content of the RAM is dumped on the swap partition and then the computer is shut down.  Suppose that in the meantime I start another Linux on the same system (either because it resides on another partition, or because I use a live system). If I used the same swap partition, that would corrupt the data of the hibernated system, and I do not want that. So I would like to be able to tell whether a swap partition is keeping "interesting" data or just leftovers of a properly shut down system.  Is there a way to distinguish between these two cases just by looking to the content of the partition?  I am not asking whether data become corrupted or not. I am sure they will. I am asking if there is a way to detect whether the swap I would like to use contains data of an hibernated system, so that I can avoid turning it on if it does.
1322
In order to save disk space, I want to have two OS installations share a single swap partition (a dual-boot). Is this a good idea?
22333
When administering Linux systems I often find myself struggling to track down the culprit after a partition goes full. I normally use du / | sort -nr but on a large filesystem this takes a long time before any results are returned.  Also, this is usually successful in highlighting the worst offender but I've often found myself resorting to du without the sort in more subtle cases and then had to trawl through the output.  I'd prefer a command line solution which relies on standard Linux commands since I have to administer quite a few systems and installing new software is a hassle (especially when out of disk space!)
68041
I want to delete the swap partition to free up space to increase the root partition, but accidentally when I restarted Ubuntu I got this:    I have made a live Ubuntu to solve this, but I can't close grub rescue. How to close grub rescue and solve this problem?  This is the output of GParted:
50841
I intend to use fsck for checking my Linux partition of the main disk, because its file system is suspicious of being not unmounted cleanly by shutting down the system. I have searched in my environment variables: none of them except of PATH should control the fsck program. But the program apparently needs to be used during a boot: :~$ fsck -V fsck from util-linux 2.20.1 Checking all file systems. [/sbin/fsck.ext4 (1) -- /] fsck.ext4 /dev/sda6  e2fsck 1.42 (29-Nov-2011) /dev/sda6 is mounted. WARNING!!!  The filesystem is mounted.   If you continue you WILL cause SEVERE filesystem damage. Do you really want to continue? no check aborted.  (There is no /forcefsck file in my root according to  . My etc/fstab file contains    # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # #                 proc            /proc           proc    nodev,noexec,nosuid 0       0 # / was on /dev/sda6 during installation UUID=1ac55d8d-c112-4bc7-9e79-921d196f9f79 /               ext4    errors=remount-ro 0       1 # swap was on /dev/sda7 during installation UUID=54f7e314-50e2-419b-a45d-47c3058ecc00 none            swap    sw              0       0 /dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0   ). According to an answer to  I have tried tune2fs hoping that I'll get the present value of the max_mounts_count parameter to be able to set it to 1 for checking the partition during the next boot. But after sudo rm /var/lib/update-notifier/fsck-at-reboot and a restart I have only got a response  :~$ tune2fs -l /dev/sda6 tune2fs 1.42 (29-Nov-2011) tune2fs: Permission denied while trying to open /dev/sda6 Couldn't find valid filesystem superblock. Can I use sudo tune2fs -l /dev/sda6 safely? Thanks.
66276
I've got a swap partition, but the System Monitor in Linux Mint says, 'Swap not available'. I guess I've forgot to set 'Use as: swap' on install.  How to fix this?
8213
I have data and files on my system, running Windows, and want to make sure that I don't lose all the data or information when it gets toasted, either by a power surge or corrupted medium.  I've heard that I should look into some kind of archive tool.  What should I be looking into here in a backup program?
11080
When you want to use hibernation and you care for security, you'd like to have the swap encrypted. But not with the random password, chosen for you at startup, but with a fixed one, supplied by you at the boot time, so the hibernated state would be available for resuming upon next boot.  There was a cool way to do this, that worked up until Mint 15:   This doesn't work anymore on Petra. Can anyone help me with working it out? The main culprit, the /usr/share/initramfs-tools/scripts/local-top script didn't change, so I guess it has something to do with the kernel. It looks like the recent kernel just ignores all the scirpt, or at least the part that asks for a password for swap.  Oh, and I was able to get the password prompt, when I accidentally booted the Mint 16 with the kernel from Mint 15.   See also a related question:       Some debug info  After opening the swap device with sudo cryptsetup luksOpen /dev/sda5 cryptswap:  sudo lsblk -o name,uuid  NAME                  UUID sda                    ├─sda1                F251-38C0 ├─sda2                c66b8e51-dd1b-4d92-8605-a3ba7df6af83 ├─sda3                77af32db-038d-4c10-b302-039634cf943a ├─sda4                7a3cde35-ab80-4618-ad76-7aa064d55f56 ├─sda5                fc068dd2-759c-4779-b521-c73cc5499e86 │ └─cryptswap (dm-1)  964eafeb-c88b-49c8-8b5e-6f8395e040b4 ├─sda6                926fa7cc-6f97-4672-85a7-a1ed8f5bd842 ├─sda7                804b9c88-907b-43d9-b23f-964c32ecc2ac └─sda8                ce2cd926-133f-4e20-86f8-45bc4844271c   └─adama-docs (dm-0) 61a32b98-3b65-4af6-81ff-da090cae039f sr0                 cat /etc/crypttab  #cryptswap1 /dev/sda5 /dev/urandom swap,cipher=aes-cbc-essiv:sha256 swap UUID=fc068dd2-759c-4779-b521-c73cc5499e86  none luks   cat /etc/fstab  UUID=926fa7cc-6f97-4672-85a7-a1ed8f5bd842   /   btrfs   defaults,subvol=@,compress,autodefrag   0   1 # /boot was on /dev/sda2 during installation UUID=c66b8e51-dd1b-4d92-8605-a3ba7df6af83   /boot   ext3    defaults    0   2 # /boot/efi was on /dev/sda1 during installation UUID=F251-38C0  /boot/efi   vfat    defaults    0   1 # /home was on /dev/sda6 during installation UUID=926fa7cc-6f97-4672-85a7-a1ed8f5bd842   /home   btrfs   defaults,subvol=@home   0   2 # /mnt/ext4 was on /dev/sda7 during installation UUID=804b9c88-907b-43d9-b23f-964c32ecc2ac   /mnt/ext4   ext4    defaults    0   0 # swap was on /dev/sda5 during installation UUID=964eafeb-c88b-49c8-8b5e-6f8395e040b4 none            swap    sw              0       0   /etc/initramfs-tools/conf.d/resume  RESUME=/dev/disk/by-uuid/964eafeb-c88b-49c8-8b5e-6f8395e040b4     update:  When I setup everything like above, the system does display the familiar password prompt. It doesn't do that every time, and if it does, it is a fraction of second before the login screen (Linux Mint uses mdm for login). I guess there is racing condition; the mounting of swap is done parallel with the system booting; I expect the system to wait booting until the swap is mounted, and do it as early as possible. Otherwise how could it resume the hibernated state?  There is a similar question for Ubuntu:  It seems, that it worked for someone if he encrypted the root as well.
8598
I'm running 14.04 on a new XPS 13. In order to support the newer hardware, I'm running a mainline 3.19 kernel.   Hibernate resume has been iffy with the entire 3.19 kernel line, but recently (3.19.5) pm-hibernate no longer works at all. The screen will either a) switch off momentarily, then back on with all inputs frozen or b) switch off entirely, and fail to resume upon power on (despite displaying the correct resume-from-uuid message).  I have enough swap space (and it has worked in the past), I have checked that the uuid is being correctly referenced, and nothing seems particularly amiss in /var/log/pm-suspend.log (last 200 lines here: )  Thanks for your help.
89735
Ok, so I know what hiberfil.sys is, and I want to use hibernation on my laptop.  But I have another hard drive active in my laptop, it's taken from my old one... and I want to get rid of the hiberfil.sys on that drive. But even with admin privileges I can't delete it.  Any ideas?
44678
The standard files/tools that report memory seem to have different formats on different Linux distributions. For example, on Arch and Ubuntu.   Arch  $ free               total        used        free      shared  buff/cache   available Mem:        8169312     3870392     2648348       97884     1650572     4110336 Swap:      16777212      389588    16387624   $ head /proc/meminfo  MemTotal:        8169312 kB MemFree:         2625668 kB MemAvailable:    4088520 kB Buffers:          239688 kB Cached:          1224520 kB SwapCached:        17452 kB Active:          4074548 kB Inactive:        1035716 kB Active(anon):    3247948 kB Inactive(anon):   497684 kB  Ubuntu  $ free              total       used       free     shared    buffers     cached Mem:      80642828   69076080   11566748    3063796     150688   58358264 -/+ buffers/cache:   10567128   70075700 Swap:     20971516    5828472   15143044   $ head /proc/meminfo  MemTotal:       80642828 kB MemFree:        11565936 kB Buffers:          150688 kB Cached:         58358264 kB SwapCached:      2173912 kB Active:         27305364 kB Inactive:       40004480 kB Active(anon):    7584320 kB Inactive(anon):  4280400 kB Active(file):   19721044 kB    So, how can I portably (across Linux distros only) and reliably get the amount of memory—excluding swap—that is available for my software to use at a particular time? Presumably that's what's shown as "available" and "MemAvailable" in the output of free and cat /proc/meminfo in Arch but how do I get the same in Ubuntu or another distribution?
7322
We have a RHEL 7 machine, with only 2G of available RAM:  free -g               total        used        free      shared  buff/cache   available Mem:             31          28           0           0           1           2 Swap:            15           9           5   so we decided to increase the swappiness to the maximum with vm.swappiness = 100 in /etc/sysctl.conf instead of 10, and used sysctl -p to apply the setting.  After some time we checked the status again:   free -g               total        used        free      shared  buff/cache   available Mem:             31          28           0           0           2           2 Swap:            15           9           5   as we can see despite the new swappiness setting, we see from free -g that the available RAM stays at 2G. Why? What is wrong here?  We expected to see 15G of used swap.  We also checked:  cat /proc/sys/vm/swappiness 100   so everything should work according to the new settings BUT free shows the same situation. What is going here?
61247
When I installed Ubuntu, I setup an encrypted home partition. Now I have come to an issue where I am running out of memory because I haven't setup swap. How can I setup an encrypted swap file?  A couple of times while booting I've seen some reference to cryptswap. I've also got these lines contained in /etc/fstab  # swap was on /dev/sda6 during installation #UUID=1ba8a53b-1842-4de7-8e38-2d6c79f3a1ab none            swap    sw              0       0 /dev/mapper/cryptswap1 none swap sw 0 0
119557
Going to install Ubuntu 10.10 on new intel x25M 80GB SSD. It will be fresh install. I have been googling for past few days and getting overwhelming articles/blogs/Q&amp;As. One particularly very useful being:     But with so many suggestions and differences of opinions (on different links) this simple OS install process seems to be daunting task to me and I really want to stick with Ubuntu (although have used for very short period of time).  Can someone help me by answering few questions (yes, they are repeated because I couldn't comprehend the answers elsewhere)   Which file system (ext2/3/4 or something else)? (consider SSD life) Can it be changed after installation? Should I partition the disk? (as we do in traditional HDD) for now, no plan of dual booting. Only Ubuntu will live on scarce space of 80GB SSD. I have 2 GB RAM, should i still allocate swap space (if I don't allocate swap space, can I still hibernate the machine)? will swap space impact SSD life? Should I consider putting additional 1GB RAM to avoid swap space? What is partition aligning? Is it needed to be done before installing the Ubuntu OS or can be done later?   Intended usage - heavy browsing, programming, regular video/music and some other non-CPU/RAM-intensive programs. Will keep big files in an external hard drive.  laptop config - 3yr old Vaio, Core2 Duo, 2GB RAM  More references:        (resizing/creating does not seem a simple process after look this)
87956
I wanted to just confirm how much the size of Swap partition should be. Lots of places tell that the swap size should be twice the size of RAM. Somebody also told me that it shouldn't be more than 8 GB.If twice the size of RAM is more than 8 GB how big should the Swap partition be?
78549
My Windows 7 (x86, Pro) laptop no longer hibernates. When I tell it via power button or "shutdown /h /f" it fades out the screen to black, but doesn't do anything else. Doesn't even go into a sleep state. Hitting a key pops the screen back on.  I've tried disabling and reenabling hibernation to clear the hiberfil.sys, but it makes no difference. If hibernation is disabled, sleep works fine.  This problem started happening immediately after swapping hard drives. I used Ghost 14 to restore a backup to a new drive then plugged it in. Windows wouldn't boot (BOOTMGR problem) so I ran a repair from the Win7 disc. It's been working fine since, aside from inability to hibernate.  Nothing is showing up in the event log that seems new or relevant.  Any ideas on how I can diagnose or resolve this?
48118
I'd love to be able to hibernate one Windows instance, boot into another, then switch back to the first instance and have it resume my hibernated state.  Is there some sort of hack or software product that would enable that, maybe by renaming the hibernation files based on the the instance I'm booting to?  I understand the technical issues with why it's not supported - I could make changes to the filesystem while I'm running instance two that would cause my hibernated state in instance one, but I'm a big boy and don't need to be protected from myself.
72391
This is a followup question to my  related to the Ubuntu 19.10 freeze where I had to restart the machine every time.   I looked up at my swapfile and it is of 2G size. I do have a 16G of RAM. But the memory that is being used by the swapfile is '0'. I don't understand what is going on with this.  $ swapon         NAME      TYPE SIZE USED PRIO         /swapfile file   2G   0B   -2 $ free                   total        used        free      shared  buff/cache   available     Mem:       16383568     2503164    11927228      477108     1953176    13073208     Swap:       2097148           0     2097148   The following is the image. Can some one help me with this?   Update: The following are the version of the NVIDIA driver I have.  +-----------------------------------------------------------------------------+ | NVIDIA-SMI 435.21       Driver Version: 435.21       CUDA Version: 10.1     | |-------------------------------+----------------------+----------------------+ | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC | | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. | |===============================+======================+======================| |   0  GeForce RTX 2080    Off  | 00000000:08:00.0  On |                  N/A | |  0%   49C    P8    17W / 225W |    394MiB /  7981MiB |      9%      Default | +-------------------------------+----------------------+----------------------+  +-----------------------------------------------------------------------------+ | Processes:                                                       GPU Memory | |  GPU       PID   Type   Process name                             Usage      | |=============================================================================| |    0      1045      G   /usr/lib/xorg/Xorg                            24MiB | |    0      1444      G   /usr/lib/xorg/Xorg                           101MiB | |    0      1652      G   /usr/bin/gnome-shell                         206MiB | |    0      6468      G   /usr/lib/firefox/firefox                       6MiB | +-----------------------------------------------------------------------------+   Update 2: The following are the results of systcl vm.swappiness and grep -i swap /etc/fstab  ~$ sysctl vm.swappiness     vm.swappiness = 60 ~$ grep -i swap /etc/fstab     /swapfile                                 none            swap    sw              0       0   Update 3: Added the result for ls -al /usr/share/gnome-shell/extensions  - Did not have the folder extensions under /.local/share/gnome-shell  $ ls -al /usr/share/gnome-shell/extensions total 20 drwxr-xr-x 5 root root 4096 Oct 17  2019 . drwxr-xr-x 6 root root 4096 Nov 27 09:32 .. drwxr-xr-x 2 root root 4096 Oct 17  2019 desktop-icons@csoriano drwxr-xr-x 3 root root 4096 Oct 17  2019 ubuntu-appindicators@ubuntu.com drwxr-xr-x 3 root root 4096 Oct 17  2019 ubuntu-dock@ubuntu.com   Update 3: Here I am attaching the drivers I am using for the NVidia. I have tried 435 but I kept on seeing some display issues with it. They come and go. They are something like this.    Now I tried the 430 in the drivers section. This seems to work fine so far. I have seen those out of order pixels but very rarely. What could be the reason for this? And I tried installinng the newly release 440 drivers for the nVidia but it kept on failing and therefore as a lost resort I had to move back to 430.