Problem about swap partition from newbie.-.

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
legion101098

Problem about swap partition from newbie.-.

Post by legion101098 »

I've just switched from XP to linux mint mate 18.3, and i've made some partitions, like efi, /home, swap, and root. For me it is pretty good OS, but when i checked the partition, i noticed that the swap partition on the off condition, so i tried to activate it, and then this message showed up ; swapon failed : device or resource busy. So, what does it mean by that? hope can find help for this question :) :)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Sir Charles

Re: Problem about swap partition from newbie.-.

Post by Sir Charles »

Could you please run the following commands one by one in a terminal and post the output here?

Code: Select all

swapon -s

Code: Select all

lsblk

Code: Select all

cat /etc/fstab

Code: Select all

sudo blkid -o list
Copy the output of each command you get in the terminal and paste it between code tags </> from the toolbar above the "edit-box".
legion101098

Re: Problem about swap partition from newbie.-.

Post by legion101098 »

Code: Select all

christofer@christofer-HP-ENVY-TS-14-Sleekbook ~ $ swapon -s
Filename				Type		Size	Used	Priority
/dev/dm-0                              	partition	24413692	0	-1
christofer@christofer-HP-ENVY-TS-14-Sleekbook ~ $ lsblk
NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sdb              8:16   0  22,4G  0 disk  
sda              8:0    0 698,7G  0 disk  
├─sda4           8:4    0   395G  0 part  /home
├─sda2           8:2    0   525M  0 part  /boot/efi
├─sda5           8:5    0 279,4G  0 part  /
├─sda3           8:3    0  23,3G  0 part  
│ └─cryptswap1 253:0    0  23,3G  0 crypt [SWAP]
└─sda1           8:1    0   525M  0 part  /boot
christofer@christofer-HP-ENVY-TS-14-Sleekbook ~ $ cat /etc/fstab
# /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).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=3cdaf3f6-93da-4851-8f8e-d0371737dd64 /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=5013eb9c-454e-40b1-abc3-00104649f9ce /boot           ext4    defaults        0       2
# /boot/efi was on /dev/sda2 during installation
UUID=2BF2-668E  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sda4 during installation
UUID=ecba6706-ef1c-48f1-bcc9-379be1ff0f41 /home           ext4    defaults        0       2
# swap was on /dev/sda3 during installation
#UUID=9368ac4d-5462-4af3-a90d-af013e226bd4 none            swap    sw              0       0
/dev/mapper/cryptswap1 none swap sw 0 0
christofer@christofer-HP-ENVY-TS-14-Sleekbook ~ $ sudo blkid -o list
[sudo] password for christofer: 
device     fs_type label    mount point    UUID
-------------------------------------------------------------------------------
/dev/sda1  ext4             /boot          5013eb9c-454e-40b1-abc3-00104649f9ce
/dev/sda2  vfat             /boot/efi      2BF2-668E
/dev/sda3  swap             (in use)       9368ac4d-5462-4af3-a90d-af013e226bd4
/dev/sda4  ext4             /home          ecba6706-ef1c-48f1-bcc9-379be1ff0f41
/dev/sda5  ext4             /              3cdaf3f6-93da-4851-8f8e-d0371737dd64
/dev/mapper/cryptswap1
           swap             [SWAP]         4354dd64-3f00-49e8-b589-e070bcd5b3ff
/dev/sdb                    (not mounted)  
here it is bro, hope you can analyze it. Thanks.
legion101098

Re: Problem about swap partition from newbie.-.

Post by legion101098 »

Marziano wrote: Mon May 21, 2018 1:32 pm Could you please run the following commands one by one in a terminal and post the output here?

Code: Select all

swapon -s

Code: Select all

lsblk

Code: Select all

cat /etc/fstab

Code: Select all

sudo blkid -o list
Copy the output of each command you get in the terminal and paste it between code tags </> from the toolbar above the "edit-box".

Code: Select all

Code: Select all

