I installed linux and forgot to create a swap space partition
I don't want to repartition anything anymore. Is it possible to use swap space in a filesystem?
Thanks in advance! |
is there any unpartitioned/free space on any hard disks?
|
There is no unpartitioned space, but there is free space on a partition.
|
Yes, it is possible to use a file as swap space just like windows but it will not be as fast as a swap partition. If you have free space you can resize an existing partiton and then create a swap partition.
Here is an example for a swap file: dd if=/dev/zero of=/usr/local/newswap bs=1000000 count=20 (20mb swap file) chmod 600 /usr/local/newswap mkswap /usr/loca/newswap swapon /usr/local/newswap Then add this line to your /etc/fstab /usr/local/newswap swap swap defaults 0 0 BTW you can change the location of the swap file. If you create a swap partition the steps will be mkswap /dev/hdxy swapon /dev/hdxy And the fstab /dev/hdxy swap swap defaults 0 0 Where hdxy is the ID of the swap partition. |
Thanks, michaelk, that's all I needed to know. I had a similar 'issue'. I just didn't know how to tell /etc/fstab to use swap.
(Isn't it a great thing that LQ has a Search function?! :D ) |
Quote:
|
All times are GMT -5. The time now is 12:47 PM. |