No swap space

Archived topics about LMDE 1
Forum rules
dimi
Level 1
Level 1
Posts: 12
Joined: Sun Apr 15, 2012 4:43 am

No swap space

Postby dimi » Fri Nov 30, 2012 2:23 pm

I recently realized my LMDE installation doesn't have swap space. When I open too many tabs in Chromium it just becomes really slow or even halts. How can I create swap space or a swap file?

User avatar
bigj231
Level 5
Level 5
Posts: 790
Joined: Fri Feb 26, 2010 10:16 am
Location: Middle of Nowhere
Contact:

Re: No swap space

Postby bigj231 » Sat Dec 01, 2012 2:50 pm

You'll have to repartition your disks and make a swap partition. Make a complete system backup on another drive before you try changing anything with your disks. Or you could install more RAM. RAM is faster than swap.
Running on a 4-slot toaster @ 60Hz

Ken_g6
Level 1
Level 1
Posts: 20
Joined: Fri May 11, 2012 12:43 pm

Re: No swap space

Postby Ken_g6 » Sat Dec 01, 2012 3:00 pm

Alternatively, it ought to be possible to make a swap file. But I haven't tried it. The of= path should probably be something like /var/tmp/swapfile for an installation as opposed to a LiveCD, and I'm not at all sure how to make it automatic on boot.

User avatar
bigj231
Level 5
Level 5
Posts: 790
Joined: Fri Feb 26, 2010 10:16 am
Location: Middle of Nowhere
Contact:

Re: No swap space

Postby bigj231 » Sat Dec 01, 2012 5:05 pm

You could probably make that swapfile and then add it to your fstab. I moved my /tmp to RAM this way.
Running on a 4-slot toaster @ 60Hz

widget
Level 3
Level 3
Posts: 167
Joined: Thu May 14, 2009 2:49 am
Location: S.E. Montana

Re: No swap space

Postby widget » Sun Dec 02, 2012 11:59 am

dimi wrote:I recently realized my LMDE installation doesn't have swap space. When I open too many tabs in Chromium it just becomes really slow or even halts. How can I create swap space or a swap file?

Please post the output of \;

Code: Select all

sudo fdisk l

That is a lower case L.
Dell XPS 420 Core2 Quad Q 6600, audigy5.1, Radeon HD 6450 - currently 4 320Gb HDD, Debian Squeeze for secure use, Debian testing for daily use, Debian Sid for fun.

dimi
Level 1
Level 1
Posts: 12
Joined: Sun Apr 15, 2012 4:43 am

Re: No swap space

Postby dimi » Sun Dec 02, 2012 12:54 pm

Code: Select all

$ sudo fdisk l
fdisk: unable to open l: Bestand of map bestaat niet

Translation: File or folder doesn't exist.

axel112
Level 1
Level 1
Posts: 6
Joined: Sun Jan 08, 2012 7:16 am

Sv: No swap space

Postby axel112 » Sun Dec 02, 2012 12:59 pm

sudo fdisk -l

dimi
Level 1
Level 1
Posts: 12
Joined: Sun Apr 15, 2012 4:43 am

Re: No swap space

Postby dimi » Sun Dec 02, 2012 2:44 pm

Code: Select all

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x52fe08c8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1       209921355   625137344   207607995   83  Linux
/dev/sda2   *        2048      204799      101376    7  HPFS/NTFS/exFAT
/dev/sda3          204800   209919999   104857600    7  HPFS/NTFS/exFAT

Partition table entries are not in disk order

widget
Level 3
Level 3
Posts: 167
Joined: Thu May 14, 2009 2:49 am
Location: S.E. Montana

Re: No swap space

Postby widget » Tue Dec 04, 2012 3:45 pm

Sorry about that. Sometimes I just can't type.

I am not sure where your sda3 partition is but it is a nice large partition that probably has a good chunk of empty space at the end of it.

Swap can be anywhere on the drive. It also wil need to be in you /etc/fstab file so that your install can find it.

While backing up your data when doing any partitioning is a good idea and you should do it there is little chance of it going sour. The big problem with MS related partitions is a certain pickyness about exactly where they start. In this case that will not be a problem.

I would fire up your Live CD/DVD and shrink that sda3 partition to create the space for swap. I would think 1 or 2 gigs would be plenty but many recommend 2 times your amount of ram. That is up to you. Shrinking the partition using gparted will be fine. Shrink it from the right end (empty end) to the left.

Create a partition in the space left by that shrinkage formatted to "linux swap".

You will need to edit the /etc/fstab file to have an entry like;

Code: Select all

#Entry for /dev/sda4 :
UUID=2758aefb-1847-42ea-92c0-cefddf6a8460   none   swap     sw   0   0

The first line that is commented out is not really needed but is always included by default when the fstab is generated by the installer and I kind of like the information.

The second line is what does the job of telling your OS where to look for swap. The uuid info needs to be in that format. You can get the uuid of /swap by running;

Code: Select all

sudo blkid

You can copy paste the info from terminal to your text editor but you will need to remove the quotation marks from the uuid from the terminal. Copy/paste is the way to go as it is a long number.

If you have never pulled up a file in a text editor it should be done this way;

Code: Select all

sudo gedit /etc/fstab

"gedit" can be replaced by what ever text editor you have or like to use.

You can do that from your Live Session or wait until you log back into your install. If you do it from inside your install you will have to log out and back in to have it take effect as the fstab is read as part off booting up.
Dell XPS 420 Core2 Quad Q 6600, audigy5.1, Radeon HD 6450 - currently 4 320Gb HDD, Debian Squeeze for secure use, Debian testing for daily use, Debian Sid for fun.

mintybits
Level 6
Level 6
Posts: 1122
Joined: Fri Jan 27, 2012 5:09 pm

Re: No swap space

Postby mintybits » Tue Dec 04, 2012 4:03 pm



Return to “Archive”

Who is online

Users browsing this forum: No registered users and 6 guests