Hallo.
I know similar subjects have appeared several times but i need to know how i can completely remove the swap partition, not just extend my swap memory (swap partition) by adding space via swap files.
After searching here and there i found the following method that adds a swap file :
How to add more Linux Swap with Swap File
Assuming you want to put it in "/", Create an empty 500MB file
$ sudo dd if=/dev/zero of=/swap.img bs=1024k count=512
Format it as a swap file
$ sudo mkswap /swap.img
Add it to your running Linux system
$ sudo swapon /swap.img
Optionally you can add /swap.img to fstab for automatic swap activation.
$ sudo gedit /etc/fstab
Add this line at the end of the file
/swap.img none swap sw 0 0
Run "free -m" command to verify that you've added the newly created swap to your Linux based operating system.
I have a Dell Inspiron E1505 with a sata I 320Gb hdd.
Now since there is a limit of partitions that can be created under linux (i think 15 including extended and all inside it) and for some reason i need the most out of it, could you please tell me how i can completely remove the swap partition and use a swap file so that each linux rests in only one partition?
My layout looked like this :
...
sda4 extended
sda5 boot
sda6 root
sda7 swap
...
I then moved the boot partitions in the root partitions so swaps are the last ones.
so now my layout is :
sda4 extended
sda5 root
sda6 swap
I know i have to fix entries in /boot/grub/grub.conf and /etc/fstab and unzip, edit and rezip the kernel init files in /boot directory.
The problem is how to declare the swap files, what string to use.
If for example i create the swap file described in the procedure above would it work if i edited the kernel root line in grub.conf and added the string :
resume=/dev/sda5/swap.img
Would i have to do the same for the kernel init file as there is a line there :
resume /dev/sda6
and change it to :
resume /dev/sda5/swap.img
or could i just delete that line and use only the above kernel parameter in grub.conf?
Thank you in advance.
Regards.