Swap file instead of swap partition?


Forum: Other Help Topics
Topic: Swap file instead of swap partition?
started by: lesliek

Posted by lesliek on Feb. 20 2006,20:30
I'm using a live CD of DSL v 2.2b on a computer with a 233Mhz cpu, 64MB of RAM and a 3GB HDD.

The HDD consists of a single partition (hda1) with Windows 98 on it. Although I'm permitted (by the computer's owner) to use any empty space on hda1, I'm not permitted to erase any of the existing data on it or to shrink it. That leaves me with 2.3GB of space on hda1 to use for DSL.

I'm now using that empty space to store my backup.tar.gz file and I've edited bootlocal.sh to keep hda1 mounted permanently, so that I can store other things in the empty space too.

Because I can't create any new partitions on hda1, I can't can't have a swap partition.

I found an article with instructions for creating a swap file to augment one's existing swap partition (http://enterprise.linux.com/article.pl?sid=05/03/02/2250257).

Could I use the technique in that article to create a swap file on hda1 when I have no swap partition?

Will DSL recognise the file as swap space and utilise it?

If so, would it be a good idea to do this?

If so, do I make the file 128MB in size?

Advice would be much appreciated.

Posted by AwPhuch on Feb. 20 2006,23:03
perhaps you can mount the /dev/hda1 then create a swapfile...even though the user running on the windows machine will then be able to delete the file later

Perhaps if you made a script to mount the partiton, build the file, format the file, then activate the file and put it in /opt/bootlocal.sh it might benefit you

< http://community.smoothwall.org/forum....wapfile >
That is how we add a swapfile, with some minor tweakage I'm sure you can get it running just fine

mount /dev/hda1 /mnt/hda1
dd if=/dev/zero of /mnt/hda1/swapfile count=131072 bs=1024
mkswap /mnt/hda1/swapfile
swapon /mnt/hda1/swapfile

That might work for you, that should build/rebuild the file "swapfile" in the c:\ directory of the windows system..which can/probably will be deleted.

Brian
AwPhuch

Posted by lesliek on Feb. 21 2006,03:39
Hi, Brian.

I gather you have an interest in spelling reform, as well as in DSL.

I followed generally the method you suggested and it does give me my swap file each time I boot up in DSL.

However, by experimenting, I found that it was unnecessary, at least in my circumstances, to add the data dump and the mkswap lines to bootlocal.sh. (The line to mount hda1 I had created earlier.)

That's because, after shutting down in DSL and then booting up in Windows 98, I found that the swap file was not deleted simply by running Windows and I don't expect the computer's owner will try to delete the file manually.

Now that I've found two specific uses for the empty space on hda1, the swap file and the backup.tar.gz file, may I ask another question related to the space's empty use?

I've read a bit about using extensions with DSL, but my understanding of them's pretty blurry so far.

Will I be able to store extensions on hda1 and run them from there?

Many thanks for taking the trouble to reply to my original post.

Leslie

Posted by AwPhuch on Feb. 21 2006,05:30
Quote (lesliek @ Feb. 20 2006,22:39)
Hi, Brian.

I gather you have an interest in spelling reform, as well as in DSL.

I followed generally the method you suggested and it does give me my swap file each time I boot up in DSL.

However, by experimenting, I found that it was unnecessary, at least in my circumstances, to add the data dump and the mkswap lines to bootlocal.sh. (The line to mount hda1 I had created earlier.)

That's because, after shutting down in DSL and then booting up in Windows 98, I found that the swap file was not deleted simply by running Windows and I don't expect the computer's owner will try to delete the file manually.

Now that I've found two specific uses for the empty space on hda1, the swap file and the backup.tar.gz file, may I ask another question related to the space's empty use?

I've read a bit about using extensions with DSL, but my understanding of them's pretty blurry so far.

Will I be able to store extensions on hda1 and run them from there?

Many thanks for taking the trouble to reply to my original post.

Leslie

Spelling reform!?!?!?

Yes you should be able to put extensions directly in c:\ or /mnt/hda1 and it will boot and find them (if you modify the menu.lst in the /boot/grub folder)

I still dont understand spelling reform??

Brian
AwPhuch

Posted by cbagger01 on Feb. 21 2006,05:48
Check the phonetic pronunciation of your user name.

That's my best guess.

Otherwise, I'm outta ideas.

Posted by lesliek on Feb. 21 2006,06:08
Thanks for your latest reply, Brian.

It's said, though I think apocryphally, that George Bernard Shaw, who was big on spelling reform, gave as one example of the need for it, the so-called word "ghoti": "gh" as in cough, "o" as in women and "ti" as in nation. Or in other words, "fish".

I understand from you that I can run extensions from hda1, but your reference to "grub" made me realise I hadn't really explained what I'm on about here. I'm not trying to get this computer to dual-boot. My idea is that if it's started with the DSL live cd in the drive, then it'll be a Linux computer and if it's started without, then it'll be a Windows computer. I really only expect it to be started with the cd in, but must leave the Windows stuff alone, because the computer owner thinks that he may just want to look at it again some day, though the last time he looked at it was
about 2000. I'm trying, just for the challenge, to make the thing useful for the owner's son as a Web browsing appliance.

Thanks again for your help,

Leslie

Posted by doobit on Feb. 21 2006,14:14
DSL reads and writes to FAT formatted drives with no problem. You might make a hidden folder in Windows by the "hidden" box in it's properties(because it will still be visible to DSL) and use that to store your backup.tar.gz file as well as any extentions. You can load the extentions or apps automatically, I believe, at bootup with the live CD with the cheat code myDSL=hda1, but then the apps need to be in the top directory of the drive. YOu can also do, as you said, use the free space on the drive to make swap and storage partitions. If you make them Linux partitions, Windows 98 won't even know they are there! In other words, unless your friend also boots from a liveCD, then he will never know that the other partitions exist.
Posted by lesliek on Feb. 21 2006,20:45
Thanks very much for those suggestions, doobit. They would help make it less likely that the computer owner, if he ever did use the computer again, would accidentally do something to disarrange the DSL things I've already put on the drive, the backup.tar.gz and swap files, and anything else I put there in the future.

I think that, at least at first, I'll see if I can effectively do what you suggest by just hiding the files themselves using an option in Windows, instead of putting them in a hidden folder. That'd avoid any problem about DSL wanting its files to be in the top directory.

Thanks again,

Leslie

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.