LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Having trouble with my swap file (https://www.linuxquestions.org/questions/linux-software-2/having-trouble-with-my-swap-file-841027/)

Dblackner 10-28-2010 03:55 PM

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

impert 10-28-2010 04:28 PM

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.

H_TeXMeX_H 10-29-2010 08:50 AM

You should have added it to fstab BEFORE rebooting.

Add this to fstab:

Code:

/swapfile2      swap            swap        defaults        0  0
then reboot.


All times are GMT -5. The time now is 05:26 PM.