christofer@christofer-HP-ENVY-TS-14-Sleekbook ~ $ swapon -s
Filename				Type		Size	Used	Priority
/dev/dm-0                              	partition	24413692	0	-1
christofer@christofer-HP-ENVY-TS-14-Sleekbook ~ $ lsblk
NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sdb              8:16   0  22,4G  0 disk  
sda              8:0    0 698,7G  0 disk  
├─sda4           8:4    0   395G  0 part  /home
├─sda2           8:2    0   525M  0 part  /boot/efi
├─sda5           8:5    0 279,4G  0 part  /
├─sda3           8:3    0  23,3G  0 part  
│ └─cryptswap1 253:0    0  23,3G  0 crypt [SWAP]
└─sda1           8:1    0   525M  0 part  /boot
christofer@christofer-HP-ENVY-TS-14-Sleekbook ~ $ cat /etc/fstab
# /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).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=3cdaf3f6-93da-4851-8f8e-d0371737dd64 /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=5013eb9c-454e-40b1-abc3-00104649f9ce /boot           ext4    defaults        0       2
# /boot/efi was on /dev/sda2 during installation
UUID=2BF2-668E  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sda4 during installation
UUID=ecba6706-ef1c-48f1-bcc9-379be1ff0f41 /home           ext4    defaults        0       2
# swap was on /dev/sda3 during installation
#UUID=9368ac4d-5462-4af3-a90d-af013e226bd4 none            swap    sw              0       0
/dev/mapper/cryptswap1 none swap sw 0 0
christofer@christofer-HP-ENVY-TS-14-Sleekbook ~ $ sudo blkid -o list
[sudo] password for christofer: 
device     fs_type label    mount point    UUID
-------------------------------------------------------------------------------
/dev/sda1  ext4             /boot          5013eb9c-454e-40b1-abc3-00104649f9ce
/dev/sda2  vfat             /boot/efi      2BF2-668E
/dev/sda3  swap             (in use)       9368ac4d-5462-4af3-a90d-af013e226bd4
/dev/sda4  ext4             /home          ecba6706-ef1c-48f1-bcc9-379be1ff0f41
/dev/sda5  ext4             /              3cdaf3f6-93da-4851-8f8e-d0371737dd64
/dev/mapper/cryptswap1
           swap             [SWAP]         4354dd64-3f00-49e8-b589-e070bcd5b3ff
/dev/sdb                    (not mounted)  

here it is bro, hope you can analyze it. Thanks.
Sir Charles

Re: Problem about swap partition from newbie.-.

Post by Sir Charles »

Hi legion101098,
First of all, I have to admit that this is a bit of "research area" for me, still being somewhat of a new-beginner myself but I am sure the information you provide will be helpful to the more advanced forum members.
By the looks of it

Code: Select all

christofer@christofer-HP-ENVY-TS-14-Sleekbook ~ $ swapon -s
Filename				Type		Size	Used	Priority
/dev/dm-0                              	partition	24413692	0	-1
suggests that the swap partition is already activated, if I am not mistaken. So if you don't mind, would you run the following commands and post back the output:

Code: Select all

sudo cryptsetup status cryptswap1
Thanks!
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Problem about swap partition from newbie.-.

Post by rene »

You needn't really bother posting more information it seems as the swapon -s output indicates a 24G swap partition (/dev/dm-0) being active.

24G is very large and useful only if you want it around in order to hibernate, but active it is. I expect you just noticed none being in use rather than inactive / "on the off condition"? The output of free will tell as well. Swap is (essentially) used only when real RAM fills up; if you also have 24G of RAM it's not surprising that swap will never be touched under normal circumstances.
legion101098

Re: Problem about swap partition from newbie.-.

Post by legion101098 »

Code: Select all

christofer@christofer-HP-ENVY-TS-14-Sleekbook ~ $ sudo cryptsetup status cryptswap1
[sudo] password for christofer: 
/dev/mapper/cryptswap1 is active and is in use.
  type:    PLAIN
  cipher:  aes-xts-plain64
  keysize: 256 bits
  device:  /dev/sda3
  offset:  1024 sectors
  size:    48827392 sectors
  mode:    read/write
does it mean active ?
thanks by the way
Sir Charles

Re: Problem about swap partition from newbie.-.

Post by Sir Charles »

legion101098 wrote: Tue May 22, 2018 11:53 am

Code: Select all

~ $ sudo cryptsetup status cryptswap1
[sudo] password for christofer: 
/dev/mapper/cryptswap1 is active and is in use.
does it mean active ?
Yes, it does. Please refer to rene's explanation above as to why you probably see that nothing is being swapped to the swap partition.
legion101098

Re: Problem about swap partition from newbie.-.

Post by legion101098 »

thanks bro, for your explanation
Sir Charles

Re: Problem about swap partition from newbie.-.

Post by Sir Charles »

You are welcome!
If you are satisfied with the outcome of the thread regarding your issue, please take a moment to mark it as solved by editing your first post and adding [SOLVED] to the title of the thread.

Cheers
Marziano
Locked

Return to “Beginner Questions”