Swap file in cache
Swap file in cache
Wouldn't it make sense to create a swap file in the cache instead of storing one on the E or F partitions all the time? Unless of course it takes too long to create the swap file, then this would just make startup slower.
-
- Gentoox Guru!
- Posts: 1681
- Joined: Sun Sep 28, 2003 11:59 am
- Location: Manchester, UK
I'm not sure that this is possible, I doubt that the tools required to make the swap file are available at boot time. I suppose you could create and mount the swap using a script in local.start rather than using the fstab. Try adding this to you /etc/conf.d/local.start
and add this line to /etc/fstab
create the mount point
Add this to /etc/local.stop
reboot and see if it works, if so try removing the swap line from fstab then reboot and see if it still works.
Code: Select all
dd if=/dev/zero of=/mnt/fatx/y/swap bs=1024k count=256
mkswap /mnt/fatx/y/swap
swapon /mnt/fatx/y/swap
Code: Select all
/dev/hda52 /mnt/fatx/y fatx noatime 0 1
Code: Select all
mkdir /mnt/fatx/y
Code: Select all
swapoff /mnt/fatx/y/swap
rm -rf /mnt/fatx/y/swap
If you keep an open mind, will your brain fall out?
It could easily be made to be on a cache partitions... but they are extremely volatile. Games may decide to wipe swap partitions at any time. Creating the swap at boot isnt really an option as it takes about 30 seconds to initialise it. I have definitely thought this over before
The original Xbox adaptation of Gentoo