Enabling swap on LMDE (Solved)
Forum rules
LMDE 2 has reached end of support as of 1-1-2019
LMDE 2 has reached end of support as of 1-1-2019
Enabling swap on LMDE (Solved)
When I installed LMDE I pre-partitioned my system's HD; this is how it looks.
When I installed LMDE I thought that Linux would recognize the swap partition, and use it; but now I see that that isn't so.
That fact leads me to ask 'How does one enable LMDE's use of a swap partition when that partition is alread defined?'
TIA
When I installed LMDE I thought that Linux would recognize the swap partition, and use it; but now I see that that isn't so.
That fact leads me to ask 'How does one enable LMDE's use of a swap partition when that partition is alread defined?'
TIA
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Enabling swap on LMDE
How so?When I installed LMDE I thought that Linux would recognize the swap partition, and use it; but now I see that that isn't so.
According to the image you posted the swap partition is recognised as shown in gparted.
You can also use
Code: Select all
inxi -plu
Linux Mint 21.3 Cinnamon
Re: Enabling swap on LMDE
To answer your question, I used gparted on a live CD. I formatted sda2 as swap when I did so; I now believe doing so unintentionally masks the situation.kyphi wrote:How so?When I installed LMDE I thought that Linux would recognize the swap partition, and use it; but now I see that that isn't so.
According to the image you posted the swap partition is recognised as shown in gparted.
You can also usein a terminal to see your swap partition.Code: Select all
inxi -plu
Output of inxi -plu:
alan@lmde1 ~ $ inxi -plu
Partition: ID: / size: 58G used: 16G (28%) fs: ext3 dev: /dev/sda1
label: N/A uuid: cb82582b-c476-49f2-baa6-89b9b99e4894
ID: /home size: 168G used: 16G (10%) fs: ext3 dev: /dev/sda3
As it may help, this is how how my /etc/fstab looks.
Last edited by AlanWalker on Mon May 05, 2014 8:26 pm, edited 2 times in total.
Re: Enabling swap on LMDE
I see what you mean. Using inxi -l this is what I have (our partitioning looks similar except for swap):
Partition: ID: / size: 12G used: 5.0G (45%) fs: ext4 dev: /dev/sda1 label: N/A
ID: /home size: 95G used: 37G (41%) fs: ext4 dev: /dev/sda3 label: N/A
ID: swap-1 size: 4.29GB used: 0.00GB (0%) fs: swap dev: /dev/sda2 label: N/A
Partition: ID: / size: 12G used: 5.0G (45%) fs: ext4 dev: /dev/sda1 label: N/A
ID: /home size: 95G used: 37G (41%) fs: ext4 dev: /dev/sda3 label: N/A
ID: swap-1 size: 4.29GB used: 0.00GB (0%) fs: swap dev: /dev/sda2 label: N/A
Linux Mint 21.3 Cinnamon
Re: Enabling swap on LMDE
This should have been sorted out during installation regardless of what you did with the live DVD.
http://www.cyberciti.biz/faq/linux-add- ... ile-howto/
http://www.cyberciti.biz/faq/linux-add- ... ile-howto/
Linux Mint 21.3 Cinnamon
Re: Enabling swap on LMDE
As it happens I had previously looked at the page you cite whilekyphi wrote:This should have been sorted out during installation regardless of what you did with the live DVD.
http://www.cyberciti.biz/faq/linux-add- ... ile-howto/
researching this problem. I moved on as the instructions were for
creating a swap file in "/". As you cited that page I decided to take
a closer look and try altering commands to work with a swapfile
on sda2.
Following on your cite (with alters to suit my system) I prepared
the following list of commands to setup my system to use swap:
1. dd if=/dev/zero of=/sda2/swapfile
2. mkswap /sda2/swapfile
3. chown root:root /sda2/swapfile
4. chmod 0600 /sda2/swapfile
5. swapon /sda2/swapfile
Command in Line 1. above is intended to create and zero out a file on
sda2 instead of "/".
Proceeding as per above, and as root, I entered the command:
"dd if=/dev/zero of=/sda2/swapfile"
The system responded with:
"dd: failed to open ‘/sda2/swapfile’: No such file or directory"
Is this because sda2 isn't mounted?
Re: Enabling swap on LMDE
@AlanWalker
In a Terminal Window run this command:
Add the following line to your '/etc/fstab' file using the UUID obtained from the 'blkid' command for your 'swap' partition in place of my example (xxxxxxxxxyyyyyyyyyyyyyyyzzzzzzzzzzz):
Save the '/etc/fstab' file.
Run the following command:
Or REBOOT.
To check status of your 'swap' partition, run this command:
.
In a Terminal Window run this command:
Code: Select all
sudo blkid
Code: Select all
UUID=xxxxxxxxxyyyyyyyyyyyyyyyzzzzzzzzzzz none swap sw 0 0
Run the following command:
Code: Select all
sudo swapon -a
To check status of your 'swap' partition, run this command:
Code: Select all
sudo swapon -s
Re: Enabling swap on LMDE
Depending on how much RAM you have installed, the absence of a swap partition may not be all that important.
I understand that you used gparted from the live DVD but have you got it installed now? If so, in gparted click on the swap partition and then open Partition from the top menu. That should state that the swap partition is "Active" and also its UUID.
If necessary edit your /etc/fstab file with sudo and enter the UUID followed by "none swap sw 0 0" so that it looks similar to this:
# swap was on /dev/sda2 during installation
UUID=fec38302-1ex8-415c-af12-f63e9428b491 none swap sw 0 0
Save before exit. the "none" entry refers to the mount point (swap is not mounted).
I understand that you used gparted from the live DVD but have you got it installed now? If so, in gparted click on the swap partition and then open Partition from the top menu. That should state that the swap partition is "Active" and also its UUID.
If necessary edit your /etc/fstab file with sudo and enter the UUID followed by "none swap sw 0 0" so that it looks similar to this:
# swap was on /dev/sda2 during installation
UUID=fec38302-1ex8-415c-af12-f63e9428b491 none swap sw 0 0
Save before exit. the "none" entry refers to the mount point (swap is not mounted).
Linux Mint 21.3 Cinnamon
Re: Enabling swap on LMDE
That did it!martywd wrote:@AlanWalker
In a Terminal Window run this command:Add the following line to your '/etc/fstab' file using the UUID obtained from the 'blkid' command for your 'swap' partition in place of my example (xxxxxxxxxyyyyyyyyyyyyyyyzzzzzzzzzzz):Code: Select all
sudo blkid
Save the '/etc/fstab' file.Code: Select all
UUID=xxxxxxxxxyyyyyyyyyyyyyyyzzzzzzzzzzz none swap sw 0 0
Run the following command:Or REBOOT.Code: Select all
sudo swapon -a
To check status of your 'swap' partition, run this command:.Code: Select all
sudo swapon -s
Thanks.
Re: Enabling swap on LMDE (Solved)
I've 1.9gb of available ram on this system (Lenovo T500) and I've never seen more than 60% of it in use at the most demanding of times. I was interested in how to enable swap because I was irked that space had been made available but not usable.kyphi wrote:Depending on how much RAM you have installed, the absence of a swap partition may not be all that important.
I understand that you used gparted from the live DVD but have you got it installed now? If so, in gparted click on the swap partition and then open Partition from the top menu. That should state that the swap partition is "Active" and also its UUID.
If necessary edit your /etc/fstab file with sudo and enter the UUID followed by "none swap sw 0 0" so that it looks similar to this:
# swap was on /dev/sda2 during installation
UUID=fec38302-1ex8-415c-af12-f63e9428b491 none swap sw 0 0
Save before exit. the "none" entry refers to the mount point (swap is not mounted).
So! I've learned several new things from you and martywd. Time to add them to my notes.
I'll be back (I have other questions).
Thanks!
Re: Enabling swap on LMDE
Glad it worked for ya.AlanWalker wrote: That did it! :D
Thanks.
One thing I should have added. If you haven't done so already, comment out with '#' at the beginning of that _old_ '/dev/sda2' line in your '/etc/fstab' file.
Code: Select all
/dev/sda2 Unknown defaults 0 0
And. Edit the title of this post to add: [Solved] if you feel inclined?
.
Re: Enabling swap on LMDE
Done on both counts.martywd wrote:Glad it worked for ya.AlanWalker wrote: That did it!
Thanks.
One thing I should have added. If you haven't done so already, comment out with '#' at the beginning of that _old_ '/dev/sda2' line in your '/etc/fstab' file.It might cause you headaches on boot up or reboots otherwise.Code: Select all
/dev/sda2 Unknown defaults 0 0
And. Edit the title of this post to add: [Solved] if you feel inclined?
.
Thanks.