help with swap partition [solved]

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
cpowell1164
Level 1
Level 1
Posts: 15
Joined: Sat Nov 14, 2015 1:03 pm

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 cpowell1164 on Sun Nov 15, 2015 3:45 pm, edited 1 time in total.
j03k3rr
Level 4
Level 4
Posts: 208
Joined: Fri Aug 28, 2015 7:03 am

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.
● Windows 10 Pro 64
VMware Workstation 12 ○ Mint 18 ○ Elementary OS 0.3
● Ubuntu Server 14.04.03 Headless
Virtualbox 5.0.26 ○ Windows 7 64
● Linux Mint 18 Cinnamon 64
tolkien
Level 2
Level 2
Posts: 72
Joined: Sat Nov 14, 2015 9:50 am

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: 12046
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
Level 1
Level 1
Posts: 15
Joined: Sat Nov 14, 2015 1:03 pm

Re: help with swap partition

Post by cpowell1164 »

i appreciate the help guys <3
User avatar
Reorx
Level 12
Level 12
Posts: 4031
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 mostly LM19C and a little LM20C.

Image Image Image
User avatar
austin.texas
Level 20
Level 20
Posts: 12046
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
Level 1
Level 1
Posts: 15
Joined: Sat Nov 14, 2015 1:03 pm

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: 4031
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 mostly LM19C and a little LM20C.

Image Image Image
User avatar
kukamuumuka
Level 16
Level 16
Posts: 6747
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

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
Post Reply

Return to “Newbie Questions”