Author Topic: Swapfile Or Swap Partition?  (Read 3172 times)

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Swapfile Or Swap Partition?
« on: May 08, 2007, 04:34:37 am »
Because of the possible cause of too-many (= 6) partitions on microdrive for the suspend/resume hanging, I am about to reinstall the whole system on 3200 in one big partition.

Now i have a question about swapping:

If i install the whole system in one big partition, and then create another (small) swap partition, does the swap partition work well?
According to the documentation, swap partition comes as the second one (wd0b), which means it can be/has to be accessed fast enough near the beginning of the hard drive.
But if I use one big partition, which should come before the swap partition, then the swap partition will end up being at the end of the hard drive.
The question is: does this allocation for swap affect its access speed?
If it is a normal big harddisk, say several hundred GBs, then i guess this would be the case.
But how about a 6gb microdrive or a 8gb hi-speed CF on a Zaurus?
Or is it actually better to use a (contiguous?) swapfile *within* the single partition?

Or do i misunderstand the whole thing?

Sorry i am not very familiar with harddisk and partitioning. Your advice is much appreciated.  
« Last Edit: May 08, 2007, 04:37:02 am by ZDevil »

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

mathemajikian

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • http://exit3.i-55.com/~xikon/openbsdzaurus.html
Swapfile Or Swap Partition?
« Reply #1 on: May 08, 2007, 07:46:02 am »
Quote
Because of the possible cause of too-many (= 6) partitions on microdrive for the suspend/resume hanging, I am about to reinstall the whole system on 3200 in one big partition.

Sorry i am not very familiar with harddisk and partitioning. Your advice is much appreciated. 

I wouldn't really worry about the swap partition access times; in fact, it might be best to leave it on a separate partition. However, during my initial installation I only created  a wd0a partition. I didn't create a separate partition wd0b for swap. After the system was installed I created a swap file on wd0a. Directions on how to accomplish this can be found here: How to swap to a File This method will leave you with one single partition utilizing the entire micro drive, but you can't use softdep:

Quote
The swap file must not reside on a filesystem which has SoftUpdates enabled

Another alternative is to generate scripts which unmounts wd0b on suspend and standby and then remounts it on resume after a few seconds. Name the scripts standby,suspend, and resume then place them in /etc/apm/

I don't think unmounting the swap partition before suspend/standby and remounting it after resume is going to resolve your resume/suspend problems, but you can give it a try.
« Last Edit: May 08, 2007, 08:29:46 am by mathemajikian »