help with swap partition [solved]

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
cpowell1164

help with swap partition [solved]

Post by cpowell1164 »

hello all, so i installed mint a while back on my laptop, during said installation a friend helped me partition it manually, now i didnt create a swap partition, so i was wondering, do i need one with 4gb of ram and how can i create one when i only have one hard drive on my system , thanks in advance

edit: cheers for all the help folks :D
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.
j03k3rr

Re: help with swap partition

Post by j03k3rr »

cpowell1164 wrote:hello all, so i installed mint a while back on my laptop, during said installation a friend helped me partition it manually, now i didnt create a swap partition, so i was wondering, do i need one with 4gb of ram and how can i create one when i only have one hard drive on my system , thanks in advance
Swap partition is not crucial but it is necessary. I think you can't hibernate your computer without it. Install or launch the program named "Gparted" it can let you shrink/resize and create partitions. But be very careful, if you're asking this in forum chances you may make a mistake and lose data is very high.
Try to get help from that friend of yours.

Technically you don't need another physical drive in order to create a swap partition. All partitions can be on same drive, like slices of a cake.
tolkien

Re: help with swap partition

Post by tolkien »

You can also create a swap file. See here:
http://askubuntu.com/questions/327186/c ... ive#327194
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: help with swap partition

Post by austin.texas »

cpowell1164 wrote:so i was wondering, do i need one with 4gb of ram
A good rule is to make your swap partition slightly bigger than your installed ram.
If you have 4 GB of ram, make the swap partition slightly bigger than 4 GB.
You can chose the normal procedure of re-sizing one of your partitions on your hard drive to make room for a swap partition.
Alternatively, you can create a swap file, as a substitute for a swap partition - as noted by tolkien .
You can do that manually, or install a package called swapspace

Code: Select all

sudo apt-get install swapspace
(auto-generates swap files when needed, and removes them when no longer needed).
I have no idea if swapspace allows hybernation, however...
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
cpowell1164

Re: help with swap partition

Post by cpowell1164 »

i appreciate the help guys <3
User avatar
Reorx
Level 12
Level 12
Posts: 4044
Joined: Tue Jul 07, 2009 7:14 pm
Location: SE Florida, USA

Re: help with swap partition

Post by Reorx »

Just out of curiosity, could you please post the output of this terminal command >>>

Code: Select all

inxi -p
Full time Linux Mint user since 2011 - Currently running LM21C on multiple Dell laptops - mostly Vostro models.

Image Image Image
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: help with swap partition

Post by austin.texas »

Reorx wrote:Just out of curiosity, could you please post the output of this terminal command >>>

Code: Select all

inxi -p
Now I feel dumb, Reorx. I should have thought of that myself...
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
cpowell1164

Re: help with swap partition

Post by cpowell1164 »

austin.texas wrote:
Reorx wrote:Just out of curiosity, could you please post the output of this terminal command >>>

Code: Select all

inxi -p
Now I feel dumb, Reorx. I should have thought of that myself...
cpowell1164@cpowell1164-Lenovo-G50-30:~ > inxi -p
Partition: ID: / size: 30G used: 7.4G (27%) fs: ext4 ID: /boot size: 479M used: 46M (11%) fs: ext4
ID: /home size: 200G used: 37G (20%) fs: ext4
cpowell1164@cpowell1164-Lenovo-G50-30:~ >

ere ya go
User avatar
Reorx
Level 12
Level 12
Posts: 4044
Joined: Tue Jul 07, 2009 7:14 pm
Location: SE Florida, USA

Re: help with swap partition

Post by Reorx »

austin.texas wrote:
Reorx wrote:Just out of curiosity, could you please post the output of this terminal command >>>

Code: Select all

inxi -p
Now I feel dumb, Reorx. I should have thought of that myself...
No need to feel dumb austin... the are many paths to the same destination... I should have asked for a Gparted screen shot! :lol: If there is unallocated space on the disk, creating a swap partition would (probably) be relatively easy... :mrgreen:
Full time Linux Mint user since 2011 - Currently running LM21C on multiple Dell laptops - mostly Vostro models.

Image Image Image
kukamuumuka

Re: help with swap partition

Post by kukamuumuka »

You can make a swapfile. An example: about 4,5 GB swapfile

Code: Select all

sudo dd if=/dev/zero of=/swap bs=1024 count=4621440
sudo mkswap /swap
sudo swapon /swap
Add the swapfile to the /etc/fstab

Code: Select all

sudo nano /etc/fstab
.. add the line

Code: Select all

/swap swap swap defaults 0 0
... save and quit
Ctrl o
Ctrl x
Locked

Return to “Beginner Questions”