Problem about swap partition from newbie.-.

All Gurus once were Newbies
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. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
legion101098
Level 1
Level 1
Posts: 16
Joined: Mon May 21, 2018 11:22 am

Problem about swap partition from newbie.-.

Post by legion101098 » Mon May 21, 2018 11:35 am

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

User avatar
Sir Charles
Level 7
Level 7
Posts: 1832
Joined: Thu Jan 04, 2018 1:00 pm

Re: Problem about swap partition from newbie.-.

Post by Sir Charles » 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".
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

legion101098
Level 1
Level 1
Posts: 16
Joined: Mon May 21, 2018 11:22 am

Re: Problem about swap partition from newbie.-.

Post by legion101098 » Mon May 21, 2018 11:28 pm

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
Level 1
Level 1
Posts: 16
Joined: Mon May 21, 2018 11:22 am

Re: Problem about swap partition from newbie.-.

Post by legion101098 » Mon May 21, 2018 11:29 pm

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.

User avatar
Sir Charles
Level 7
Level 7
Posts: 1832
Joined: Thu Jan 04, 2018 1:00 pm

Re: Problem about swap partition from newbie.-.

Post by Sir Charles » Tue May 22, 2018 4:15 am

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!
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

rene
Level 8
Level 8
Posts: 2182
Joined: Sun Mar 27, 2016 6:58 pm

Re: Problem about swap partition from newbie.-.

Post by rene » Tue May 22, 2018 5:58 am

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
Level 1
Level 1
Posts: 16
Joined: Mon May 21, 2018 11:22 am

Re: Problem about swap partition from newbie.-.

Post by legion101098 » Tue May 22, 2018 11:53 am

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

User avatar
Sir Charles
Level 7
Level 7
Posts: 1832
Joined: Thu Jan 04, 2018 1:00 pm

Re: Problem about swap partition from newbie.-.

Post by Sir Charles » Tue May 22, 2018 12:33 pm

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.
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

legion101098
Level 1
Level 1
Posts: 16
Joined: Mon May 21, 2018 11:22 am

Re: Problem about swap partition from newbie.-.

Post by legion101098 » Wed May 23, 2018 4:00 am

thanks bro, for your explanation

User avatar
Sir Charles
Level 7
Level 7
Posts: 1832
Joined: Thu Jan 04, 2018 1:00 pm

Re: Problem about swap partition from newbie.-.

Post by Sir Charles » Wed May 23, 2018 4:03 am

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
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

Post Reply

Return to “Newbie Questions”