LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   SWAP area (https://www.linuxquestions.org/questions/linux-software-2/swap-area-126231/)

ALF 12-15-2003 11:09 PM

SWAP area
 
Hi,

I created a SWAP area under the /var directory and the desk space now for /var is 100%.

I tried to remove log and spool files and still 100%.

How can I get rid now of the swap AREA and .. lets say .. move it under /home? I mean can I partition /home without destroying it ?

.. and also where the desk space that I recovered is gone?

Alf

whansard 12-15-2003 11:13 PM

i can't really tell if you are talking about a swap file or a swap partition.
parted will let you change partition sizes, and add partitions, but
you'll have to make changes to fstab yourself.

if you're talking about a swap file, you can swapoff <filename>,
then delete the file. then you can create a new swapfile.
if you want to make one of 200 megs, then
dd if=/dev/zero of=swapfile.name bs=1M count=200
put it whereever you wish.
mkswap swapfile.name
swapon swapfile.name

add swapon swapfile name to some startup script.

ALF 12-15-2003 11:43 PM

SAWP File?
 
Thanks very much for your help. I really don't know how I can tell if it is SAWP file or SWAP Partition?

I think it is SAWP partition - that's what I can see when I issue the command
df -k.

I don't know is

dd if=/dev/zero of=swapfile.name bs=1M count=200

can be issued from command line (if it turn to be a swap file)

Alf

whansard 12-16-2003 01:49 AM

that dd command is something to run from the command line.
it just creates a 200 meg empty file that you can format as swap
and then mount as swap.
if your swap was created by an installer then it is most likely a swap
partition.
you should substitute the full path of where you want the file to be if you
make one. the of=/full/path/to/file.name of the dd command determines
where the file is written and what it's name is.

ALF 12-16-2003 12:59 PM

Mount SWAP
 
Ok, dd is to convert and copy a file. It started to make sense now. it is very much like creating a partition and formatting it with zeros.

I'm not really quite familiar with mount and how it work with directories. Is there a good tutorial for that or if you can explain to me how UNIX handle that?

I mean you can mount a partition as subdirectory or have many subdirectories under a single partition.

Thanks

Alf

whansard 12-16-2003 03:11 PM

here dd is creating a file of zeros.

you don't mount a swapfile. you just use swapon <filename>
you make an empty file a swap file with mkswap


All times are GMT -5. The time now is 06:23 AM.