linux
Sharing swap partitions between Linux and Windows
Filed in archive Linux For Windows Users by Michael Hammer on August 28, 2006
Format the partition as a dos partition, and create the Windows swap file on it, but don't run windows yet. (You want to keep the swap file completely empty for now, so that it compresses well).
Boot linux and save the partition into a file. For example if the partition was /dev/hda8:
dd if=/dev/hda8 of=/etc/dosswap

Compress the dosswap file; since it is virtually all 0's it will compress very well
gzip -9 /etc/dosswap

Add the following to the /etc/rc file to prepare and install the swap space under Linux: XXXXX is the number of blocks in the swap partition
mkswap /dev/hda8 XXXXX
swapon -av

Make sure you add an entry for the swap partition in your /etc/fstab file
If your Init/reboot package supports /etc/brc or /sbin/brc add the following to /etc/brc, else do this by hand when you want to boot to dos|os/2 and you want to convert the swap partition back to the dos/windows version:
swapoff -av
zcat /etc/dosswap.gz | dd of=/dev/hda8 bs=1k count=100

# Note that this only writes the first 100 blocks back to the partition. I've found empirically that this is sufficient
>> What are the pros and cons of doing this?

Pros: you save a substantial amount of disk space.

Cons: if step 5 is not automatic, you have to remember to do it by hand, and it slows the reboot process by a nanosecond


Related Entries:

Permalink: Sharing swap partitions between Linux and Windows
Tags: linux  windows  tips  tip  blog  blogs  help  server  operating  system    swap  linux+windows 
Trackback: http://publish.creative-weblogging.com/publish/mt-tb.pl/34632
img Addthis img Ask img Blinklist img del.icio.us img Digg img Fark img Facebook img Google img Lycos img Ma.gnolia Add this page to Mister Wong Mr Wong img Netscape img Netvousz img Newsvine img Reddit img StumbleUpon img Slashdot img Tailrank img Technorati img Wink img Yahoo

Vote for Sharing swap partitions between Linux and Windows:

  • Currently 7.00/10
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
Rating: 7.00 out of 3 vote(s) cast.
Subscribe
Share It
RSSrss
See all blog subscribe options
Google google
What is RSS?
Yahoo! yahoo
Addthis Subscribe using any feed reader!
Bloglines Bloglines
Newsletter

TwitterFollow us on Twitter!