LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-28-2010, 03:55 PM   #1
Dblackner
LQ Newbie
 
Registered: Oct 2010
Location: If you guys know Michigan, I'm between the palm and thumb
Distribution: Arch Linux
Posts: 3

Rep: Reputation: 0
Having trouble with my swap file


I am not sure what I am doing wrong, I am trying to create a swap file
512 megs in size, what I've done so far is:
#dd if=/dev/zero of=/swapfile2 bs=1024 count=524288
then i allocated an area to be swapped
#mkswap /swapfile2
I activated it and everything was fine
#swapon /swapfile2
i rebooted linux and added the entry to etc/fstab file
but when I try to open it with vi
#vi /etc/fstab ( I appended the following line, but it will not open)
i cannot verify if the swap has activated
I just get an error message saying invalid media type reading drive ,
what am I doing wrong?
Thanks ahead of time
-D
 
Old 10-28-2010, 04:28 PM   #2
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 54
what am I doing wrong?
Not reading the man page for swapon, to put it bluntly.
Quote:
swapon -s, --summary
Display swap usage summary by device. Equivalent to "cat /proc/swaps".
sudo vi /etc/fstab will let you change the partitions that are mounted at boot, but won't tell you if the swap is on or off.
 
Old 10-29-2010, 08:50 AM   #3
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
You should have added it to fstab BEFORE rebooting.

Add this to fstab:

Code:
/swapfile2       swap            swap        defaults        0   0
then reboot.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
swap file vs. swap partition verndog Ubuntu 16 07-09-2012 08:49 PM
Having trouble partitioning IDE HD for swap file to install v13.0 64bit mothergoose729 Slackware 2 11-20-2009 08:14 AM
Can swap file or a swap partition be mounted and read? Mr-Bisquit Linux - General 3 06-08-2009 02:16 PM
SWAP - having trouble with swap auto mounting at boot lostdj Linux - General 2 08-05-2008 12:47 PM
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 08:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration